news: reader top bar cleaned; icon-only action row
- Commit
3449d7816511d5f17046087f317409c7c7a09e22- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-23 20:18 UTC (12 days ago)
- Parents
7c4429d
The generic 'Article' title is gone (empty bar, back nav only), and the four reader controls are icon-only buttons in the action row - bookmark, serif toggle, text size down/up - labels preserved as accessibility descriptions. Verified: news tests + compile green.
Diff
news/src/main/java/com/vayunmathur/news/ui/ReaderScreen.kt
diff --git a/news/src/main/java/com/vayunmathur/news/ui/ReaderScreen.kt b/news/src/main/java/com/vayunmathur/news/ui/ReaderScreen.ktindex ecc7051de3..42a6664f36 100644--- a/news/src/main/java/com/vayunmathur/news/ui/ReaderScreen.kt+++ b/news/src/main/java/com/vayunmathur/news/ui/ReaderScreen.kt@@ -14,16 +14,19 @@ import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.stringResource+import androidx.compose.ui.semantics.contentDescription+import androidx.compose.ui.semantics.semantics import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.vayunmathur.library.image.compose.AsyncImage import com.vayunmathur.library.ui.AppScaffold-import com.vayunmathur.library.ui.FilterChip import com.vayunmathur.library.ui.IconBookmark import com.vayunmathur.library.ui.IconBookmarkBorder import com.vayunmathur.library.ui.IconButton import com.vayunmathur.library.ui.IconTextTool+import com.vayunmathur.library.ui.IconZoomIn+import com.vayunmathur.library.ui.IconZoomOut import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.Text import com.vayunmathur.news.R@@ -33,9 +36,10 @@ import com.vayunmathur.news.platform.NewsViewModel /** * First-class reader: the extracted clean article (title, byline, date, * comfortable measure, adjustable size, serif/sans). Reader-only: there- * is no original-page WebView or open-in-browser affordance, and the- * top app bar carries no actions — bookmark, text size and serif live- * in an in-content action row below the title.+ * is no original-page WebView or open-in-browser affordance. The top+ * app bar is empty apart from back navigation (no generic title), and+ * bookmark, text size and serif live in an icon-only in-content action+ * row below the title. */ @Composable fun ReaderScreen(viewModel: NewsViewModel, url: String, onBack: () -> Unit) {@@ -46,7 +50,10 @@ fun ReaderScreen(viewModel: NewsViewModel, url: String, onBack: () -> Unit) { val serif by viewModel.readerSerif.collectAsState() LaunchedEffect(url) { viewModel.openArticle(url) } AppScaffold(- title = stringResource(R.string.reader_title),+ // No generic "Article" title: the article's own headline is in+ // the content, so the bar carries only back navigation (the+ // empty-title placement the feed uses for its search bar).+ title = "", onNavigateBack = onBack, ) { padding -> Column(@@ -76,7 +83,12 @@ fun ReaderScreen(viewModel: NewsViewModel, url: String, onBack: () -> Unit) { } } -/** In-content reader actions: bookmark, serif/sans, and text size. */+/**+ * In-content reader actions: bookmark, serif/sans, and text size.+ * Icon-only (no text labels); each button carries a content description+ * for accessibility, and the serif toggle is tinted primary while serif+ * is active, mirroring the bookmark's filled state.+ */ @Composable private fun ReaderActionRow( bookmarked: Boolean,@@ -86,29 +98,37 @@ private fun ReaderActionRow( onTextSp: (Int) -> Unit, onSerif: (Boolean) -> Unit, ) {+ val serifDescription = stringResource(if (serif) R.string.reader_serif else R.string.reader_sans)+ val smallerDescription = stringResource(R.string.reader_text_smaller)+ val largerDescription = stringResource(R.string.reader_text_larger) Row(modifier = Modifier.fillMaxWidth().padding(vertical = 12.dp)) { IconButton(onClick = onToggleBookmark) { if (bookmarked) IconBookmark() else IconBookmarkBorder() }- FilterChip(- selected = serif,+ IconButton( onClick = { onSerif(!serif) },- label = { Text(if (serif) stringResource(R.string.reader_serif) else stringResource(R.string.reader_sans)) },- leadingIcon = { IconTextTool() },- modifier = Modifier.padding(start = 8.dp),- )- FilterChip(- selected = false,+ modifier = Modifier.semantics { contentDescription = serifDescription },+ ) {+ IconTextTool(+ tint = if (serif) {+ MaterialTheme.colorScheme.primary+ } else {+ MaterialTheme.colorScheme.onSurfaceVariant+ },+ )+ }+ IconButton( onClick = { onTextSp(textSp - 1) },- label = { Text(stringResource(R.string.reader_text_smaller)) },- modifier = Modifier.padding(start = 8.dp),- )- FilterChip(- selected = false,+ modifier = Modifier.semantics { contentDescription = smallerDescription },+ ) {+ IconZoomOut()+ }+ IconButton( onClick = { onTextSp(textSp + 1) },- label = { Text(stringResource(R.string.reader_text_larger)) },- modifier = Modifier.padding(start = 8.dp),- )+ modifier = Modifier.semantics { contentDescription = largerDescription },+ ) {+ IconZoomIn()+ } } }
news/src/main/res/values/strings.xml
diff --git a/news/src/main/res/values/strings.xml b/news/src/main/res/values/strings.xmlindex 97e6f88807..e1276717df 100644--- a/news/src/main/res/values/strings.xml+++ b/news/src/main/res/values/strings.xml@@ -11,7 +11,6 @@ <string name="feed_search_placeholder">Search downloaded news</string> <string name="feed_search_empty">No downloaded articles match. Search covers titles and articles you have opened.</string> <!-- ReaderScreen -->- <string name="reader_title">Article</string> <string name="reader_text_smaller">Smaller text</string> <string name="reader_text_larger">Larger text</string> <string name="reader_serif">Serif</string>