From 6d1cc8986a158dc83ce7a6c858d7adebde52c6ba Mon Sep 17 00:00:00 2001 From: Jeena Date: Wed, 14 Oct 2026 00:02:40 +0000 Subject: [PATCH 1/2] cards: privacy badge in the meta row, views as icon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The privacy tag sat next to the channel name — long names crowded it — and its light-on-light colors became illegible the moment a card got focus (white background). It moves to the last row (age · views) and keeps a dark chip in both states. Views render as the channel card's play icon + count instead of "1 view" text. Closes #15 --- .../jtubetv/ui/screens/list/VideoCard.kt | 57 +++++++++++++------ 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/net/jeena/jtubetv/ui/screens/list/VideoCard.kt b/app/src/main/java/net/jeena/jtubetv/ui/screens/list/VideoCard.kt index a2cfa25..0675655 100644 --- a/app/src/main/java/net/jeena/jtubetv/ui/screens/list/VideoCard.kt +++ b/app/src/main/java/net/jeena/jtubetv/ui/screens/list/VideoCard.kt @@ -1,4 +1,7 @@ package net.jeena.jtubetv.ui.screens.list +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.PlayArrow +import androidx.compose.foundation.layout.size import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -176,34 +179,52 @@ fun VideoCard( color = if (cardFocused) Color(0xFF6A6A6A) else Color(0xFFB8B8B8), maxLines = 1, overflow = TextOverflow.Ellipsis, - modifier = Modifier.weight(1f, fill = false), ) - video.privacy?.takeIf { it.id != 1 }?.let { privacy -> - if (showPrivacy) { - Text( - text = privacy.label ?: "non-public", - style = MaterialTheme.typography.labelSmall, - color = Color(0xFFC6E27C), - modifier = Modifier - .background(Color(0x33C6E27C), RoundedCornerShape(4.dp)) - .padding(horizontal = 6.dp, vertical = 2.dp), - ) - } + } + Row( + horizontalArrangement = Arrangement.spacedBy(6.dp), + verticalAlignment = Alignment.CenterVertically, + ) { + // Last row: age, then views as icon + count (the channel card's + // stat style), then the privacy tag. The tag keeps a dark chip — + // its light text was illegible on the white focused card (issue #15). + Text( + text = formatAge(video.publishedAt), + style = MaterialTheme.typography.bodySmall, + color = if (cardFocused) Color(0xFF6A6A6A) else Color(0xFF8A8A8A), + ) + androidx.compose.material3.Icon( + imageVector = androidx.compose.material.icons.Icons.Filled.PlayArrow, + contentDescription = null, + tint = if (cardFocused) Color(0xFF6A6A6A) else Color(0xFF8A8A8A), + modifier = Modifier.size(12.dp), + ) + Text( + text = video.views.toString(), + style = MaterialTheme.typography.bodySmall, + color = if (cardFocused) Color(0xFF6A6A6A) else Color(0xFF8A8A8A), + ) + video.privacy?.takeIf { showPrivacy && it.id != 1 }?.let { privacy -> + Text( + text = privacy.label ?: "non-public", + style = MaterialTheme.typography.labelSmall, + color = Color(0xFFC6E27C), + modifier = Modifier + .background(Color(0xFF222222), RoundedCornerShape(4.dp)) + .padding(horizontal = 6.dp, vertical = 2.dp), + ) } if (video.nsfw) { Text( text = "NSFW", style = MaterialTheme.typography.labelSmall, color = Color(0xFFE2A57C), + modifier = Modifier + .background(Color(0xFF222222), RoundedCornerShape(4.dp)) + .padding(horizontal = 6.dp, vertical = 2.dp), ) } } - Text( - text = formatAge(video.publishedAt) + - if (video.views > 0) " · " + formatViews(video.views) else "", - style = MaterialTheme.typography.bodySmall, - color = if (cardFocused) Color(0xFF6A6A6A) else Color(0xFF8A8A8A), - ) } } } From 44a39b83e9ac57903f6784d1611b04ab8cc49937 Mon Sep 17 00:00:00 2001 From: Jeena Date: Wed, 14 Oct 2026 00:02:40 +0000 Subject: [PATCH 2/2] drawer: open focused on the current destination Opening the menu landed focus on Home regardless of where the user was; the sensible start is the item that already carries the selected state. From there all other destinations are a D-pad step or two away. --- .../main/java/net/jeena/jtubetv/ui/screens/HomeScreen.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/jeena/jtubetv/ui/screens/HomeScreen.kt b/app/src/main/java/net/jeena/jtubetv/ui/screens/HomeScreen.kt index 6ceff14..b589e53 100644 --- a/app/src/main/java/net/jeena/jtubetv/ui/screens/HomeScreen.kt +++ b/app/src/main/java/net/jeena/jtubetv/ui/screens/HomeScreen.kt @@ -382,6 +382,8 @@ private fun MenuDrawer( onDismiss: () -> Unit, modifier: Modifier = Modifier, ) { + // Focus the destination we are on (issue #16); its item carries the red + // selected background. The first drawer item (Home) was the wrong target. val drawerFocus = remember { FocusRequester() } LaunchedEffect(Unit) { runCatching { drawerFocus.requestFocus() } } val signOutContext = androidx.compose.ui.platform.LocalContext.current @@ -405,13 +407,13 @@ private fun MenuDrawer( } else false }, ) { - Destination.entries.forEachIndexed { index, dest -> + Destination.entries.forEach { dest -> MenuDrawerItem( icon = dest.icon(), label = dest.title, selected = dest == selected, onClick = { onSelect(dest) }, - modifier = if (index == 0) Modifier.focusRequester(drawerFocus) else Modifier, + modifier = if (dest == selected) Modifier.focusRequester(drawerFocus) else Modifier, ) } Spacer(modifier = Modifier.weight(1f))