feat(about): add link buttons and logo rounding (#16)
## Summary - add rounded corners to the About page logo - add GitHub profile links for KremeCN, Moler, and alZerNest - add personal website links for KremeCN and Moler - localize link content descriptions in English and Simplified Chinese ## Verification - debug build completed successfully - APK installed on emulator Reviewed-on: #16 Co-authored-by: KremeCN <3265494849@qq.com>
This commit was merged in pull request #16.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.flagship.abox.manager.ui.about
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
@@ -13,9 +14,12 @@ import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.outlined.Language
|
||||
import androidx.compose.material3.Card
|
||||
import androidx.compose.material3.CardDefaults
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Text
|
||||
@@ -24,7 +28,9 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalUriHandler
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
@@ -84,7 +90,9 @@ fun AboutScreen(
|
||||
Image(
|
||||
painter = painterResource(R.drawable.ic_abox_logo_master),
|
||||
contentDescription = stringResource(R.string.app_name),
|
||||
modifier = Modifier.size(88.dp),
|
||||
modifier = Modifier
|
||||
.size(88.dp)
|
||||
.clip(RoundedCornerShape(16.dp)),
|
||||
)
|
||||
Text(
|
||||
stringResource(R.string.app_name),
|
||||
@@ -113,10 +121,10 @@ fun AboutScreen(
|
||||
}
|
||||
|
||||
AboutSection(stringResource(R.string.about_team)) {
|
||||
TeamMember("KremeCN", stringResource(R.string.about_role_foundation))
|
||||
TeamMember("alZerNest", stringResource(R.string.about_role_devices))
|
||||
TeamMember("KremeCN", stringResource(R.string.about_role_foundation), "https://github.com/KremeCN", "https://kimico.de/")
|
||||
TeamMember("alZerNest", stringResource(R.string.about_role_devices), "https://github.com/alZerNest")
|
||||
TeamMember("Aurum", stringResource(R.string.about_role_environment))
|
||||
TeamMember("Moler", stringResource(R.string.about_role_infrared))
|
||||
TeamMember("Moler", stringResource(R.string.about_role_infrared), "https://github.com/mxhsnd", "https://emoler.net/")
|
||||
TeamMember("tzh", stringResource(R.string.about_role_scenes))
|
||||
}
|
||||
|
||||
@@ -166,13 +174,43 @@ private fun AboutValueRow(label: String, value: String) {
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun TeamMember(name: String, role: String) {
|
||||
private fun TeamMember(
|
||||
name: String,
|
||||
role: String,
|
||||
githubUrl: String? = null,
|
||||
personalUrl: String? = null,
|
||||
) {
|
||||
val uriHandler = LocalUriHandler.current
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Text(name, fontWeight = FontWeight.SemiBold)
|
||||
if (githubUrl != null) {
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.ic_github),
|
||||
contentDescription = stringResource(R.string.about_link_github),
|
||||
modifier = Modifier
|
||||
.padding(start = 6.dp)
|
||||
.size(18.dp)
|
||||
.clickable { uriHandler.openUri(githubUrl) },
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
}
|
||||
if (personalUrl != null) {
|
||||
Icon(
|
||||
imageVector = Icons.Outlined.Language,
|
||||
contentDescription = stringResource(R.string.about_link_personal),
|
||||
modifier = Modifier
|
||||
.padding(start = 6.dp)
|
||||
.size(18.dp)
|
||||
.clickable { uriHandler.openUri(personalUrl) },
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
}
|
||||
}
|
||||
Text(
|
||||
role,
|
||||
modifier = Modifier.padding(start = 16.dp),
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M12,2C6.48,2 2,6.58 2,12.26c0,4.53 2.87,8.37 6.84,9.73c0.5,0.09 0.68,-0.22 0.68,-0.49c0,-0.24 -0.01,-0.88 -0.01,-1.49c-2.78,0.62 -3.37,-1.37 -3.37,-1.37c-0.45,-1.18 -1.11,-1.5 -1.11,-1.5c-0.91,-0.64 0.07,-0.62 0.07,-0.62c1.01,0.07 1.53,1.06 1.53,1.06c0.89,1.57 2.34,1.12 2.91,0.86c0.09,-0.66 0.35,-1.12 0.63,-1.38c-2.22,-0.26 -4.56,-1.14 -4.56,-5.07c0,-1.12 0.39,-2.03 1.03,-2.75c-0.1,-0.26 -0.45,-1.3 0.1,-2.71c0,0 0.84,-0.28 2.75,1.05c0.8,-0.23 1.65,-0.34 2.5,-0.34c0.85,0 1.7,0.12 2.5,0.34c1.91,-1.33 2.75,-1.05 2.75,-1.05c0.55,1.41 0.2,2.45 0.1,2.71c0.64,0.71 1.03,1.63 1.03,2.75c0,3.94 -2.34,4.8 -4.57,5.06c0.36,0.31 0.68,0.92 0.68,1.86c0,1.34 -0.01,2.42 -0.01,2.75c0,0.27 0.18,0.58 0.69,0.48c3.97,-1.36 6.83,-5.2 6.83,-9.73C22,6.58 17.52,2 12,2z"/>
|
||||
</vector>
|
||||
@@ -367,6 +367,8 @@
|
||||
<string name="about_role_scenes">情景与应用集成</string>
|
||||
<string name="about_copyright">由 Flagship 开发团队共同构建。</string>
|
||||
<string name="about_unknown">未知</string>
|
||||
<string name="about_link_github">GitHub 主页</string>
|
||||
<string name="about_link_personal">个人主页</string>
|
||||
<string name="scene_create_sheet_title">新建指令</string>
|
||||
<string name="scene_create_sheet_description">选择指令的启动方式</string>
|
||||
<string name="scene_create_manual_description">手动点击运行,适合常用的一键设备组合。</string>
|
||||
|
||||
@@ -367,6 +367,8 @@
|
||||
<string name="about_role_scenes">Scenes and integration</string>
|
||||
<string name="about_copyright">Developed by Flagship.</string>
|
||||
<string name="about_unknown">Unknown</string>
|
||||
<string name="about_link_github">GitHub profile</string>
|
||||
<string name="about_link_personal">Personal website</string>
|
||||
<string name="scene_create_sheet_title">New command</string>
|
||||
<string name="scene_create_sheet_description">Choose how the command starts</string>
|
||||
<string name="scene_create_manual_description">Run manually for frequently used device combinations.</string>
|
||||
|
||||
Reference in New Issue
Block a user