Skip to content

Commit 3c7b586

Browse files
committed
fix: align about cluster with production parity
1 parent 7fa34b9 commit 3c7b586

2 files changed

Lines changed: 121 additions & 60 deletions

File tree

app/src/main/java/me/rosuh/easywatermark/ui/about/AboutScreen.kt

Lines changed: 114 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
package me.rosuh.easywatermark.ui.about
22

3+
import android.widget.ImageView
34
import androidx.compose.foundation.Image
5+
import androidx.compose.foundation.background
46
import androidx.compose.foundation.clickable
57
import androidx.compose.foundation.layout.Arrangement
8+
import androidx.compose.foundation.layout.Box
69
import androidx.compose.foundation.layout.Column
10+
import androidx.compose.foundation.layout.PaddingValues
711
import androidx.compose.foundation.layout.Row
812
import androidx.compose.foundation.layout.Spacer
913
import androidx.compose.foundation.layout.fillMaxSize
1014
import androidx.compose.foundation.layout.fillMaxWidth
1115
import androidx.compose.foundation.layout.height
1216
import androidx.compose.foundation.layout.padding
1317
import androidx.compose.foundation.layout.size
18+
import androidx.compose.foundation.pager.HorizontalPager
19+
import androidx.compose.foundation.pager.rememberPagerState
1420
import androidx.compose.foundation.rememberScrollState
1521
import androidx.compose.foundation.shape.RoundedCornerShape
1622
import androidx.compose.foundation.verticalScroll
23+
import androidx.compose.material3.Card
1724
import androidx.compose.material3.Icon
1825
import androidx.compose.material3.IconButton
1926
import androidx.compose.material3.MaterialTheme
@@ -23,12 +30,15 @@ import androidx.compose.runtime.Composable
2330
import androidx.compose.ui.Alignment
2431
import androidx.compose.ui.Modifier
2532
import androidx.compose.ui.draw.clip
33+
import androidx.compose.ui.graphics.Brush
34+
import androidx.compose.ui.graphics.Color
2635
import androidx.compose.ui.layout.ContentScale
2736
import androidx.compose.ui.res.painterResource
2837
import androidx.compose.ui.res.stringResource
29-
import androidx.compose.ui.text.style.TextAlign
3038
import androidx.compose.ui.unit.dp
39+
import androidx.compose.ui.viewinterop.AndroidView
3140
import me.rosuh.easywatermark.R
41+
import me.rosuh.easywatermark.ui.widget.ColoredImageVIew
3242

3343
/**
3444
* Compose replacement for the legacy [AboutActivity] (View→Compose migration).
@@ -47,30 +57,53 @@ fun AboutScreen(
4757
onToggleDynamicColor: (Boolean) -> Unit,
4858
modifier: Modifier = Modifier,
4959
) {
50-
Column(
51-
modifier = modifier
52-
.fillMaxSize()
53-
.verticalScroll(rememberScrollState())
54-
) {
55-
Row(
56-
modifier = Modifier.fillMaxWidth().padding(8.dp),
57-
verticalAlignment = Alignment.CenterVertically
60+
Box(modifier = modifier.fillMaxSize()) {
61+
// D2 (S4d-206): production v2.10.0 shows a soft lavender radial glow at the top behind the centered
62+
// logo. A fixed decorative layer behind the scrolling content (theme primary → transparent).
63+
Box(
64+
modifier = Modifier
65+
.align(Alignment.TopCenter)
66+
.fillMaxWidth()
67+
.height(280.dp)
68+
.background(
69+
Brush.radialGradient(
70+
colors = listOf(
71+
MaterialTheme.colorScheme.primary.copy(alpha = 0.22f),
72+
Color.Transparent,
73+
)
74+
)
75+
)
76+
)
77+
Column(
78+
modifier = Modifier
79+
.fillMaxSize()
80+
.verticalScroll(rememberScrollState())
5881
) {
59-
IconButton(onClick = onBack) {
60-
Icon(
61-
painter = painterResource(id = R.drawable.ic_back),
62-
contentDescription = "back",
63-
tint = MaterialTheme.colorScheme.onSurface
82+
// D1 (S4d-206): back arrow at start + the brand mark CENTERED and dynamic-colored/animated
83+
// (ColoredImageVIew, the same widget LaunchScreen uses), matching production — was a static,
84+
// left-aligned Image(ic_logo_about_page).
85+
Box(modifier = Modifier.fillMaxWidth().padding(8.dp)) {
86+
IconButton(onClick = onBack, modifier = Modifier.align(Alignment.CenterStart)) {
87+
Icon(
88+
painter = painterResource(id = R.drawable.ic_back),
89+
contentDescription = "back",
90+
tint = MaterialTheme.colorScheme.onSurface
91+
)
92+
}
93+
AndroidView(
94+
modifier = Modifier.align(Alignment.Center).height(28.dp),
95+
factory = { ctx ->
96+
ColoredImageVIew(ctx).apply {
97+
adjustViewBounds = true
98+
scaleType = ImageView.ScaleType.FIT_CENTER
99+
setImageResource(R.drawable.ic_logo_about_page)
100+
start()
101+
}
102+
}
64103
)
65104
}
66-
Image(
67-
painter = painterResource(id = R.drawable.ic_logo_about_page),
68-
contentDescription = null,
69-
modifier = Modifier.padding(start = 8.dp).height(28.dp)
70-
)
71-
}
72105

73-
SectionHeader(stringResource(R.string.about_title_info))
106+
SectionHeader(stringResource(R.string.about_title_info))
74107
AboutRow(R.drawable.ic_version, stringResource(R.string.about_title_version), trailing = versionName) {
75108
onOpenLink(URL_RELEASES)
76109
}
@@ -95,12 +128,16 @@ fun AboutScreen(
95128
onOpenLink(URL_PRIVACY_EN)
96129
}
97130

98-
SwitchRow("Force Open Dynamic Color Support", dynamicColorOn, onToggleDynamicColor)
99-
SwitchRow("Show Bounds", showBounds, onToggleBounds)
100-
131+
// Parity (S4d-205): production v2.10.0 places the developer footer ABOVE the toggles, with the
132+
// two switches at the very bottom of the screen. Match that order (footer → switches).
101133
Spacer(Modifier.height(24.dp))
102134
DevFooter(onOpenLink = onOpenLink)
103135
Spacer(Modifier.height(24.dp))
136+
137+
SwitchRow("Force Open Dynamic Color Support", dynamicColorOn, onToggleDynamicColor)
138+
SwitchRow("Show Bounds", showBounds, onToggleBounds)
139+
Spacer(Modifier.height(24.dp))
140+
}
104141
}
105142
}
106143

@@ -168,39 +205,65 @@ private fun SwitchRow(label: String, checked: Boolean, onCheckedChange: (Boolean
168205
}
169206
}
170207

208+
private data class DevCardData(val title: String, val desc: String, val avatar: Int, val url: String)
209+
171210
@Composable
172211
private fun DevFooter(onOpenLink: (String) -> Unit) {
212+
// D4 (S4d-206): production v2.10.0 shows a horizontal card pager (developer card + designer card, the
213+
// next one peeking) with a SINGLE centered avatar below that tracks the current page — replacing the
214+
// simplified one-quote + two-avatar-row layout.
215+
val cards = listOf(
216+
DevCardData(
217+
title = "Developed with ♥ by rosu",
218+
desc = stringResource(R.string.dev_comment),
219+
avatar = R.drawable.bg_avatar_dev,
220+
url = URL_DEV,
221+
),
222+
DevCardData(
223+
title = "Designed with ♥ by tovi",
224+
desc = "A Designer.",
225+
avatar = R.drawable.ic_avatar_tovi,
226+
url = URL_DESIGNER,
227+
),
228+
)
229+
val pagerState = rememberPagerState(pageCount = { cards.size })
173230
Column(
174-
modifier = Modifier.fillMaxWidth().padding(horizontal = 24.dp),
231+
modifier = Modifier.fillMaxWidth(),
175232
horizontalAlignment = Alignment.CenterHorizontally,
176-
verticalArrangement = Arrangement.spacedBy(12.dp)
233+
verticalArrangement = Arrangement.spacedBy(16.dp)
177234
) {
178-
Text(
179-
text = stringResource(R.string.dev_comment),
180-
style = MaterialTheme.typography.bodyMedium,
181-
color = MaterialTheme.colorScheme.onSurfaceVariant,
182-
textAlign = TextAlign.Center
183-
)
184-
Row(horizontalArrangement = Arrangement.spacedBy(24.dp)) {
185-
Image(
186-
painter = painterResource(id = R.drawable.bg_avatar_dev),
187-
contentDescription = "developer",
188-
contentScale = ContentScale.Crop,
189-
modifier = Modifier
190-
.size(56.dp)
191-
.clip(RoundedCornerShape(28.dp))
192-
.clickable { onOpenLink(URL_DEV) }
193-
)
194-
Image(
195-
painter = painterResource(id = R.drawable.ic_avatar_tovi),
196-
contentDescription = "designer",
197-
contentScale = ContentScale.Crop,
198-
modifier = Modifier
199-
.size(56.dp)
200-
.clip(RoundedCornerShape(28.dp))
201-
.clickable { onOpenLink(URL_DESIGNER) }
202-
)
235+
HorizontalPager(
236+
state = pagerState,
237+
contentPadding = PaddingValues(horizontal = 48.dp),
238+
pageSpacing = 12.dp,
239+
) { page ->
240+
val c = cards[page]
241+
Card(modifier = Modifier.fillMaxWidth()) {
242+
Column(modifier = Modifier.padding(20.dp)) {
243+
Text(
244+
text = c.title,
245+
style = MaterialTheme.typography.titleMedium,
246+
color = MaterialTheme.colorScheme.onSurface
247+
)
248+
Spacer(Modifier.height(8.dp))
249+
Text(
250+
text = c.desc,
251+
style = MaterialTheme.typography.bodyMedium,
252+
color = MaterialTheme.colorScheme.onSurfaceVariant
253+
)
254+
}
255+
}
203256
}
257+
val current = cards[pagerState.currentPage]
258+
Image(
259+
painter = painterResource(id = current.avatar),
260+
contentDescription = current.title,
261+
contentScale = ContentScale.Crop,
262+
modifier = Modifier
263+
.size(56.dp)
264+
.clip(RoundedCornerShape(28.dp))
265+
.clickable { onOpenLink(current.url) }
266+
)
204267
}
205268
}
206269

app/src/main/java/me/rosuh/easywatermark/ui/about/OpenSourceScreen.kt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ import androidx.compose.foundation.layout.height
1010
import androidx.compose.foundation.layout.padding
1111
import androidx.compose.foundation.rememberScrollState
1212
import androidx.compose.foundation.verticalScroll
13-
import androidx.compose.material3.Card
14-
import androidx.compose.material3.CardDefaults
1513
import androidx.compose.material3.Icon
14+
import androidx.compose.material3.OutlinedCard
1615
import androidx.compose.material3.IconButton
1716
import androidx.compose.material3.MaterialTheme
1817
import androidx.compose.material3.Text
@@ -77,26 +76,25 @@ fun OpenSourceScreen(
7776

7877
@Composable
7978
private fun OssCard(name: String, desc: String, onClick: () -> Unit) {
80-
Card(
79+
// Parity (S4d-206, D5/D6): production v2.10.0 uses OUTLINED cards (border, transparent fill) with a
80+
// LARGE title, not a filled secondaryContainer card with a medium title.
81+
OutlinedCard(
8182
modifier = Modifier
8283
.fillMaxWidth()
8384
.padding(horizontal = 16.dp, vertical = 8.dp)
8485
.clickable(onClick = onClick),
85-
colors = CardDefaults.cardColors(
86-
containerColor = MaterialTheme.colorScheme.secondaryContainer
87-
)
8886
) {
8987
Column(modifier = Modifier.padding(16.dp)) {
9088
Text(
9189
text = name,
92-
style = MaterialTheme.typography.titleMedium,
93-
color = MaterialTheme.colorScheme.onSecondaryContainer
90+
style = MaterialTheme.typography.titleLarge,
91+
color = MaterialTheme.colorScheme.onSurface
9492
)
9593
Spacer(Modifier.height(8.dp))
9694
Text(
9795
text = desc,
9896
style = MaterialTheme.typography.bodyMedium,
99-
color = MaterialTheme.colorScheme.onSecondaryContainer
97+
color = MaterialTheme.colorScheme.onSurfaceVariant
10098
)
10199
}
102100
}

0 commit comments

Comments
 (0)