Modern Apps git

← Modern-Apps.git

ui: adaptive grids for wide windows; last ellipsis gaps

Commit
d982209285659fa67751851c7985eb86da90b0dc
Author
Vayun Mathur <[email protected]>
When
2026-11-20 19:10 UTC (15 days ago)
Parents
e3a4b04
Photos search results, albums and people grids, and the pdf
cut/glue grid used fixed 2-3 column counts, producing giant
tiles on tablets/desktop. They now use adaptiveGridCells with
cell sizes chosen so phone widths keep today's column counts
(Albums at 120dp: 160dp collapsed to one column and failed
eight photos tests). The pinch-zoom grid family is untouched.

Eight remaining single-line Texts without ellipsis (car host,
download progress, TV cards/controls, history scrubber, game
info boxes, photos OCR overlay) gained
TextOverflow.Ellipsis; the shared editable text overlay is
intentionally excluded.

Two dead RAW SCAFFOLD EXCEPTION markers deleted (euicc QR
screen already uses AppScaffold; launcher TV home has no
scaffold at all) - comment-only.

Verified: :photos:testDevUnitTest 790/790 plus compile for
photos, pdf, library tv, euicc, launcher and touched libraries.

Diff

euicc/src/main/java/com/vayunmathur/euicc/ui/QrScannerScreen.kt
diff --git a/euicc/src/main/java/com/vayunmathur/euicc/ui/QrScannerScreen.kt b/euicc/src/main/java/com/vayunmathur/euicc/ui/QrScannerScreen.ktindex 92b2851bd4..d2e76bf367 100644--- a/euicc/src/main/java/com/vayunmathur/euicc/ui/QrScannerScreen.kt+++ b/euicc/src/main/java/com/vayunmathur/euicc/ui/QrScannerScreen.kt@@ -57,7 +57,6 @@ import java.util.concurrent.Executors  * itself is a raw `Box` rather than a scaffold body — a viewfinder has no heading or  * footer of its own, and the cancel action overlays it the way the platform LPA does.  */-// RAW SCAFFOLD EXCEPTION: full-bleed camera viewfinder; AppScaffold hosts the bar only. @Composable fun QrScannerScreen(backStack: NavBackStack<Route>, onResult: (String) -> Unit) {     val context = LocalContext.current
launcher/src/main/java/com/vayunmathur/launcher/ui/TvHomeScreen.kt
diff --git a/launcher/src/main/java/com/vayunmathur/launcher/ui/TvHomeScreen.kt b/launcher/src/main/java/com/vayunmathur/launcher/ui/TvHomeScreen.ktindex 72f03b884e..5613e40b6c 100644--- a/launcher/src/main/java/com/vayunmathur/launcher/ui/TvHomeScreen.kt+++ b/launcher/src/main/java/com/vayunmathur/launcher/ui/TvHomeScreen.kt@@ -18,8 +18,6 @@ import com.vayunmathur.library.ui.Text import com.vayunmathur.library.ui.TextButton import com.vayunmathur.launcher.ui.components.TvReorderHint -// RAW SCAFFOLD EXCEPTION: TV launcher fullscreen grid, no app bar.- /**  * The TV home screen: clock header, app banner grid, bottom glass row, edit overlays.  *
library/carhost/src/main/java/com/vayunmathur/library/carhost/CarTemplateView.kt
diff --git a/library/carhost/src/main/java/com/vayunmathur/library/carhost/CarTemplateView.kt b/library/carhost/src/main/java/com/vayunmathur/library/carhost/CarTemplateView.ktindex 55f78ac342..169a33d16a 100644--- a/library/carhost/src/main/java/com/vayunmathur/library/carhost/CarTemplateView.kt+++ b/library/carhost/src/main/java/com/vayunmathur/library/carhost/CarTemplateView.kt@@ -315,7 +315,7 @@ private fun InCallRenderer(template: HostTemplate.InCall, modifier: Modifier = M         verticalArrangement = Arrangement.spacedBy(CAR_GAP, Alignment.CenterVertically),     ) {         ArtworkTile(null, Modifier.size(120.dp), CircleShapeLike)-        template.title?.let { Text(it, style = MaterialTheme.typography.headlineMedium, maxLines = 1) }+        template.title?.let { Text(it, style = MaterialTheme.typography.headlineMedium, maxLines = 1, overflow = TextOverflow.Ellipsis) }         for (line in template.texts) Text(line, style = MaterialTheme.typography.bodyLarge)         if (template.loading) LoadingRow()         ActionRow(template.actions)
library/tv/src/main/java/com/vayunmathur/library/tv/TvCards.kt
diff --git a/library/tv/src/main/java/com/vayunmathur/library/tv/TvCards.kt b/library/tv/src/main/java/com/vayunmathur/library/tv/TvCards.ktindex b1bdb87225..f18f884d8b 100644--- a/library/tv/src/main/java/com/vayunmathur/library/tv/TvCards.kt+++ b/library/tv/src/main/java/com/vayunmathur/library/tv/TvCards.kt@@ -141,6 +141,7 @@ fun TvBadge(         style = MaterialTheme.typography.labelMedium,         color = content,         maxLines = 1,+        overflow = TextOverflow.Ellipsis,         modifier = modifier             .background(container, MaterialTheme.shapes.extraSmall)             .padding(horizontal = 8.dp, vertical = 3.dp),
library/tv/src/main/java/com/vayunmathur/library/tv/TvControls.kt
diff --git a/library/tv/src/main/java/com/vayunmathur/library/tv/TvControls.kt b/library/tv/src/main/java/com/vayunmathur/library/tv/TvControls.ktindex 2a753d0490..6768c65ed1 100644--- a/library/tv/src/main/java/com/vayunmathur/library/tv/TvControls.kt+++ b/library/tv/src/main/java/com/vayunmathur/library/tv/TvControls.kt@@ -113,7 +113,7 @@ fun TvChip(             focusedSelectedContentColor = scheme.inverseOnSurface,         ),     ) {-        Text(label, maxLines = 1)+        Text(label, maxLines = 1, overflow = TextOverflow.Ellipsis)     } } @@ -141,7 +141,7 @@ fun TvListRow(         headlineContent = {             Text(headline, style = MaterialTheme.typography.titleMedium, maxLines = 2, overflow = TextOverflow.Ellipsis)         },-        overlineContent = overline?.let { { Text(it, maxLines = 1) } },+        overlineContent = overline?.let { { Text(it, maxLines = 1, overflow = TextOverflow.Ellipsis) } },         supportingContent = supporting?.let {             { Text(it, style = MaterialTheme.typography.bodyMedium, maxLines = 3, overflow = TextOverflow.Ellipsis) }         },
photos/src/main/java/com/vayunmathur/photos/ui/AlbumsScreen.kt
diff --git a/photos/src/main/java/com/vayunmathur/photos/ui/AlbumsScreen.kt b/photos/src/main/java/com/vayunmathur/photos/ui/AlbumsScreen.ktindex b080809e25..1c5de22c51 100644--- a/photos/src/main/java/com/vayunmathur/photos/ui/AlbumsScreen.kt+++ b/photos/src/main/java/com/vayunmathur/photos/ui/AlbumsScreen.kt@@ -9,7 +9,6 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size-import androidx.compose.foundation.lazy.grid.GridCells import androidx.compose.foundation.lazy.grid.GridItemSpan import androidx.compose.foundation.lazy.grid.LazyVerticalGrid import androidx.compose.foundation.lazy.grid.items@@ -34,6 +33,7 @@ import androidx.core.net.toUri import com.vayunmathur.library.image.ImageRequest import com.vayunmathur.library.image.compose.AsyncImage import com.vayunmathur.library.ui.AppScaffold+import com.vayunmathur.library.ui.adaptiveGridCells import com.vayunmathur.library.ui.invisibleClickable import com.vayunmathur.library.util.NavBackStack import com.vayunmathur.photos.ui.NavigationBar@@ -70,7 +70,7 @@ fun AlbumsScreen(         bottomBar = { NavigationBar(Route.Albums, backStack) },     ) { padding ->         LazyVerticalGrid(-            columns = GridCells.Fixed(2),+            columns = adaptiveGridCells(120.dp),             horizontalArrangement = Arrangement.spacedBy(8.dp),             verticalArrangement = Arrangement.spacedBy(12.dp),             modifier = Modifier.fillMaxSize().padding(padding).padding(8.dp),
photos/src/main/java/com/vayunmathur/photos/ui/GalleryScreen.kt
diff --git a/photos/src/main/java/com/vayunmathur/photos/ui/GalleryScreen.kt b/photos/src/main/java/com/vayunmathur/photos/ui/GalleryScreen.ktindex d968f2bfaa..fc562fe6c5 100644--- a/photos/src/main/java/com/vayunmathur/photos/ui/GalleryScreen.kt+++ b/photos/src/main/java/com/vayunmathur/photos/ui/GalleryScreen.kt@@ -22,6 +22,7 @@ import androidx.compose.foundation.lazy.grid.GridItemSpan import androidx.compose.foundation.lazy.grid.LazyVerticalGrid import androidx.compose.foundation.lazy.grid.items import com.vayunmathur.library.ui.CircularProgressIndicator+import com.vayunmathur.library.ui.adaptiveGridCells import com.vayunmathur.library.ui.ExperimentalMaterial3Api import com.vayunmathur.library.ui.IconButton import com.vayunmathur.library.ui.ListItem@@ -202,7 +203,7 @@ fun GalleryScreen(                             }                             // Show search results as a photo grid                             LazyVerticalGrid(-                                GridCells.Fixed(3),+                                adaptiveGridCells(100.dp),                                 horizontalArrangement = Arrangement.spacedBy(4.dp),                                 verticalArrangement = Arrangement.spacedBy(4.dp),                                 modifier = Modifier.fillMaxSize().padding(4.dp)
photos/src/main/java/com/vayunmathur/photos/ui/OcrTextLayer.kt
diff --git a/photos/src/main/java/com/vayunmathur/photos/ui/OcrTextLayer.kt b/photos/src/main/java/com/vayunmathur/photos/ui/OcrTextLayer.ktindex e415ee2051..843f05ab79 100644--- a/photos/src/main/java/com/vayunmathur/photos/ui/OcrTextLayer.kt+++ b/photos/src/main/java/com/vayunmathur/photos/ui/OcrTextLayer.kt@@ -30,6 +30,7 @@ import androidx.compose.ui.platform.LocalTextToolbar import androidx.compose.ui.platform.TextToolbar import androidx.compose.ui.platform.TextToolbarStatus import androidx.compose.ui.text.TextStyle+import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.rememberTextMeasurer import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.IntSize@@ -155,6 +156,7 @@ fun OcrTextLayer(                             text = p.text,                             style = style,                             maxLines = 1,+                            overflow = TextOverflow.Ellipsis,                             softWrap = false,                             modifier = Modifier                                 .offset { IntOffset(p.origin.x.roundToInt(), p.origin.y.roundToInt()) }
photos/src/main/java/com/vayunmathur/photos/ui/PeoplePage.kt
diff --git a/photos/src/main/java/com/vayunmathur/photos/ui/PeoplePage.kt b/photos/src/main/java/com/vayunmathur/photos/ui/PeoplePage.ktindex 632ce3e0ae..b3bda21ce1 100644--- a/photos/src/main/java/com/vayunmathur/photos/ui/PeoplePage.kt+++ b/photos/src/main/java/com/vayunmathur/photos/ui/PeoplePage.kt@@ -14,11 +14,11 @@ import androidx.compose.foundation.layout.aspectRatio import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding-import androidx.compose.foundation.lazy.grid.GridCells import androidx.compose.foundation.lazy.grid.LazyVerticalGrid import androidx.compose.foundation.lazy.grid.items import androidx.compose.foundation.shape.CircleShape import com.vayunmathur.library.ui.ExperimentalMaterial3Api+import com.vayunmathur.library.ui.adaptiveGridCells import com.vayunmathur.library.ui.LinearProgressIndicator import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.Scaffold@@ -161,7 +161,7 @@ internal fun PeopleGrid(     onClick: (PersonCluster) -> Unit, ) {     LazyVerticalGrid(-        columns = GridCells.Fixed(3),+        columns = adaptiveGridCells(100.dp),         horizontalArrangement = Arrangement.spacedBy(8.dp),         verticalArrangement = Arrangement.spacedBy(8.dp),         modifier = modifier.fillMaxSize().padding(8.dp),