mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
fix(roaming,settings): theme colors for night mode; unclamp cards; brand title and APK name
Three detail fixes plus branding, per user review:
1. Night mode visibility (roaming page): hardcoded reference blues
(#01DDFF/#0BACF1) collapse to black under the red ColorMatrix
filter (R channel only), making the page unreadable. Replace ALL
colors with MaterialTheme.colorScheme (background/surface/
surfaceVariant/onSurface/onSurfaceVariant/primary/error). GPS
status dots become themed circles (primary/error) so they survive
the red filter; red marker keeps the original pnt drawable.
2. Settings cards unclamped:
- OtherCard: fixed height(268.dp) squeezed the last toggle row
(spacing 42/42/42/15px on device); drop the fixed height.
- CardCredits: same 268dp + SpaceBetween overflowed, gluing the
last thanks entry to the warranty line; drop fixed height, use
spacedBy(8.dp) and insert 24dp before the warranty text.
3. Branding:
- Settings top title: "Look4Sat v%s" -> "Look4Sat Pro v%s" (en/tr);
title Text no longer marquees and wraps instead (heightIn(min=48)).
- APK asset name: look4sat-<ver>.apk -> Look4Sat-Pro-<ver>.apk.
- What's-new dialog (pass_whatsnew_message) rewritten in all three
locales (en/zh/tr) with this release's changes; zh gets its own
localized title "Look4Sat Pro 更新内容".
Verified: roaming/settings/passes/app compile, 11 unit tests pass.
This commit is contained in:
1 parent
d456bdf4b5
commit
c19209655b
7 files changed
+63
-55
No files matched your search
+33
-31
@@ -31,6 +31,7 @@ import androidx.activity.compose.rememberLauncherForActivityResult
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
@@ -45,6 +46,7 @@ import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.material3.CircularProgressIndicator
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.foundation.layout.WindowInsets
|
||||
import androidx.compose.foundation.layout.windowInsetsPadding
|
||||
@@ -144,7 +146,7 @@ fun RoamingScreen() {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(Color(0xFFF2F2F2))
|
||||
.background(MaterialTheme.colorScheme.background)
|
||||
.windowInsetsPadding(WindowInsets.systemBars)
|
||||
) {
|
||||
// relativeLayout7: 顶部 GPS 状态条, 25dp 高, holo_blue_bright
|
||||
@@ -153,45 +155,45 @@ fun RoamingScreen() {
|
||||
.fillMaxWidth()
|
||||
.padding(2.dp)
|
||||
.height(25.dp)
|
||||
.background(Color(0xFF01DDFF))
|
||||
.background(MaterialTheme.colorScheme.surfaceVariant)
|
||||
) {
|
||||
Row(modifier = Modifier.fillMaxSize(), verticalAlignment = Alignment.CenterVertically) {
|
||||
// tvTitleGPS: "GPS" 14sp 黑, 左 8dp
|
||||
Text(
|
||||
text = "GPS",
|
||||
fontSize = 14.sp,
|
||||
color = Color.Black,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.padding(start = 8.dp)
|
||||
)
|
||||
// imGps: toRightOf tvTitleGPS + marginLeft 15dp (成品 main.xml)
|
||||
Spacer(modifier = Modifier.width(15.dp))
|
||||
// imGps: 绿点 (15dp)
|
||||
// imGps: 绿点 (15dp, 主题色 primary -> 夜间滤镜下可见)
|
||||
if (state.gpsOn) {
|
||||
Image(
|
||||
painter = painterResource(R.drawable.roam_gps_green),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(15.dp)
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.size(15.dp)
|
||||
.background(MaterialTheme.colorScheme.primary, CircleShape)
|
||||
)
|
||||
}
|
||||
// imGpsOff: 红点叠层 (15dp)
|
||||
// imGpsOff: 红点叠层 (15dp, 主题色 error)
|
||||
if (state.gpsOff) {
|
||||
Image(
|
||||
painter = painterResource(R.drawable.roam_gps_red),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(15.dp)
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.size(15.dp)
|
||||
.background(MaterialTheme.colorScheme.error, CircleShape)
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
// tvDate: 14sp 黑, 居中
|
||||
if (state.showDate) {
|
||||
Text(text = state.date.ifEmpty { dateText }, fontSize = 14.sp, color = Color.Black)
|
||||
Text(text = state.date.ifEmpty { dateText }, fontSize = 14.sp, color = MaterialTheme.colorScheme.onSurfaceVariant)
|
||||
}
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
// tvTime: 14sp 黑, 右对齐
|
||||
Text(
|
||||
text = state.time,
|
||||
fontSize = 14.sp,
|
||||
color = Color.Black,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.padding(end = 8.dp)
|
||||
)
|
||||
}
|
||||
@@ -201,12 +203,12 @@ fun RoamingScreen() {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.align(Alignment.Center)
|
||||
.background(Color(0xFAF8F54A))
|
||||
.background(MaterialTheme.colorScheme.primary)
|
||||
.clickable { context.startActivity(Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS)) }
|
||||
.padding(horizontal = 5.dp),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Text(text = "设置启用GPS", fontSize = 14.sp, color = Color.Black)
|
||||
Text(text = "设置启用GPS", fontSize = 14.sp, color = MaterialTheme.colorScheme.onPrimary)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -215,19 +217,19 @@ fun RoamingScreen() {
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 2.dp)
|
||||
.background(Color(0xFF01DDFF))
|
||||
.background(MaterialTheme.colorScheme.surfaceVariant)
|
||||
) {
|
||||
// 纬度行: tvLati 16sp 黑 左 8dp | tvLat 右对齐 3dp
|
||||
Row(modifier = Modifier.fillMaxWidth().padding(vertical = 2.dp), verticalAlignment = Alignment.CenterVertically) {
|
||||
Text(text = state.latLabel, fontSize = 16.sp, color = Color.Black, modifier = Modifier.padding(start = 8.dp))
|
||||
Text(text = state.latLabel, fontSize = 16.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.padding(start = 8.dp))
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
Text(text = state.latValue, fontSize = 14.sp, color = Color.Black, modifier = Modifier.padding(end = 3.dp))
|
||||
Text(text = state.latValue, fontSize = 14.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.padding(end = 3.dp))
|
||||
}
|
||||
// 经度行
|
||||
Row(modifier = Modifier.fillMaxWidth().padding(vertical = 2.dp), verticalAlignment = Alignment.CenterVertically) {
|
||||
Text(text = state.lonLabel, fontSize = 16.sp, color = Color.Black, modifier = Modifier.padding(start = 8.dp))
|
||||
Text(text = state.lonLabel, fontSize = 16.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.padding(start = 8.dp))
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
Text(text = state.lonValue, fontSize = 14.sp, color = Color.Black, modifier = Modifier.padding(end = 3.dp))
|
||||
Text(text = state.lonValue, fontSize = 14.sp, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.padding(end = 3.dp))
|
||||
}
|
||||
}
|
||||
// relativeLayout6: 定位码区, 43sp bold 黑居中
|
||||
@@ -235,13 +237,13 @@ fun RoamingScreen() {
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(2.dp)
|
||||
.background(Color(0xFF01DDFF))
|
||||
.background(MaterialTheme.colorScheme.surfaceVariant)
|
||||
) {
|
||||
Text(
|
||||
text = state.loc,
|
||||
fontSize = 43.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = Color.Black,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
textAlign = TextAlign.Center,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
)
|
||||
@@ -249,7 +251,7 @@ fun RoamingScreen() {
|
||||
if (state.showProgress) {
|
||||
CircularProgressIndicator(
|
||||
modifier = Modifier.size(24.dp).align(Alignment.Center),
|
||||
color = Color.Black,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
strokeWidth = 2.dp
|
||||
)
|
||||
}
|
||||
@@ -259,7 +261,7 @@ fun RoamingScreen() {
|
||||
text = "请稍等,加载可能需要几分钟的时间。",
|
||||
fontSize = 16.sp,
|
||||
fontStyle = androidx.compose.ui.text.font.FontStyle.Italic,
|
||||
color = Color.Black,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.align(Alignment.TopCenter).padding(top = 2.dp)
|
||||
)
|
||||
}
|
||||
@@ -284,7 +286,7 @@ fun RoamingScreen() {
|
||||
.align(Alignment.TopCenter)
|
||||
.offset(y = 2.dp)
|
||||
.size(width = 200.dp, height = 200.dp)
|
||||
.background(Color(0xFF01DDFF))
|
||||
.background(MaterialTheme.colorScheme.surfaceVariant)
|
||||
) {
|
||||
// iv: 红点 10x10dp, top|left, leftMargin/topMargin 查表绝对定位
|
||||
Image(
|
||||
@@ -300,7 +302,7 @@ fun RoamingScreen() {
|
||||
text = state.grids[4],
|
||||
fontSize = 30.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = Color.White,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
textAlign = TextAlign.Center,
|
||||
modifier = Modifier
|
||||
.size(width = 100.dp, height = 80.dp)
|
||||
@@ -320,7 +322,7 @@ fun RoamingScreen() {
|
||||
Text(
|
||||
text = "制作:US1PM 汉化:BA7LCE",
|
||||
fontSize = 10.sp,
|
||||
color = Color.Black,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
textAlign = TextAlign.Center,
|
||||
modifier = Modifier.fillMaxWidth().padding(bottom = 10.dp)
|
||||
)
|
||||
@@ -333,14 +335,14 @@ private fun GridCell(text: String, modifier: Modifier) {
|
||||
Box(
|
||||
modifier = modifier
|
||||
.padding(2.dp)
|
||||
.background(Color(0xFF0BACF1)),
|
||||
.background(MaterialTheme.colorScheme.surface),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Text(
|
||||
text = text,
|
||||
fontSize = 14.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = Color.Black,
|
||||
color = MaterialTheme.colorScheme.onSurface,
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
}
|
||||
|
||||
+8
-12
@@ -29,6 +29,7 @@ import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.lazy.grid.GridCells
|
||||
@@ -486,9 +487,7 @@ private fun OtherCardPreview() = MainTheme {
|
||||
@Composable
|
||||
private fun OtherCard(settings: OtherSettings, onAction: (SettingsAction) -> Unit) {
|
||||
ElevatedCard(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(268.dp)
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier.padding(horizontal = 8.dp, vertical = 4.dp),
|
||||
@@ -561,15 +560,11 @@ private fun CardCreditsPreview() = MainTheme { CardCredits() }
|
||||
@Composable
|
||||
private fun CardCredits(modifier: Modifier = Modifier) {
|
||||
ElevatedCard(
|
||||
modifier = modifier
|
||||
.fillMaxWidth()
|
||||
.height(268.dp)
|
||||
modifier = modifier.fillMaxWidth()
|
||||
) {
|
||||
Column(
|
||||
verticalArrangement = Arrangement.SpaceBetween,
|
||||
modifier = Modifier
|
||||
.padding(horizontal = 8.dp, vertical = 4.dp)
|
||||
.fillMaxHeight()
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
modifier = Modifier.padding(horizontal = 8.dp, vertical = 4.dp)
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.prefs_outro_title),
|
||||
@@ -578,6 +573,8 @@ private fun CardCredits(modifier: Modifier = Modifier) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.prefs_outro_thanks)
|
||||
)
|
||||
// 感谢列表与保修声明之间保留约两行间距 (用户要求)
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
Text(
|
||||
text = stringResource(id = R.string.prefs_outro_license),
|
||||
color = MaterialTheme.colorScheme.primary
|
||||
@@ -593,7 +590,7 @@ private fun TopCard(onClick: () -> Unit, modifier: Modifier = Modifier, version:
|
||||
horizontalArrangement = Arrangement.spacedBy(12.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = Modifier
|
||||
.height(48.dp)
|
||||
.heightIn(min = 48.dp)
|
||||
.clickable { onClick() }) {
|
||||
Spacer(Modifier)
|
||||
Icon(
|
||||
@@ -608,7 +605,6 @@ private fun TopCard(onClick: () -> Unit, modifier: Modifier = Modifier, version:
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.padding(end = 6.dp)
|
||||
.infiniteMarquee()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user