appstore: center version fact and installed label on app detail (#886)
- Commit
0e7dc8abd6ab7401b83fa411a4587b71b4c4355f- Author
- Vayun Mathur <[email protected]>
- When
- 2026-10-31 22:09 UTC (1 month ago)
- Parents
a8caeda
Same class of bug as the contacts nickname in #886, on the app detail page: - Facts row: StatCell centres its value/label via the Column's horizontalAlignment, but a value wider than its quarter-width cell (long version names) fills the cell, so alignment no longer applies and the Text's default start alignment left it pinned to the left and hard-clipped. Both texts now use textAlign = Center with an ellipsis overflow, so short values are unchanged and long ones stay centred and visibly truncated. - "Installed <version>" label under the install button sat at the start edge of the full-width action column, which has no horizontal alignment. It is now aligned CenterHorizontally under the button. Verified: ./gradlew :appstore:compileDevKotlin. ./check appstore fails only on pre-existing findings in untouched files (TvStoreViewModel.kt FileLength lint, detekt backlog).
Diff
appstore/src/main/java/com/vayunmathur/appstore/ui/AppDetailSections.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/ui/AppDetailSections.kt b/appstore/src/main/java/com/vayunmathur/appstore/ui/AppDetailSections.ktindex 598029f97d..20de68b1e2 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/ui/AppDetailSections.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/ui/AppDetailSections.kt@@ -100,6 +100,7 @@ internal fun AppInstallActions( stringResource(R.string.installed_2, state.installedInfo.versionName), style = MaterialTheme.typography.labelSmall, color = MaterialTheme.colorScheme.onSurfaceVariant,+ modifier = Modifier.align(Alignment.CenterHorizontally), ) }
appstore/src/main/java/com/vayunmathur/appstore/ui/AppMeta.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/ui/AppMeta.kt b/appstore/src/main/java/com/vayunmathur/appstore/ui/AppMeta.ktindex a13cfe0d0b..f34f464b7b 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/ui/AppMeta.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/ui/AppMeta.kt@@ -5,6 +5,8 @@ import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.text.font.FontWeight+import androidx.compose.ui.text.style.TextAlign+import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import com.vayunmathur.library.ui.Card import com.vayunmathur.library.ui.CardDefaults@@ -21,12 +23,18 @@ fun StatCell(label: String, value: String, modifier: Modifier = Modifier) { style = MaterialTheme.typography.titleSmall, fontWeight = FontWeight.SemiBold, maxLines = 1,+ // A value wider than the cell (long version names) fills it, so the column's+ // alignment no longer applies and the text would sit at the start edge.+ textAlign = TextAlign.Center,+ overflow = TextOverflow.Ellipsis, ) Text( label, style = MaterialTheme.typography.labelSmall, color = MaterialTheme.colorScheme.onSurfaceVariant, maxLines = 1,+ textAlign = TextAlign.Center,+ overflow = TextOverflow.Ellipsis, ) } }