Release 0.1.2 with navigation sounds and smoother Home scrolling
All checks were successful
Validate and publish Kaleido / android (push) Successful in 2m14s
All checks were successful
Validate and publish Kaleido / android (push) Successful in 2m14s
This commit is contained in:
parent
6269425b33
commit
430616330b
21 changed files with 232 additions and 18 deletions
|
|
@ -49,6 +49,8 @@ Use `& $KaleidoPython` before the Python commands below. Run only checks relevan
|
|||
| `scripts/repro_runtime.py credits` | Visible Skip credits, season/related rows and cancellable countdown; **debug** |
|
||||
| `scripts/device.py screenshot <name>` | Capture to ignored `evidence/private/`; also supports `hierarchy`, `logs`, `launch`, `key` |
|
||||
| `scripts/profile_browse.py` | Targeted atrace investigation when navigation performance regresses |
|
||||
| `scripts/profile_home.py <label>` | Hero → Continue Watching frame timing; profiled **release**; `--cold --cycles 1` checks the first transition |
|
||||
| `scripts/verify_navigation_sounds.py` | Sound toggle and cold-start persistence; leaves sounds On |
|
||||
|
||||
Live Android integration tests (currently six) cover secure persistence, library APIs, episodes, PIN, preview JPEGs/new seasons and supported HEVC remux negotiation:
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
# Kaleido releases
|
||||
|
||||
## 0.1.2
|
||||
|
||||
- Add navigation tap sounds with a persistent On/Off setting under Settings > Interface. Sounds default to On and follow the TV's system sound-effects setting.
|
||||
- Reduce Home hero-to-Continue Watching stutter by preparing nearby rows and retaining them across return navigation.
|
||||
- Include the navigation-sound focus paths in the baseline profile for optimized release navigation.
|
||||
|
||||
## 0.1.1
|
||||
|
||||
- Use official Rotten Tomatoes Hot and Stale audience badges with proportional scaling beside ratings.
|
||||
|
|
|
|||
|
|
@ -4,3 +4,5 @@ HPLtv/kaleido/app/FocusedBrowseKt**->**(**)**
|
|||
HPLtv/kaleido/app/BrowseScreensKt**->**(**)**
|
||||
HPLtv/kaleido/app/DiscoveryScreensKt**->**(**)**
|
||||
HPLtv/kaleido/app/ThemeKt**->**(**)**
|
||||
HPLtv/kaleido/app/NavigationSoundsKt**->**(**)**
|
||||
HPLtv/kaleido/app/NavigationSoundController;->**(**)**
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ private fun anticipateTileMove(vm:KaleidoViewModel,items:List<Title>,index:Int,d
|
|||
val requester=remember{FocusRequester()}
|
||||
val scale by animateFloatAsState(if(focused)1.035f else 1f,tween(180),label="artworkFocus")
|
||||
LaunchedEffect(Unit){if(vm.focusId==focusKey){delay(220);runCatching{requester.requestFocus()}}}
|
||||
Column((if(fillWidth)Modifier.fillMaxWidth()else Modifier.width(if(landscape)216.dp else 132.dp)).onPreviewKeyEvent{if(it.type==KeyEventType.KeyDown)onMove(it.key);false}.graphicsLayer{scaleX=scale;scaleY=scale}.focusRequester(requester).onFocusChanged{focused=it.isFocused;if(it.isFocused)vm.focusId=focusKey}.clickable{vm.open(item)}) {
|
||||
Column((if(fillWidth)Modifier.fillMaxWidth()else Modifier.width(if(landscape)216.dp else 132.dp)).onPreviewKeyEvent{if(it.type==KeyEventType.KeyDown)onMove(it.key);false}.graphicsLayer{scaleX=scale;scaleY=scale}.focusRequester(requester).navigationSound().onFocusChanged{focused=it.isFocused;if(it.isFocused)vm.focusId=focusKey}.clickable{vm.open(item)}) {
|
||||
Box(Modifier.fillMaxWidth().aspectRatio(if(landscape)16f/9f else 2f/3f).graphicsLayer{shadowElevation=if(focused)12.dp.toPx()else 0f;shape=RoundedCornerShape(Cinema.radius)}.clip(RoundedCornerShape(Cinema.radius))) {
|
||||
val artwork=if(landscape&&item.type=="episode")item.thumb.ifBlank{item.art}else if(landscape)item.art.ifBlank{item.thumb}else item.thumb
|
||||
Artwork(vm.api,artwork,Modifier.fillMaxSize(),if(landscape)720 else 450,if(landscape)405 else 675)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ package tv.kaleido.app
|
|||
import androidx.compose.foundation.*
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.lazy.*
|
||||
import androidx.compose.foundation.lazy.layout.LazyLayoutCacheWindow
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.gestures.BringIntoViewSpec
|
||||
import androidx.compose.foundation.gestures.LocalBringIntoViewSpec
|
||||
|
|
@ -54,7 +55,12 @@ private suspend fun LazyListState.animateBrowseTo(index:Int) {
|
|||
val source=if(home)vm.homeHubs else vm.discoverHubs
|
||||
val hubs=remember(source,destination){editorialHubs(source,destination)}
|
||||
val restore=remember(hubs){hubs.withIndex().firstNotNullOfOrNull{(row,h)->val column=h.items.indexOfFirst{"${h.id}:${it.id}"==vm.focusId};if(column>=0)row to column else null}}
|
||||
val list=rememberLazyListState(initialFirstVisibleItemIndex=restore?.let{it.first+if(home)1 else 0} ?: 0)
|
||||
val initialRow=restore?.let{it.first+if(home)1 else 0} ?: 0
|
||||
// Keep the hero and adjacent rows prepared across the large Home scroll.
|
||||
// Without a behind window, every return discards and recomposes those cards.
|
||||
val list=if(home)rememberLazyListState(initialFirstVisibleItemIndex=initialRow,
|
||||
cacheWindow=remember{LazyLayoutCacheWindow(aheadFraction=1f,behindFraction=1f)})
|
||||
else rememberLazyListState(initialFirstVisibleItemIndex=initialRow)
|
||||
val rowStates=remember(hubs){List(hubs.size){row->LazyListState(firstVisibleItemIndex=if(restore?.first==row)restore.second else 0)}}
|
||||
val requesters=remember(hubs){mutableMapOf<Pair<Int,Int>,FocusRequester>()}
|
||||
val columns=remember(hubs){mutableMapOf<Int,Int>()}
|
||||
|
|
@ -245,7 +251,7 @@ private suspend fun LazyListState.animateBrowseTo(index:Int) {
|
|||
val width=if(poster)120.dp else if(wideEpisode)264.dp else 214.dp
|
||||
val image=if(poster)item.poster.ifBlank{item.thumb}else if(item.type=="episode")item.still.ifBlank{item.thumb}.ifBlank{item.art}else item.art.ifBlank{item.thumb}
|
||||
LaunchedEffect(Unit){if(vm.focusId==focusKey){withFrameNanos{};runCatching{requester.requestFocus()};onHovered(item)}}
|
||||
Column(modifier.width(width).then(if(entry!=null)Modifier.focusRequester(entry)else Modifier).focusRequester(requester).onFocusChanged{
|
||||
Column(modifier.width(width).then(if(entry!=null)Modifier.focusRequester(entry)else Modifier).focusRequester(requester).navigationSound().onFocusChanged{
|
||||
focused=it.isFocused
|
||||
if(it.isFocused){vm.focusId=focusKey;onHovered(item)}
|
||||
}.clickable{vm.open(item)}.clearAndSetSemantics{
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ class KaleidoViewModel(app: Application): AndroidViewModel(app) {
|
|||
var downloading by mutableStateOf(false); private set
|
||||
var playbackMode by mutableStateOf(preferences.getInt("playbackModeV2",1)); private set
|
||||
var watchedPercent by mutableStateOf(preferences.getInt("watchedPercent",80).coerceIn(50,100)); private set
|
||||
var navigationSounds by mutableStateOf(preferences.getBoolean("navigationSounds",true)); private set
|
||||
var episodeQueue by mutableStateOf(emptyList<Title>());private set
|
||||
var relatedShows by mutableStateOf(emptyList<Title>());private set
|
||||
var transitioningEpisode by mutableStateOf(false);private set
|
||||
|
|
@ -260,6 +261,7 @@ class KaleidoViewModel(app: Application): AndroidViewModel(app) {
|
|||
fun stopPlayback(){playing=null;sectionCache.clear();detailsCache.clear();previews.clear();cancelAnticipation();launchLoad {homeHubs=loadHome();detail?.let {if(it.type in listOf("movie","episode"))detail=api.details(it.id)}}}
|
||||
fun choosePlaybackMode(value: Int){playbackMode=value;preferences.edit().putInt("playbackModeV2",value).apply()}
|
||||
fun chooseWatchedPercent(value:Int){watchedPercent=value.coerceIn(50,100);preferences.edit().putInt("watchedPercent",watchedPercent).apply()}
|
||||
fun chooseNavigationSounds(value:Boolean){navigationSounds=value;preferences.edit().putBoolean("navigationSounds",value).apply()}
|
||||
fun chooseQuality(value: Int){quality=value;preferences.edit().putInt("quality",value).apply()}
|
||||
fun checkUpdate(manual: Boolean=true){viewModelScope.launch {
|
||||
if(!manual&&System.currentTimeMillis()-preferences.getLong("lastUpdateCheck",0)<6*3600_000L)return@launch
|
||||
|
|
|
|||
34
app/src/main/java/tv/kaleido/app/NavigationSounds.kt
Normal file
34
app/src/main/java/tv/kaleido/app/NavigationSounds.kt
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
package tv.kaleido.app
|
||||
|
||||
import android.view.SoundEffectConstants
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.focus.onFocusChanged
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
|
||||
/** One cue per actual focus change; blocked/repeated key presses stay silent. */
|
||||
internal class NavigationSoundController(private val play:()->Unit) {
|
||||
var enabled=false
|
||||
private var previous:Any?=null
|
||||
fun focused(target:Any) {
|
||||
val changed=previous!=null&&previous!==target
|
||||
previous=target
|
||||
if(enabled&&changed)play()
|
||||
}
|
||||
}
|
||||
|
||||
private val LocalNavigationSounds=staticCompositionLocalOf<NavigationSoundController?>{null}
|
||||
|
||||
@Composable internal fun NavigationSounds(enabled:Boolean,content:@Composable ()->Unit) {
|
||||
val view=LocalView.current
|
||||
// Native UI tick follows the TV's sound-effects setting, volume and output route.
|
||||
val controller=remember(view){NavigationSoundController{view.playSoundEffect(SoundEffectConstants.CLICK)}}
|
||||
SideEffect{controller.enabled=enabled}
|
||||
CompositionLocalProvider(LocalNavigationSounds provides controller,content=content)
|
||||
}
|
||||
|
||||
@Composable internal fun Modifier.navigationSound():Modifier {
|
||||
val controller=LocalNavigationSounds.current
|
||||
val target=remember{Any()}
|
||||
return onFocusChanged{if(it.isFocused)controller?.focused(target)}
|
||||
}
|
||||
|
|
@ -69,7 +69,7 @@ import kotlinx.coroutines.delay
|
|||
LazyRow(horizontalArrangement=Arrangement.spacedBy(12.dp)) {
|
||||
items(titles,key={it.id}){title->
|
||||
var focused by remember{mutableStateOf(false)}
|
||||
Column(Modifier.width(167.dp).onFocusChanged{focused=it.isFocused}.semantics{contentDescription=title.displayTitle+" "+title.subtitle}.clickable{choose(title)}) {
|
||||
Column(Modifier.width(167.dp).navigationSound().onFocusChanged{focused=it.isFocused}.semantics{contentDescription=title.displayTitle+" "+title.subtitle}.clickable{choose(title)}) {
|
||||
Box(Modifier.fillMaxWidth().aspectRatio(16f/9f).clip(RoundedCornerShape(4.dp))) {
|
||||
Artwork(vm.api,if(title.type=="episode")title.still.ifBlank{title.thumb}else title.art.ifBlank{title.thumb},Modifier.fillMaxSize(),384,216,animate=false)
|
||||
if(focused)Box(Modifier.fillMaxSize().border(2.dp,Accent,RoundedCornerShape(4.dp)))
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ import kotlinx.coroutines.delay
|
|||
val displayed=controller.scrubPosition ?: controller.position
|
||||
val progress=if(controller.duration>0)(displayed.toFloat()/controller.duration).coerceIn(0f,1f)else 0f
|
||||
val buffered=if(controller.duration>0)(controller.bufferedPosition.toFloat()/controller.duration).coerceIn(0f,1f)else 0f
|
||||
BoxWithConstraints(modifier.height(18.dp).onFocusChanged{focused=it.isFocused;if(it.isFocused)onInteraction()else controller.commitScrub()}.onPreviewKeyEvent{event->
|
||||
BoxWithConstraints(modifier.height(18.dp).navigationSound().onFocusChanged{focused=it.isFocused;if(it.isFocused)onInteraction()else controller.commitScrub()}.onPreviewKeyEvent{event->
|
||||
if(event.type!=KeyEventType.KeyDown)false else when(event.key) {
|
||||
Key.DirectionLeft,Key.DirectionRight->{val delta=if(event.nativeKeyEvent.repeatCount>5)30000L else 10000L;controller.scrubBy(if(event.key==Key.DirectionLeft)-delta else delta);onInteraction();true}
|
||||
Key.DirectionCenter,Key.Enter->{if(controller.scrubPosition!=null)controller.commitScrub()else controller.toggle();onInteraction();true}
|
||||
|
|
@ -208,7 +208,7 @@ import kotlinx.coroutines.delay
|
|||
var focused by remember{mutableStateOf(false)}
|
||||
val requester=remember{FocusRequester()}
|
||||
LaunchedEffect(initialFocus){if(initialFocus){delay(80);runCatching{requester.requestFocus()}}}
|
||||
Row(Modifier.fillMaxWidth().heightIn(min=35.dp).focusRequester(requester).onFocusChanged{focused=it.isFocused}.clip(RoundedCornerShape(5.dp)).background(if(focused)Color.White.copy(alpha=.14f)else Color.Transparent).clickable(onClick=onClick).padding(horizontal=9.dp,vertical=8.dp),verticalAlignment=Alignment.CenterVertically,horizontalArrangement=Arrangement.spacedBy(9.dp)) {
|
||||
Row(Modifier.fillMaxWidth().heightIn(min=35.dp).focusRequester(requester).navigationSound().onFocusChanged{focused=it.isFocused}.clip(RoundedCornerShape(5.dp)).background(if(focused)Color.White.copy(alpha=.14f)else Color.Transparent).clickable(onClick=onClick).padding(horizontal=9.dp,vertical=8.dp),verticalAlignment=Alignment.CenterVertically,horizontalArrangement=Arrangement.spacedBy(9.dp)) {
|
||||
if(selected)Icon(Icons.Outlined.Check,null,tint=Accent,modifier=Modifier.size(15.dp))else Spacer(Modifier.width(15.dp))
|
||||
Text(label,color=if(focused||selected)Accent else Muted,fontSize=12.sp,lineHeight=16.sp,maxLines=2,overflow=TextOverflow.Ellipsis)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ import java.io.File
|
|||
BackHandler(enabled=vm.linkingAccount||vm.playing!=null||vm.pages.size>1||vm.page.kind!="home"){
|
||||
if(vm.linkingAccount)vm.cancelAccountLink()else if(vm.playing==null&&vm.pages.size==1&&vm.page.kind in listOf("movies","tv")&&vm.allTitles)vm.setAll(false)else vm.back()
|
||||
}
|
||||
NavigationSounds(vm.navigationSounds&&!startup) {
|
||||
Box(Modifier.fillMaxSize().background(Ink).onPreviewKeyEvent{startup}) {
|
||||
if(vm.servers.isNotEmpty()) ServerPicker(vm) else if(vm.session==null||vm.linkingAccount) SignIn(vm) else {
|
||||
Column(Modifier.fillMaxSize().graphicsLayer{
|
||||
|
|
@ -98,6 +99,7 @@ import java.io.File
|
|||
vm.playing?.let {item-> androidx.compose.runtime.key(item.id) {PlaybackScreen(vm,item)} }
|
||||
if(startup)StartupSplash(splash.value){brandReady=true}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
val sortLabels=listOf("titleSort:asc" to "Title: A–Z","titleSort:desc" to "Title: Z–A","addedAt:desc" to "Recently added","year:desc" to "Newest release","year:asc" to "Oldest release","audienceRating:desc" to "Audience rating","duration:asc" to "Shortest first")
|
||||
|
|
@ -132,6 +134,10 @@ val sortLabels=listOf("titleSort:asc" to "Title: A–Z","titleSort:desc" to "Tit
|
|||
TvButton("Mark watched at ${vm.watchedPercent}%",onClick={watchedDialog=true})
|
||||
Text("A resumed title gets its checkmark at this playback percentage. Completed titles keep their Plex watched status.",color=Muted,fontSize=12.sp,lineHeight=18.sp,modifier=Modifier.padding(top=10.dp))
|
||||
}}
|
||||
item{SettingsPanel("Interface") {
|
||||
TvButton("Navigation sounds: "+if(vm.navigationSounds)"On"else "Off",onClick={vm.chooseNavigationSounds(!vm.navigationSounds)})
|
||||
Text("Play the TV's system tap when focus moves. Follows your TV's sound-effects setting.",color=Muted,fontSize=12.sp,lineHeight=18.sp,modifier=Modifier.padding(top=10.dp))
|
||||
}}
|
||||
item{SettingsPanel("Software updates") {Text("Kaleido ${BuildConfig.VERSION_NAME}",color=Color.White,fontSize=20.sp,fontWeight=FontWeight.Bold);Text(vm.updateStatus,color=Muted,fontSize=12.sp,modifier=Modifier.padding(vertical=8.dp));Text("Updates are checked automatically every six hours while Kaleido is in use.",color=Muted,fontSize=12.sp);Spacer(Modifier.height(14.dp));Row(horizontalArrangement=Arrangement.spacedBy(10.dp)){TvButton("Check for updates",onClick={vm.checkUpdate()});if(vm.update!=null&&!vm.downloading)TvButton("Download & install ${vm.update!!.version}",primary=true,onClick={vm.downloadUpdate()})};vm.update?.let{if(it.notes.isNotBlank())Text(it.notes.take(1800),color=Muted,fontSize=11.sp,modifier=Modifier.padding(top=12.dp))};Text("git.elijahkuntz.com/Elijah/Kaleido",color=Accent,fontSize=10.sp,modifier=Modifier.padding(top=14.dp))}}
|
||||
}
|
||||
if(confirmSignOut)ChoiceDialog("Sign out of Plex?",listOf("Keep watching","Sign out"),0,{confirmSignOut=false}){if(it==1)vm.signOut();confirmSignOut=false}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ object Cinema {
|
|||
val fg=if(focused||primary) Ink else Accent
|
||||
val scale by animateFloatAsState(if(focused)1.025f else 1f,tween(160),label="buttonScale")
|
||||
LaunchedEffect(initialFocus){if(initialFocus){withFrameNanos{};runCatching{requester.requestFocus()}}}
|
||||
Box(modifier.graphicsLayer{scaleX=scale;scaleY=scale}.focusRequester(requester).onFocusChanged{focused=it.isFocused}.clip(RoundedCornerShape(Cinema.radius)).background(bg).clickable(onClick=onClick).padding(horizontal=13.dp,vertical=8.dp)) {
|
||||
Box(modifier.graphicsLayer{scaleX=scale;scaleY=scale}.focusRequester(requester).navigationSound().onFocusChanged{focused=it.isFocused}.clip(RoundedCornerShape(Cinema.radius)).background(bg).clickable(onClick=onClick).padding(horizontal=13.dp,vertical=8.dp)) {
|
||||
Text(label,color=fg,fontSize=12.sp,lineHeight=16.sp,fontWeight=FontWeight.Medium,maxLines=1)
|
||||
}
|
||||
}
|
||||
|
|
@ -68,7 +68,7 @@ object Cinema {
|
|||
val background by animateColorAsState(if(focused||primary)Accent else Color.White.copy(alpha=.12f),tween(160),label="actionSurface")
|
||||
val foreground=if(focused||primary)Ink else Accent
|
||||
LaunchedEffect(initialFocus){if(initialFocus){withFrameNanos{};runCatching{requester.requestFocus()}}}
|
||||
Row(modifier.height(34.dp).graphicsLayer{scaleX=scale;scaleY=scale}.focusRequester(requester).onFocusChanged{focused=it.isFocused}.clip(RoundedCornerShape(5.dp)).background(background).clickable(onClick=onClick).padding(horizontal=14.dp),verticalAlignment=Alignment.CenterVertically,horizontalArrangement=Arrangement.spacedBy(7.dp)) {
|
||||
Row(modifier.height(34.dp).graphicsLayer{scaleX=scale;scaleY=scale}.focusRequester(requester).navigationSound().onFocusChanged{focused=it.isFocused}.clip(RoundedCornerShape(5.dp)).background(background).clickable(onClick=onClick).padding(horizontal=14.dp),verticalAlignment=Alignment.CenterVertically,horizontalArrangement=Arrangement.spacedBy(7.dp)) {
|
||||
Icon(icon,null,tint=foreground,modifier=Modifier.size(17.dp))
|
||||
Text(label,color=foreground,fontSize=12.sp,lineHeight=16.sp,fontWeight=FontWeight.SemiBold)
|
||||
}
|
||||
|
|
@ -81,7 +81,7 @@ object Cinema {
|
|||
val bg by animateColorAsState(if(focused)Accent else if(selected)Color.White.copy(alpha=.16f)else Color.Transparent,tween(140),label="iconBackground")
|
||||
val scale by animateFloatAsState(if(focused)1.08f else 1f,tween(160),label="iconFocus")
|
||||
LaunchedEffect(initialFocus){if(initialFocus){withFrameNanos{};runCatching{focus.requestFocus()}}}
|
||||
Box(modifier.size(size).graphicsLayer{scaleX=scale;scaleY=scale}.focusRequester(focus).onFocusChanged{focused=it.isFocused;if(it.isFocused)onFocused()}.clip(CircleShape).background(bg).semantics{contentDescription=label}.clickable(onClick=onClick),contentAlignment=Alignment.Center) {
|
||||
Box(modifier.size(size).graphicsLayer{scaleX=scale;scaleY=scale}.focusRequester(focus).navigationSound().onFocusChanged{focused=it.isFocused;if(it.isFocused)onFocused()}.clip(CircleShape).background(bg).semantics{contentDescription=label}.clickable(onClick=onClick),contentAlignment=Alignment.Center) {
|
||||
Icon(icon,null,tint=if(focused)Ink else Accent,modifier=Modifier.size(iconSize))
|
||||
}
|
||||
}
|
||||
|
|
@ -92,7 +92,7 @@ object Cinema {
|
|||
val bg by animateColorAsState(if(focused)Color.White.copy(alpha=.14f) else Color.Transparent,tween(150),label="navigationBackground")
|
||||
val scale by animateFloatAsState(if(focused)1.035f else 1f,tween(160),label="navigationFocus")
|
||||
LaunchedEffect(initialFocus){if(initialFocus){delay(140);runCatching{requester.requestFocus()}}}
|
||||
Column(modifier.height(34.dp).graphicsLayer{scaleX=scale;scaleY=scale}.focusRequester(requester).onFocusChanged{focused=it.isFocused;if(it.isFocused)onFocused()}.clip(RoundedCornerShape(5.dp)).background(bg).clickable(onClick=onClick).padding(horizontal=13.dp),horizontalAlignment=Alignment.CenterHorizontally,verticalArrangement=Arrangement.Center) {
|
||||
Column(modifier.height(34.dp).graphicsLayer{scaleX=scale;scaleY=scale}.focusRequester(requester).navigationSound().onFocusChanged{focused=it.isFocused;if(it.isFocused)onFocused()}.clip(RoundedCornerShape(5.dp)).background(bg).clickable(onClick=onClick).padding(horizontal=13.dp),horizontalAlignment=Alignment.CenterHorizontally,verticalArrangement=Arrangement.Center) {
|
||||
Text(label,color=if(focused||selected)Accent else Muted,fontSize=13.sp,lineHeight=18.sp,fontWeight=if(selected||focused)FontWeight.SemiBold else FontWeight.Medium)
|
||||
if(selected||focused)Box(Modifier.padding(top=3.dp).width(16.dp).height(1.5.dp).background(Accent.copy(alpha=if(focused)1f else .6f),RoundedCornerShape(1.dp)))
|
||||
}
|
||||
|
|
|
|||
29
app/src/test/java/tv/kaleido/app/NavigationSoundsTest.kt
Normal file
29
app/src/test/java/tv/kaleido/app/NavigationSoundsTest.kt
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
package tv.kaleido.app
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
|
||||
class NavigationSoundsTest {
|
||||
@Test fun initialAndUnchangedFocusAreSilent() {
|
||||
var taps=0
|
||||
val sounds=NavigationSoundController{taps++}.apply{enabled=true}
|
||||
val card=Any()
|
||||
sounds.focused(card);sounds.focused(card)
|
||||
assertEquals(0,taps)
|
||||
sounds.focused(Any())
|
||||
assertEquals(1,taps)
|
||||
}
|
||||
@Test fun mutingKeepsFocusHistoryAndEnablingOnlyAffectsFutureMoves() {
|
||||
var taps=0
|
||||
val sounds=NavigationSoundController{taps++}.apply{enabled=true}
|
||||
sounds.focused(Any());sounds.focused(Any())
|
||||
sounds.enabled=false
|
||||
val mutedCard=Any()
|
||||
sounds.focused(mutedCard);sounds.focused(Any())
|
||||
assertEquals(1,taps)
|
||||
sounds.enabled=true
|
||||
assertEquals(1,taps)
|
||||
sounds.focused(mutedCard)
|
||||
assertEquals(2,taps)
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
6f1d42ee5167dcb3743b7dafbecfed9942e496ee10b8b277ba2a3ba66c6407ba Kaleido.apk
|
||||
5cbfcb3048504ff7926850a46fc38a9a57118fe60fc2e1a356b508fe16a14da2 Kaleido.apk
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"version": "0.1.1",
|
||||
"versionCode": 2,
|
||||
"url": "https://git.elijahkuntz.com/Elijah/Kaleido/raw/tag/v0.1.1/distribution/Kaleido.apk",
|
||||
"checksumUrl": "https://git.elijahkuntz.com/Elijah/Kaleido/raw/tag/v0.1.1/distribution/Kaleido.apk.sha256",
|
||||
"notes": "0.1.1\n\n- Use official Rotten Tomatoes Hot and Stale audience badges with proportional scaling beside ratings.\n- Replace the spinning startup logo with a six-facet aperture assembly, light trails, and a staggered wordmark reveal.\n- Honor Android's animation duration setting and fade into browsing after the opening sequence completes.\n"
|
||||
"version": "0.1.2",
|
||||
"versionCode": 3,
|
||||
"url": "https://git.elijahkuntz.com/Elijah/Kaleido/raw/tag/v0.1.2/distribution/Kaleido.apk",
|
||||
"checksumUrl": "https://git.elijahkuntz.com/Elijah/Kaleido/raw/tag/v0.1.2/distribution/Kaleido.apk.sha256",
|
||||
"notes": "0.1.2\n\n- Add navigation tap sounds with a persistent On/Off setting under Settings > Interface. Sounds default to On and follow the TV's system sound-effects setting.\n- Reduce Home hero-to-Continue Watching stutter by preparing nearby rows and retaining them across return navigation.\n- Include the navigation-sound focus paths in the baseline profile for optimized release navigation.\n"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,8 +19,10 @@ The interface gives artwork priority. App chrome uses neutral near-black, charco
|
|||
|
||||
- Discovery cards keep fixed bounds and use a two-dp white focus outline. No scale or shadow changes trigger lazy-row layout or move a neighboring row.
|
||||
- Text actions scale to 1.025 over 160 ms. Navigation uses text, an understated selected underline, and a translucent charcoal focus surface.
|
||||
- Navigation focus changes use Android's native UI tick. Settings > Interface > Navigation sounds toggles it immediately and persists across process restarts; it defaults to On and follows the TV's global sound-effects setting. Initial startup focus and repeated notifications for the same target are silent. The shared focus observer covers navigation, cards, buttons, dialogs, playback options and the timeline without changing key handling.
|
||||
- Navigation contrast comes from a gradient extending past the controls and fading to transparent. Home/Movies/TV activate on focus. Explicit row and column links prevent beyond-bounds focus searches when holding a remote direction.
|
||||
- A D-pad move predicts the actual row/column destination before starting its scroll or focus change. The target backdrop is fetched and contrast-processed through the same Coil request/cache as the visible scene. Speculative artwork uses one low-priority worker so it cannot flood normal decode workers during a burst of input. Metadata starts in parallel; the visible preview and details page share that in-flight request. Rapid navigation replaces the queued metadata target and cancels superseded artwork prefetches. Full metadata uses a 64-item LRU with a 30-second lifetime, cleared on account/server changes and refreshed after watched updates. Neutral library/search grids prefetch metadata without fetching an unused full-screen backdrop.
|
||||
- Home's vertical list prepares content within one viewport ahead and retains one viewport behind, using Compose's bounded lazy-layout cache window. This keeps the hero and nearby rows ready when moving between them, rather than repeatedly composing and measuring the exposed image cards during the animation. Movies/TV retain their existing list strategy. Card sizes, row targets and the large cinematic Home layout are unchanged.
|
||||
- Section previews settle for 120 ms (Home artwork for 90 ms), overlapping the navigation animation, and retain previous artwork until replacement data is ready. Contrast gradients are baked into a cached bitmap on a worker thread, reducing GPU overdraw. Hero recommendation changes crossfade the artwork over 220 ms, including cache hits, and fade the title/summary out for 100 ms and back in over 180 ms. Rotation pauses on the information/next controls and preserves their focus. Vertical row changes animate to explicit row/column targets; page entrances fade and slide 28 dp over 280 ms. The cold-start sequence lasts 2.6 seconds: six light trails converge, the exact aperture facets assemble radially without spinning, a soft glow and facet glint settle, and the wordmark reveals letter by letter. Completion drives the cover dismissal, with up to 600 ms extra for loading followed by a 360 ms crossfade. Android animation duration scale is honored, including animations off. It does not replay when returning from background.
|
||||
- Returning from details restores the library's mode, scroll position, and previously focused title.
|
||||
|
||||
|
|
|
|||
|
|
@ -52,3 +52,21 @@ The onn stayed on version 0.1.0 / code 1 until the actual in-app installation. N
|
|||
For future live checks, start with an installed lower version signed by the same key, publish a genuinely higher version/code, navigate to Settings > Software updates with the D-pad, and follow the sequence above. Never clear app data to manufacture an update scenario. Android's source permission is a one-time, per-app step; the package installer still requires explicit confirmation for each update. Wait for the TV Settings source list to populate before selecting Kaleido.
|
||||
|
||||
Private evidence remains in ignored `evidence/private/`: `updater-results.json`, `published-release.json`, `updater-before.png`, `updater-fallback-discovery.png`, `updater-release-discovery.png`, `updater-source-allowed.png`, `updater-confirmation.png`, `updater-installed.png`, `updater-after.png` and `updater-final-home.png`. This verifies manual discovery, the manifest fallback and a real release download/install. It does not independently test the six-hour automatic-check interval, permission denial/retry, or rejection of deliberately corrupted/wrong-signed APKs.
|
||||
|
||||
## Navigation sounds and Home scroll performance - 2026-10-24
|
||||
|
||||
The specific hero-to-Continue Watching movement now has a dedicated check: `scripts/profile_home.py <label>`. It resets frame statistics for each Down transition, waits until it finishes, samples completed frames, then returns to the hero outside the measured interval. UI hierarchy dumps do not run during the measured animation. Its p95 limit is 33.34 ms; `--cold --cycles 1` skips the warm-up scroll and `--trace` records app layout/rendering spans. Use an optimized release with the baseline profile installed and `speed-profile` compilation, and never run another device test alongside it.
|
||||
|
||||
The original profiled release failed across five repeated transitions: 59 frames, median 17.5 ms, p95 50.3 ms, maximum 60.5 ms, and 28.8% above 33.34 ms. A separate trace showed main-thread measure/layout passes of 40–51 ms, repeatedly composing and remembering newly exposed image cards. Render-thread spans were substantially shorter. This isolated lazy-row preparation/disposal as the primary bottleneck in this scenario.
|
||||
|
||||
Home now uses a bounded one-viewport-ahead / one-viewport-behind lazy-layout cache window. It prepares adjacent rows and retains the hero/nearby cards on the return path. Artwork resolution, card geometry, the cinematic hero and Movies/TV presentation are unchanged. The fix does not cache the entire catalog or change focus/scroll destinations.
|
||||
|
||||
With navigation sounds enabled and its hot paths included in the baseline profile, the final APK measured 66 frames across five repeated Down transitions: median 17.2 ms, p95 28.6 ms, maximum 34.8 ms, and one frame above 33.34 ms (1.5%). Its first transition after a cold process launch measured 13 frames, p95 26.9 ms and maximum 30.1 ms. These are device samples, not a guarantee of every frame meeting a 60 Hz deadline. A preliminary run where the profile-install broadcast targeted the wrong receiver was excluded from the matched comparison; the final preparation returned profile-install result 1 and package compilation Success.
|
||||
|
||||
Navigation sounds default to On under Settings > Interface. Shared focus targets call Android's native UI sound only after an actual focus change; startup focus, unchanged targets and disabled sounds are silent. The TV's global sound-effects setting remains authoritative and was not changed. `verify_navigation_sounds.py` reproduced the missing control on the original installation, then passed both Off and On persistence checks across cold process launches on the final build. Two unit tests cover initial/duplicate focus suppression and muting/re-enabling behavior.
|
||||
|
||||
For a quiet device with system effects already enabled, run `python -c "import sys; sys.path.insert(0, 'scripts'); from verify_navigation_sounds import audio; audio()"` using the configured Python runtime. It compares identical D-pad focus movements with the app preference Off/On: the final test recorded zero native audio mixer writes while muted and 141 while enabled. This confirms output through Android's audio pipeline; physical speaker listening was not performed. It leaves the preference On and returns to Home.
|
||||
|
||||
Private evidence includes `home-baseline-results.json`, `home-trace-baseline-atrace.txt`, `home-complete-results.json`, `home-complete-cold-results.json`, `navigation-audio-results.json`, `navigation-audio-off-atrace.txt`, `navigation-audio-on-atrace.txt`, and the On/Off setting screenshots. `Build.ps1 -Release -Test` passed with three unit tests and zero lint errors. These measurements were taken on the local optimized test build before versioning the changes as 0.1.2. The installed test build retains the existing session and was left on Home with navigation sounds On.
|
||||
|
||||
All six `verify_ui.py browse` checks passed with the sound setting and cache window, including focus restoration, separate Movies/TV layouts, A–Z grids and PIN cancellation preserving the session. The broader `repro_runtime.py browse` check initially failed at p95 42 ms (48 ms with tracing), with further card composition/measurement during rapid movement. Including the new sound modifier/controller in the app's baseline profile brought the final profiled release to median 15 ms / p95 36 ms, GPU p95 7 ms, and stable horizontal Y coordinates at 182 px. Some stress-test frames still miss 60 Hz. `browse --trace` now records this exact regression loop to `browse-regression-atrace.txt` for future diagnosis.
|
||||
|
|
|
|||
56
scripts/profile_home.py
Normal file
56
scripts/profile_home.py
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
"""Measure only Home hero -> Continue Watching on the authorized onn release.
|
||||
|
||||
Run without competing UI tests. Captures and traces remain private.
|
||||
"""
|
||||
import argparse,json,time
|
||||
from device import adb,OUT
|
||||
from verify_ui import launch,key,wait,focus,focused
|
||||
|
||||
def frames(raw):
|
||||
result=[]
|
||||
for block in raw.split('---PROFILEDATA---')[1::2]:
|
||||
lines=[line.strip() for line in block.splitlines() if line.strip()]
|
||||
if not lines:continue
|
||||
names=lines[0].rstrip(',').split(',')
|
||||
for line in lines[1:]:
|
||||
values=line.rstrip(',').split(',')
|
||||
if len(values)!=len(names):continue
|
||||
row=dict(zip(names,map(int,values)))
|
||||
if row['Flags']==0 and row['FrameCompleted']>row['IntendedVsync']:
|
||||
result.append((row['FrameCompleted']-row['IntendedVsync'])/1e6)
|
||||
return result
|
||||
|
||||
def percentile(values,p):return sorted(values)[min(len(values)-1,int((len(values)-1)*p))]
|
||||
|
||||
def main():
|
||||
parser=argparse.ArgumentParser();parser.add_argument('label');parser.add_argument('--cycles',type=int,default=5);parser.add_argument('--trace',action='store_true');parser.add_argument('--cold',action='store_true');args=parser.parse_args()
|
||||
assert args.cycles>0,'At least one transition is required'
|
||||
launch();key(20);wait(lambda r:focus(r) in ('Play','Resume'),'Hero action')
|
||||
# Warm the same row and artwork once, then return to the hero before timing.
|
||||
if not args.cold:
|
||||
key(20);wait(lambda r:focus(r) not in ('','Home','Play','Resume'),'Continue Watching card');time.sleep(.7)
|
||||
key(19);wait(lambda r:focus(r) in ('Play','Resume'),'Return to hero');time.sleep(.7)
|
||||
if args.trace:adb('shell','atrace','--async_start','-b','32768','-a','tv.kaleido.app','gfx','view','sched','freq')
|
||||
all_frames=[];runs=[]
|
||||
try:
|
||||
for index in range(args.cycles):
|
||||
adb('shell','dumpsys','gfxinfo','tv.kaleido.app','reset')
|
||||
adb('shell','input','keyevent','20');time.sleep(1)
|
||||
raw=adb('shell','dumpsys','gfxinfo','tv.kaleido.app','framestats').decode(errors='replace')
|
||||
(OUT/f'home-{args.label}-{index}-frames.txt').write_text(raw)
|
||||
sample=frames(raw);assert sample,'No measured frames'
|
||||
all_frames.extend(sample);runs.append({'frames':len(sample),'median':percentile(sample,.5),'p95':percentile(sample,.95),'max':max(sample)})
|
||||
print('Down transition',index+1,json.dumps(runs[-1]),flush=True)
|
||||
wait(lambda r:focus(r) not in ('','Home','Play','Resume'),'Continue Watching focus')
|
||||
key(19);wait(lambda r:focus(r) in ('Play','Resume'),'Hero focus restored');time.sleep(.7)
|
||||
finally:
|
||||
if args.trace:
|
||||
raw=adb('shell','atrace','--async_stop','-a','tv.kaleido.app','gfx','view','sched','freq')
|
||||
(OUT/f'home-{args.label}-atrace.txt').write_bytes(raw)
|
||||
result={'runs':runs,'frames':len(all_frames),'median':percentile(all_frames,.5),'p95':percentile(all_frames,.95),'over33msPercent':100*sum(x>33.34 for x in all_frames)/len(all_frames),'max':max(all_frames)}
|
||||
(OUT/f'home-{args.label}-results.json').write_text(json.dumps(result,indent=2)+'\n')
|
||||
print(json.dumps(result),flush=True)
|
||||
key(19);focused('Home')
|
||||
assert result['p95']<33.34,f"Hero-to-row p95 {result['p95']:.1f} ms exceeds two 60Hz frame intervals"
|
||||
|
||||
if __name__=='__main__':main()
|
||||
|
|
@ -31,6 +31,8 @@ def browse():
|
|||
launch();key(20)
|
||||
if focus(snapshot()) in ('Play','Resume'):key(20)
|
||||
wait(lambda r:focus(r) not in ('','Home','Play','Resume'),'Content focus')
|
||||
tracing='--trace' in sys.argv
|
||||
if tracing:adb('shell','atrace','--async_start','-b','32768','-a','tv.kaleido.app','gfx','view','sched')
|
||||
adb('shell','dumpsys','gfxinfo','tv.kaleido.app','reset')
|
||||
geometry=[]
|
||||
for _ in range(5):
|
||||
|
|
@ -40,6 +42,7 @@ def browse():
|
|||
adb('shell','input','keyevent',*(['KEYCODE_DPAD_RIGHT']*15))
|
||||
adb('shell','input','keyevent',*(['KEYCODE_DPAD_UP']*12))
|
||||
stats=adb('shell','dumpsys','gfxinfo','tv.kaleido.app','framestats').decode(errors='replace')
|
||||
if tracing:(OUT/'browse-regression-atrace.txt').write_bytes(adb('shell','atrace','--async_stop','-a','tv.kaleido.app','gfx','view','sched'))
|
||||
(OUT/'browse-framestats.txt').write_text(stats)
|
||||
(OUT/'browse-geometry.json').write_text(json.dumps(geometry,indent=2))
|
||||
print(json.dumps(geometry),flush=True)
|
||||
|
|
|
|||
48
scripts/verify_navigation_sounds.py
Normal file
48
scripts/verify_navigation_sounds.py
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
"""Check navigation sound persistence; audio() also compares native mixer activity.
|
||||
|
||||
The optional mixer check needs system sound effects enabled and otherwise silent
|
||||
audio output on the authorized onn. It never changes the TV's global sound setting.
|
||||
"""
|
||||
import json,time
|
||||
from verify_ui import launch,key,focused,text
|
||||
from device import adb,OUT,screenshot
|
||||
|
||||
def setting():
|
||||
launch();key(22,4);focused('Settings');key(23);focused('Sign in with Plex')
|
||||
key(20);focused('Mode: Direct stream');key(20);focused('Mark watched at 80%');key(20)
|
||||
|
||||
def persistence():
|
||||
setting();focused('Navigation sounds: On');key(23);focused('Navigation sounds: Off')
|
||||
screenshot('navigation-sounds-off')
|
||||
setting();focused('Navigation sounds: Off')
|
||||
print('PASS disabling navigation sounds persists across process restart',flush=True)
|
||||
key(23);focused('Navigation sounds: On')
|
||||
setting();focused('Navigation sounds: On')
|
||||
print('PASS enabling navigation sounds persists across process restart',flush=True)
|
||||
screenshot('navigation-sounds-on');key(4);focused('Home');text('Continue Watching')
|
||||
|
||||
def audio():
|
||||
assert adb('shell','settings','get','system','sound_effects_enabled').decode().strip()=='1','System sound effects must already be enabled for this optional check'
|
||||
def probe(label):
|
||||
time.sleep(.4)
|
||||
adb('shell','atrace','--async_start','-b','16384','audio')
|
||||
try:
|
||||
for _ in range(3):
|
||||
adb('shell','input','keyevent','20');time.sleep(.3)
|
||||
adb('shell','input','keyevent','19');time.sleep(.3)
|
||||
time.sleep(.4)
|
||||
finally:raw=adb('shell','atrace','--async_stop','audio').decode(errors='replace')
|
||||
(OUT/f'navigation-audio-{label}-atrace.txt').write_text(raw)
|
||||
focused('Navigation sounds: '+label.capitalize())
|
||||
return sum('tracing_mark_write: B|' in line and line.endswith('|write') for line in raw.splitlines())
|
||||
setting();focused('Navigation sounds: On');key(23);focused('Navigation sounds: Off')
|
||||
muted=probe('off')
|
||||
key(23);focused('Navigation sounds: On');enabled=probe('on')
|
||||
result={'mutedMixerWrites':muted,'enabledMixerWrites':enabled}
|
||||
(OUT/'navigation-audio-results.json').write_text(json.dumps(result,indent=2)+'\n')
|
||||
print('Native audio activity:',result,flush=True)
|
||||
assert muted==0 and enabled>0,'Expected silence while muted and native audio output while enabled'
|
||||
print('PASS navigation taps produce native mixer output only while enabled',flush=True)
|
||||
key(4);focused('Home')
|
||||
|
||||
if __name__=='__main__':persistence()
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
versionName=0.1.1
|
||||
versionCode=2
|
||||
versionName=0.1.2
|
||||
versionCode=3
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue