Release Kaleido 0.1.9 with responsive navigation and clearer show details
All checks were successful
Validate and publish Kaleido / android (push) Successful in 2m25s
All checks were successful
Validate and publish Kaleido / android (push) Successful in 2m25s
This commit is contained in:
parent
5199bb0928
commit
784921dba9
20 changed files with 271 additions and 49 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -12,6 +12,7 @@ evidence/private/
|
||||||
*.keystore
|
*.keystore
|
||||||
*.jks
|
*.jks
|
||||||
.idea/
|
.idea/
|
||||||
|
.DS_Store
|
||||||
*.iml
|
*.iml
|
||||||
/Home screen.jpg
|
/Home screen.jpg
|
||||||
/Individual library.jpg
|
/Individual library.jpg
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,13 @@
|
||||||
# Kaleido releases
|
# Kaleido releases
|
||||||
|
|
||||||
|
## 0.1.9
|
||||||
|
|
||||||
|
- Move Seasons up on TV show pages so the artwork and season labels fit together on the first screen.
|
||||||
|
- Constrain show descriptions to the movie-detail text width, with full text in an artwork-led Synopsis panel styled to match title details. Fade artwork to near-black behind lower rows and as details scroll.
|
||||||
|
- Combine newly added seasons from the same Plex show into one card. Multiple seasons open the show's full season list; a single season still opens directly.
|
||||||
|
- Make Movies and TV navigation enter Discover immediately, without waiting for catalog scrolling. Preserve a quick Down press while switching tabs and focus visible cards before scrolling.
|
||||||
|
- Align horizontal focus and scrolling with the next frame, retain each requested D-pad step, and prepare nearby cards ahead of navigation. Prevent unnecessary focus searches above the top navigation.
|
||||||
|
|
||||||
## 0.1.8
|
## 0.1.8
|
||||||
|
|
||||||
- Add cast portraits with character names to title information. Select an actor to browse their movies and shows across your Plex libraries.
|
- Add cast portraits with character names to title information. Select an actor to browse their movies and shows across your Plex libraries.
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,26 @@ import kotlinx.coroutines.runBlocking
|
||||||
class BrowsePolicyTest {
|
class BrowsePolicyTest {
|
||||||
private fun title(id:String,type:String="movie")=Title.parse(JSONObject("""{"ratingKey":"$id","type":"$type","art":"/art/$id","title":"Title $id","originallyAvailableAt":"2026-10-01"}"""))
|
private fun title(id:String,type:String="movie")=Title.parse(JSONObject("""{"ratingKey":"$id","type":"$type","art":"/art/$id","title":"Title $id","originallyAvailableAt":"2026-10-01"}"""))
|
||||||
|
|
||||||
|
@Test fun recentSeasonsGroupByPlexShowIdentityAndPreserveRecency()=runBlocking {
|
||||||
|
val latest=title("s3","season").copy(parentId="show-a",parentTitle="Same name",title="Season 3")
|
||||||
|
val single=title("s1","season").copy(parentId="show-b",parentTitle="Same name",title="Season 1")
|
||||||
|
val older=title("s2","season").copy(parentId="show-a",parentTitle="Same name",title="Season 2")
|
||||||
|
val show=title("show-a","show");val loaded=mutableListOf<String>()
|
||||||
|
val result=groupRecentSeasons(listOf(latest,single,older,latest)){id->loaded+=id;show}
|
||||||
|
assertEquals(listOf("show-a","s1"),result.map{it.id})
|
||||||
|
assertEquals(show,result.first()) // Real show metadata, artwork, counts and navigation.
|
||||||
|
assertEquals("Same name · Season 1",result.last().title)
|
||||||
|
assertEquals(listOf("show-a"),loaded)
|
||||||
|
}
|
||||||
|
@Test fun recentSeasonsKeepUnknownParentsSeparateAndLimitAfterGrouping()=runBlocking {
|
||||||
|
val unknown=listOf(title("unknown1","season"),title("unknown2","season"))
|
||||||
|
val seasons=(1..24).map{title("s$it","season").copy(parentId="p$it")}
|
||||||
|
val result=groupRecentSeasons(unknown+seasons){error("Single seasons need no show request")}
|
||||||
|
assertEquals(18,result.size)
|
||||||
|
assertEquals(listOf("unknown1","unknown2","s1"),result.take(3).map{it.id})
|
||||||
|
assertTrue(groupRecentSeasons(emptyList()){error("Empty row")}.isEmpty())
|
||||||
|
}
|
||||||
|
|
||||||
@Test fun partiallyWatchedShowUsesEpisodeCountsEvenWithViewCount() {
|
@Test fun partiallyWatchedShowUsesEpisodeCountsEvenWithViewCount() {
|
||||||
val show=Title.parse(JSONObject("""{"type":"show","viewCount":12,"leafCount":30,"viewedLeafCount":10}"""))
|
val show=Title.parse(JSONObject("""{"type":"show","viewCount":12,"leafCount":30,"viewedLeafCount":10}"""))
|
||||||
assertFalse(show.fullyWatched);assertEquals(20,show.remainingEpisodes)
|
assertFalse(show.fullyWatched);assertEquals(20,show.remainingEpisodes)
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,8 @@ class LivePlexTest {
|
||||||
@Test fun liveGeneratedPreviewAndNewSeasons()=runBlocking {
|
@Test fun liveGeneratedPreviewAndNewSeasons()=runBlocking {
|
||||||
val showSection=api.sections().first{it.type=="show"}
|
val showSection=api.sections().first{it.type=="show"}
|
||||||
val seasons=api.recentSeasons(showSection.id)
|
val seasons=api.recentSeasons(showSection.id)
|
||||||
assertTrue(seasons.isNotEmpty());assertTrue(seasons.all{it.type=="season"&&it.parentTitle.isNotBlank()})
|
assertTrue(seasons.isNotEmpty());assertTrue(seasons.all{it.type=="show"||it.type=="season"&&it.parentTitle.isNotBlank()})
|
||||||
|
assertEquals(seasons.size,seasons.map{if(it.type=="show")it.id else it.parentId.ifBlank{it.id}}.distinct().size)
|
||||||
val episode=api.details("7599") // Known live test episode with generated preview indexes.
|
val episode=api.details("7599") // Known live test episode with generated preview indexes.
|
||||||
assertTrue(episode.chapters.isNotEmpty())
|
assertTrue(episode.chapters.isNotEmpty())
|
||||||
val preview=api.previewPath(episode,90000) ?: error("No server preview path")
|
val preview=api.previewPath(episode,90000) ?: error("No server preview path")
|
||||||
|
|
@ -60,7 +61,7 @@ class LivePlexTest {
|
||||||
}
|
}
|
||||||
@Test fun liveDirectStreamCopiesSupportedVideo()=runBlocking {
|
@Test fun liveDirectStreamCopiesSupportedVideo()=runBlocking {
|
||||||
val episode=api.details("7599") // HEVC test episode supported by this onn.
|
val episode=api.details("7599") // HEVC test episode supported by this onn.
|
||||||
val decision=api.container("/video/:/transcode/universal/decision",api.transcodeParams(episode,"kaleido-remux-regression",1,90000,20000))
|
val decision=api.container("/video/:/transcode/universal/decision",api.transcodeParams(episode,"kaleido-remux-regression",1,90000,StreamQuality.Original))
|
||||||
val streams=decision.optJSONArray("Metadata").objects().flatMap{it.optJSONArray("Media").objects()}.flatMap{it.optJSONArray("Part").objects()}.flatMap{it.optJSONArray("Stream").objects()}
|
val streams=decision.optJSONArray("Metadata").objects().flatMap{it.optJSONArray("Media").objects()}.flatMap{it.optJSONArray("Part").objects()}.flatMap{it.optJSONArray("Stream").objects()}
|
||||||
assertEquals("copy",streams.first{it.optInt("streamType")==1}.optString("decision"))
|
assertEquals("copy",streams.first{it.optInt("streamType")==1}.optString("decision"))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,22 +44,39 @@ import kotlinx.coroutines.delay
|
||||||
@Composable fun TopBar(vm:KaleidoViewModel,navigation:DiscoveryNavigation?=null) {
|
@Composable fun TopBar(vm:KaleidoViewModel,navigation:DiscoveryNavigation?=null) {
|
||||||
val initialFocus by remember{derivedStateOf{vm.focusId.isBlank()}}
|
val initialFocus by remember{derivedStateOf{vm.focusId.isBlank()}}
|
||||||
val scope=rememberCoroutineScope();val pendingTab=remember{arrayOfNulls<Job>(1)}
|
val scope=rememberCoroutineScope();val pendingTab=remember{arrayOfNulls<Job>(1)}
|
||||||
|
val focusedTab=remember{arrayOf(vm.page.kind)}
|
||||||
// Let the focus highlight draw before the new section composes in its long frame,
|
// Let the focus highlight draw before the new section composes in its long frame,
|
||||||
// so the press responds at once. A quick second move replaces the pending switch.
|
// so the press responds at once. A quick second move replaces the pending switch.
|
||||||
fun activate(kind:String){pendingTab[0]?.cancel();pendingTab[0]=scope.launch{withFrameNanos{};withFrameNanos{};if(vm.page.kind!=kind)vm.tab(kind)}}
|
fun select(kind:String){vm.tab(kind);vm.focusId="tab:$kind"}
|
||||||
|
fun activate(kind:String){pendingTab[0]?.cancel();pendingTab[0]=scope.launch{withFrameNanos{};withFrameNanos{};if(vm.page.kind!=kind)select(kind)}}
|
||||||
val immersive=vm.page.kind=="home"||(vm.page.kind in listOf("movies","tv")&&!vm.allTitles)
|
val immersive=vm.page.kind=="home"||(vm.page.kind in listOf("movies","tv")&&!vm.allTitles)
|
||||||
// Extend the scrim beyond the controls so it dissolves into the scene without a hard edge.
|
// Extend the scrim beyond the controls so it dissolves into the scene without a hard edge.
|
||||||
Box(Modifier.fillMaxWidth().height(62.dp).drawBehind {
|
Box(Modifier.fillMaxWidth().height(62.dp).onPreviewKeyEvent {
|
||||||
|
// There is no destination above the header. Letting repeated Up events run
|
||||||
|
// Compose's default search measures offscreen lazy rows looking for one.
|
||||||
|
it.type==KeyEventType.KeyDown&&it.key==Key.DirectionUp
|
||||||
|
}.drawBehind {
|
||||||
val depth=if(immersive)size.height*1.8f else size.height
|
val depth=if(immersive)size.height*1.8f else size.height
|
||||||
val colors=if(!immersive)listOf(Ink,Ink)else if(navigation?.scrolled==true)listOf(Color.Black.copy(alpha=.93f),Color.Black.copy(alpha=.66f),Color.Black.copy(alpha=.18f),Color.Transparent)else listOf(Color.Black.copy(alpha=.64f),Color.Black.copy(alpha=.22f),Color.Transparent)
|
val colors=if(!immersive)listOf(Ink,Ink)else if(navigation?.scrolled==true)listOf(Color.Black.copy(alpha=.93f),Color.Black.copy(alpha=.66f),Color.Black.copy(alpha=.18f),Color.Transparent)else listOf(Color.Black.copy(alpha=.64f),Color.Black.copy(alpha=.22f),Color.Transparent)
|
||||||
drawRect(Brush.verticalGradient(colors,endY=depth),size=Size(size.width,depth))
|
drawRect(Brush.verticalGradient(colors,endY=depth),size=Size(size.width,depth))
|
||||||
}.padding(horizontal=Cinema.gutter)) {
|
}.padding(horizontal=Cinema.gutter)) {
|
||||||
Box(Modifier.align(Alignment.CenterStart)){Brand()}
|
Box(Modifier.align(Alignment.CenterStart)){Brand()}
|
||||||
Row(Modifier.align(Alignment.Center).onPreviewKeyEvent{
|
Row(Modifier.align(Alignment.Center).onPreviewKeyEvent{
|
||||||
if(navigation!=null&&it.type==KeyEventType.KeyDown&&it.key==Key.DirectionDown){navigation.enter?.invoke();true}else false
|
if(navigation!=null&&it.type==KeyEventType.KeyDown&&it.key==Key.DirectionDown){
|
||||||
|
pendingTab[0]?.cancel()
|
||||||
|
val target=focusedTab[0]
|
||||||
|
if(vm.page.kind!=target){navigation.pendingEntry=target;vm.tab(target);vm.focusId=if(target=="home")"home-feature"else "discovery-entry"}else navigation.enter?.invoke()
|
||||||
|
true
|
||||||
|
}else false
|
||||||
}.focusProperties{if(navigation!=null)down=navigation.entry},horizontalArrangement=Arrangement.spacedBy(16.dp),verticalAlignment=Alignment.CenterVertically) {
|
}.focusProperties{if(navigation!=null)down=navigation.entry},horizontalArrangement=Arrangement.spacedBy(16.dp),verticalAlignment=Alignment.CenterVertically) {
|
||||||
listOf("home" to "Home","movies" to "Movies","tv" to "TV Shows").forEach{(kind,label)->
|
listOf("home" to "Home","movies" to "Movies","tv" to "TV Shows").forEach{(kind,label)->
|
||||||
NavigationLabel(label,vm.page.kind==kind,modifier=if(navigation!=null&&vm.page.kind==kind)Modifier.focusRequester(navigation.top)else Modifier,initialFocus=vm.page.kind==kind&&initialFocus,onFocused={if(vm.page.kind!=kind)activate(kind)}){pendingTab[0]?.cancel();if(vm.page.kind!=kind)vm.tab(kind)}
|
NavigationLabel(label,vm.page.kind==kind,modifier=if(navigation!=null&&vm.page.kind==kind)Modifier.focusRequester(navigation.top)else Modifier,initialFocus=vm.page.kind==kind&&initialFocus,onFocused={
|
||||||
|
focusedTab[0]=kind
|
||||||
|
// A tab already has focus. Don't schedule its delayed initial-focus
|
||||||
|
// request again when the section changes: it can steal the next press.
|
||||||
|
vm.focusId="tab:$kind"
|
||||||
|
if(vm.page.kind!=kind)activate(kind)
|
||||||
|
}){pendingTab[0]?.cancel();if(vm.page.kind!=kind)select(kind)}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Row(Modifier.align(Alignment.CenterEnd),verticalAlignment=Alignment.CenterVertically,horizontalArrangement=Arrangement.spacedBy(9.dp)) {
|
Row(Modifier.align(Alignment.CenterEnd),verticalAlignment=Alignment.CenterVertically,horizontalArrangement=Arrangement.spacedBy(9.dp)) {
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ class DiscoveryNavigation {
|
||||||
val section=FocusRequester()
|
val section=FocusRequester()
|
||||||
val top=FocusRequester()
|
val top=FocusRequester()
|
||||||
var scrolled by mutableStateOf(false)
|
var scrolled by mutableStateOf(false)
|
||||||
|
var pendingEntry by mutableStateOf<String?>(null)
|
||||||
var enter:(()->Unit)?=null
|
var enter:(()->Unit)?=null
|
||||||
}
|
}
|
||||||
/** Preserve server-supplied recommendations, but give each destination an editorial purpose. */
|
/** Preserve server-supplied recommendations, but give each destination an editorial purpose. */
|
||||||
|
|
|
||||||
|
|
@ -73,9 +73,13 @@ private suspend fun LazyListState.animateBrowseTo(index:Int) {
|
||||||
repeat(45){withFrameNanos{}}
|
repeat(45){withFrameNanos{}}
|
||||||
if(!list.isScrollInProgress&&list.firstVisibleItemIndex==0&&list.firstVisibleItemScrollOffset==1)list.scrollBy(-1f)
|
if(!list.isScrollInProgress&&list.firstVisibleItemIndex==0&&list.firstVisibleItemScrollOffset==1)list.scrollBy(-1f)
|
||||||
}
|
}
|
||||||
val rowStates=remember(hubs){List(hubs.size){row->LazyListState(firstVisibleItemIndex=if(restore?.first==row)restore.second else 0)}}
|
val rowStates=remember(hubs){List(hubs.size){row->LazyListState(
|
||||||
|
cacheWindow=LazyLayoutCacheWindow(aheadFraction=1f,behindFraction=.5f),
|
||||||
|
firstVisibleItemIndex=if(restore?.first==row)restore.second else 0)}}
|
||||||
val requesters=remember(hubs){mutableMapOf<Pair<Int,Int>,FocusRequester>()}
|
val requesters=remember(hubs){mutableMapOf<Pair<Int,Int>,FocusRequester>()}
|
||||||
val columns=remember(hubs){mutableMapOf<Int,Int>()}
|
val columns=remember(hubs){mutableMapOf<Int,Int>()}
|
||||||
|
val pendingColumns=remember(hubs){mutableMapOf<Int,Int>()}
|
||||||
|
val horizontalTimes=remember(hubs){mutableMapOf<Int,Long>()}
|
||||||
val navigationJob=remember{arrayOfNulls<Job>(1)}
|
val navigationJob=remember{arrayOfNulls<Job>(1)}
|
||||||
val scope=rememberCoroutineScope()
|
val scope=rememberCoroutineScope()
|
||||||
val density=LocalDensity.current
|
val density=LocalDensity.current
|
||||||
|
|
@ -105,11 +109,15 @@ private suspend fun LazyListState.animateBrowseTo(index:Int) {
|
||||||
val rowOffset=if(home)1 else 0
|
val rowOffset=if(home)1 else 0
|
||||||
suspend fun moveToRow(row:Int,column:Int)=coroutineScope {
|
suspend fun moveToRow(row:Int,column:Int)=coroutineScope {
|
||||||
val state=rowStates.getOrNull(row) ?: return@coroutineScope
|
val state=rowStates.getOrNull(row) ?: return@coroutineScope
|
||||||
|
val visible=list.layoutInfo.visibleItemsInfo.any{it.index==row+rowOffset}&&state.layoutInfo.visibleItemsInfo.any{it.index==column}
|
||||||
|
val focused=visible&&runCatching{requesters[row to column]?.requestFocus()==true}.getOrDefault(false)
|
||||||
val scrolling=launch{list.animateBrowseTo(row+rowOffset)}
|
val scrolling=launch{list.animateBrowseTo(row+rowOffset)}
|
||||||
state.scrollToItem(column)
|
if(!state.layoutInfo.visibleItemsInfo.any{it.index==column})state.requestScrollToItem(column)
|
||||||
snapshotFlow{list.layoutInfo.visibleItemsInfo.any{it.index==row+rowOffset}&&state.layoutInfo.visibleItemsInfo.any{it.index==column}}.first{it}
|
if(!focused) {
|
||||||
withFrameNanos{}
|
snapshotFlow{list.layoutInfo.visibleItemsInfo.any{it.index==row+rowOffset}&&state.layoutInfo.visibleItemsInfo.any{it.index==column}}.first{it}
|
||||||
runCatching{requesters.getOrPut(row to column){FocusRequester()}.requestFocus()}
|
withFrameNanos{}
|
||||||
|
runCatching{requesters.getOrPut(row to column){FocusRequester()}.requestFocus()}
|
||||||
|
}
|
||||||
scrolling.join()
|
scrolling.join()
|
||||||
}
|
}
|
||||||
suspend fun moveToHero()=coroutineScope {
|
suspend fun moveToHero()=coroutineScope {
|
||||||
|
|
@ -120,9 +128,23 @@ private suspend fun LazyListState.animateBrowseTo(index:Int) {
|
||||||
LaunchedEffect(home,features.isNotEmpty()){if(home&&vm.focusId=="home-feature"){list.scrollToItem(0);withFrameNanos{};runCatching{heroFocus.requestFocus()}}}
|
LaunchedEffect(home,features.isNotEmpty()){if(home&&vm.focusId=="home-feature"){list.scrollToItem(0);withFrameNanos{};runCatching{heroFocus.requestFocus()}}}
|
||||||
DisposableEffect(navigation,list,hubs){
|
DisposableEffect(navigation,list,hubs){
|
||||||
navigation.scrolled=false
|
navigation.scrolled=false
|
||||||
navigation.enter={(if(home)activeFeature.value else hubs.firstOrNull()?.items?.firstOrNull())?.let{vm.anticipate(it,cinematic=home)};navigationJob[0]?.cancel();navigationJob[0]=scope.launch{list.animateBrowseTo(0);rowStates.firstOrNull()?.scrollToItem(0);withFrameNanos{};runCatching{(if(home)heroFocus else navigation.section).requestFocus()}}}
|
navigation.enter={
|
||||||
|
navigationJob[0]?.cancel()
|
||||||
|
// Discover is fixed above the catalog. Enter it immediately, without resetting
|
||||||
|
// or waiting for two lazy lists to lay out. The next Down explicitly enters row 0.
|
||||||
|
if(!home)runCatching{navigation.section.requestFocus()}
|
||||||
|
else {
|
||||||
|
val visible=list.layoutInfo.visibleItemsInfo.any{it.index==0}
|
||||||
|
if(visible)runCatching{heroFocus.requestFocus()}
|
||||||
|
navigationJob[0]=scope.launch{if(visible)list.animateBrowseTo(0)else moveToHero()}
|
||||||
|
activeFeature.value?.let{vm.anticipate(it,cinematic=true)}
|
||||||
|
}
|
||||||
|
}
|
||||||
onDispose{navigation.enter=null}
|
onDispose{navigation.enter=null}
|
||||||
}
|
}
|
||||||
|
LaunchedEffect(navigation.pendingEntry,destination) {
|
||||||
|
if(navigation.pendingEntry==destination){navigation.pendingEntry=null;navigation.enter?.invoke()}
|
||||||
|
}
|
||||||
val title=when(destination){"movies"->"Movies";"tv"->"TV Shows";else->"Home"}
|
val title=when(destination){"movies"->"Movies";"tv"->"TV Shows";else->"Home"}
|
||||||
BoxWithConstraints(Modifier.fillMaxSize()) {
|
BoxWithConstraints(Modifier.fillMaxSize()) {
|
||||||
val heroHeight=maxHeight*.80f-62.dp
|
val heroHeight=maxHeight*.80f-62.dp
|
||||||
|
|
@ -133,7 +155,12 @@ private suspend fun LazyListState.animateBrowseTo(index:Int) {
|
||||||
Row(Modifier.fillMaxWidth().height(39.dp).padding(horizontal=Cinema.gutter),verticalAlignment=Alignment.CenterVertically) {
|
Row(Modifier.fillMaxWidth().height(39.dp).padding(horizontal=Cinema.gutter),verticalAlignment=Alignment.CenterVertically) {
|
||||||
Text(title,color=Accent,fontSize=19.sp,fontWeight=FontWeight.SemiBold,modifier=Modifier.padding(end=20.dp))
|
Text(title,color=Accent,fontSize=19.sp,fontWeight=FontWeight.SemiBold,modifier=Modifier.padding(end=20.dp))
|
||||||
if(!home) {
|
if(!home) {
|
||||||
NavigationLabel("Discover",true,modifier=Modifier.focusRequester(navigation.section).focusProperties{up=navigation.top;down=navigation.entry},initialFocus=sectionEntry){}
|
NavigationLabel("Discover",true,modifier=Modifier.focusRequester(navigation.section).focusProperties{up=navigation.top;down=navigation.entry}.onPreviewKeyEvent {
|
||||||
|
if(it.type==KeyEventType.KeyDown&&it.key==Key.DirectionDown){
|
||||||
|
hubs.firstOrNull()?.items?.firstOrNull()?.let{item->vm.anticipate(item)}
|
||||||
|
navigationJob[0]?.cancel();navigationJob[0]=scope.launch{moveToRow(0,0)};true
|
||||||
|
}else false
|
||||||
|
},initialFocus=sectionEntry){}
|
||||||
// Nothing sits right of Library; an unbounded search would open Home from the top bar.
|
// Nothing sits right of Library; an unbounded search would open Home from the top bar.
|
||||||
NavigationLabel("Library",false,modifier=Modifier.focusProperties{up=navigation.top;down=navigation.entry;right=FocusRequester.Cancel}){vm.setAll(true)}
|
NavigationLabel("Library",false,modifier=Modifier.focusProperties{up=navigation.top;down=navigation.entry;right=FocusRequester.Cancel}){vm.setAll(true)}
|
||||||
}
|
}
|
||||||
|
|
@ -182,20 +209,39 @@ private suspend fun LazyListState.animateBrowseTo(index:Int) {
|
||||||
BrowseCard(vm,item,"${hub.id}:${item.id}",poster,wideEpisode,if(row==0&&column==0)navigation.entry else null,requester,staging,
|
BrowseCard(vm,item,"${hub.id}:${item.id}",poster,wideEpisode,if(row==0&&column==0)navigation.entry else null,requester,staging,
|
||||||
Modifier.onPreviewKeyEvent{event->
|
Modifier.onPreviewKeyEvent{event->
|
||||||
if(event.type==KeyEventType.KeyDown&&event.key in listOf(Key.DirectionLeft,Key.DirectionRight)) {
|
if(event.type==KeyEventType.KeyDown&&event.key in listOf(Key.DirectionLeft,Key.DirectionRight)) {
|
||||||
val target=column+if(event.key==Key.DirectionLeft)-1 else 1
|
val target=(pendingColumns[row] ?: column)+if(event.key==Key.DirectionLeft)-1 else 1
|
||||||
if(target in hub.items.indices) {
|
if(target in hub.items.indices) {
|
||||||
vm.anticipate(hub.items[target],cinematic=home)
|
val now=event.nativeKeyEvent.eventTime
|
||||||
|
val rapid=now-(horizontalTimes[row] ?: 0L)<160L
|
||||||
|
horizontalTimes[row]=now
|
||||||
|
pendingColumns[row]=target
|
||||||
navigationJob[0]?.cancel()
|
navigationJob[0]?.cancel()
|
||||||
val state=rowStates[row]
|
val state=rowStates[row]
|
||||||
val visible=state.layoutInfo.visibleItemsInfo.any{it.index==target}
|
|
||||||
if(visible)runCatching{requesters.getOrPut(row to target){FocusRequester()}.requestFocus()}
|
|
||||||
navigationJob[0]=scope.launch {
|
navigationJob[0]=scope.launch {
|
||||||
|
// KeyDown/KeyUp can arrive between frames. Commit focus once
|
||||||
|
// on the next frame, so accessibility doesn't force an extra
|
||||||
|
// catalog layout between those events. Bursts keep the latest
|
||||||
|
// logical column instead of dropping a move while awaiting layout.
|
||||||
|
withFrameNanos{}
|
||||||
|
if(!rapid)vm.anticipate(hub.items[target],cinematic=home)
|
||||||
|
val visible=state.layoutInfo.visibleItemsInfo.any{it.index==target}
|
||||||
val anchor=(target-1).coerceAtLeast(0)
|
val anchor=(target-1).coerceAtLeast(0)
|
||||||
if(visible) {
|
if(visible&&!rapid) {
|
||||||
|
runCatching{requesters.getOrPut(row to target){FocusRequester()}.requestFocus()}
|
||||||
val pitch=with(density){(if(poster)130.dp else if(wideEpisode)274.dp else 224.dp).toPx()}
|
val pitch=with(density){(if(poster)130.dp else if(wideEpisode)274.dp else 224.dp).toPx()}
|
||||||
val delta=(anchor-state.firstVisibleItemIndex)*pitch-state.firstVisibleItemScrollOffset
|
val delta=(anchor-state.firstVisibleItemIndex)*pitch-state.firstVisibleItemScrollOffset
|
||||||
if(kotlin.math.abs(delta)>1)state.animateScrollBy(delta,tween(140))
|
if(kotlin.math.abs(delta)>1)state.animateScrollBy(delta,tween(140))
|
||||||
}else{state.scrollToItem(anchor);withFrameNanos{};runCatching{requesters.getOrPut(row to target){FocusRequester()}.requestFocus()}}
|
}else{
|
||||||
|
// Schedule one layout for the next frame instead of forcing
|
||||||
|
// synchronous composition between rapid remote events.
|
||||||
|
state.requestScrollToItem(anchor)
|
||||||
|
snapshotFlow{state.layoutInfo.visibleItemsInfo.any{it.index==target}}.first{it}
|
||||||
|
withFrameNanos{};runCatching{requesters.getOrPut(row to target){FocusRequester()}.requestFocus()}
|
||||||
|
}
|
||||||
|
// A held direction snaps to the latest anchor. Repeatedly
|
||||||
|
// cancelling pixel animations and decoding transient backdrops
|
||||||
|
// costs more than the focus move; predict only after it settles.
|
||||||
|
if(rapid){delay(70);vm.anticipate(hub.items[target],cinematic=home)}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
|
|
@ -216,7 +262,7 @@ private suspend fun LazyListState.animateBrowseTo(index:Int) {
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
}else false
|
}else false
|
||||||
},onHovered={columns[row]=column;hovered.value=it;heroActive=false})
|
},onHovered={columns[row]=column;pendingColumns[row]=column;hovered.value=it;heroActive=false})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -264,12 +310,13 @@ private suspend fun LazyListState.animateBrowseTo(index:Int) {
|
||||||
/**
|
/**
|
||||||
* A newly shown section composed every visible card in one 100–200 ms frame. While it is
|
* A newly shown section composed every visible card in one 100–200 ms frame. While it is
|
||||||
* entering, each card first lays out at its fixed size and fills in its artwork and titles a
|
* entering, each card first lays out at its fixed size and fills in its artwork and titles a
|
||||||
* few cards per frame, under the page's fade-in. Cards composed later fill in at once.
|
* few cards per frame, under the page's fade-in. Later offscreen cards spread their
|
||||||
|
* artwork/text work over three frames too, keeping lazy-layout work short during input.
|
||||||
*/
|
*/
|
||||||
private class CardStaging {
|
private class CardStaging {
|
||||||
var entering=true
|
var entering=true
|
||||||
private var count=0
|
private var count=0
|
||||||
fun frames()=if(entering)count++/3 else -1
|
fun frames()=if(entering)count++/3 else count++%3
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable private fun BrowseCard(vm:KaleidoViewModel,item:Title,focusKey:String,poster:Boolean,wideEpisode:Boolean,entry:FocusRequester?,requester:FocusRequester,staging:CardStaging,modifier:Modifier,onHovered:(Title)->Unit) {
|
@Composable private fun BrowseCard(vm:KaleidoViewModel,item:Title,focusKey:String,poster:Boolean,wideEpisode:Boolean,entry:FocusRequester?,requester:FocusRequester,staging:CardStaging,modifier:Modifier,onHovered:(Title)->Unit) {
|
||||||
|
|
|
||||||
|
|
@ -65,9 +65,9 @@ class PlexApi(val clientId: String) {
|
||||||
suspend fun hubs(section: String? = null): List<Hub> = withContext(Dispatchers.Default){container(if(section==null) "/hubs" else "/hubs/sections/$section", mapOf("count" to "18","includeExternalMetadata" to "1")).optJSONArray("Hub").objects().map { Hub(it.optString("hubIdentifier",it.optString("key",it.optString("title"))),it.optString("title"),it.optJSONArray("Metadata").objects().map(Title::parse)) }.filter { it.items.isNotEmpty() && it.items.first().type in listOf("movie","show","episode","season","collection") }}
|
suspend fun hubs(section: String? = null): List<Hub> = withContext(Dispatchers.Default){container(if(section==null) "/hubs" else "/hubs/sections/$section", mapOf("count" to "18","includeExternalMetadata" to "1")).optJSONArray("Hub").objects().map { Hub(it.optString("hubIdentifier",it.optString("key",it.optString("title"))),it.optString("title"),it.optJSONArray("Metadata").objects().map(Title::parse)) }.filter { it.items.isNotEmpty() && it.items.first().type in listOf("movie","show","episode","season","collection") }}
|
||||||
suspend fun onDeck(): List<Title> = container("/library/onDeck",mapOf("X-Plex-Container-Size" to "30")).optJSONArray("Metadata").objects().map(Title::parse)
|
suspend fun onDeck(): List<Title> = container("/library/onDeck",mapOf("X-Plex-Container-Size" to "30")).optJSONArray("Metadata").objects().map(Title::parse)
|
||||||
suspend fun recentSeasons(section:String):List<Title> = withContext(Dispatchers.Default){
|
suspend fun recentSeasons(section:String):List<Title> = withContext(Dispatchers.Default){
|
||||||
container("/library/sections/$section/all",mapOf("type" to "3","sort" to "addedAt:desc","X-Plex-Container-Size" to "18")).optJSONArray("Metadata").objects().map{j->
|
// Fetch beyond the display limit so one large series import doesn't fill the row.
|
||||||
Title.parse(j).let{it.copy(title=listOf(it.parentTitle,it.title).filter{v->v.isNotBlank()}.joinToString(" · "))}
|
val seasons=container("/library/sections/$section/all",mapOf("type" to "3","sort" to "addedAt:desc","X-Plex-Container-Size" to "100")).optJSONArray("Metadata").objects().map(Title::parse)
|
||||||
}
|
groupRecentSeasons(seasons,::details)
|
||||||
}
|
}
|
||||||
suspend fun library(section: String, start: Int = 0, sort: String = "titleSort:asc", genre: String = "", unwatched: Boolean = false): LibraryPage = withContext(Dispatchers.Default){
|
suspend fun library(section: String, start: Int = 0, sort: String = "titleSort:asc", genre: String = "", unwatched: Boolean = false): LibraryPage = withContext(Dispatchers.Default){
|
||||||
val p=mutableMapOf("X-Plex-Container-Start" to start.toString(),"X-Plex-Container-Size" to "100","sort" to sort)
|
val p=mutableMapOf("X-Plex-Container-Start" to start.toString(),"X-Plex-Container-Size" to "100","sort" to sort)
|
||||||
|
|
|
||||||
14
app/src/main/java/tv/kaleido/app/RecentSeasons.kt
Normal file
14
app/src/main/java/tv/kaleido/app/RecentSeasons.kt
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
package tv.kaleido.app
|
||||||
|
|
||||||
|
import kotlinx.coroutines.async
|
||||||
|
import kotlinx.coroutines.awaitAll
|
||||||
|
import kotlinx.coroutines.coroutineScope
|
||||||
|
|
||||||
|
/** Preserve newest-first order. A multi-season addition opens the real show's season list. */
|
||||||
|
internal suspend fun groupRecentSeasons(seasons:List<Title>,loadShow:suspend (String)->Title):List<Title> = coroutineScope {
|
||||||
|
seasons.distinctBy{it.id}.groupBy{it.parentId.ifBlank{"season:${it.id}"}}.values.take(18).map { group->async {
|
||||||
|
val season=group.first()
|
||||||
|
if(group.size>1&&season.parentId.isNotBlank())loadShow(season.parentId)
|
||||||
|
else season.copy(title=listOf(season.parentTitle,season.title).filter{it.isNotBlank()}.joinToString(" · "))
|
||||||
|
}}.awaitAll()
|
||||||
|
}
|
||||||
|
|
@ -5,9 +5,11 @@ import androidx.compose.foundation.*
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.foundation.lazy.*
|
import androidx.compose.foundation.lazy.*
|
||||||
import androidx.compose.foundation.gestures.BringIntoViewSpec
|
import androidx.compose.foundation.gestures.BringIntoViewSpec
|
||||||
|
import androidx.compose.foundation.gestures.animateScrollBy
|
||||||
import androidx.compose.foundation.gestures.LocalBringIntoViewSpec
|
import androidx.compose.foundation.gestures.LocalBringIntoViewSpec
|
||||||
import androidx.compose.foundation.lazy.grid.*
|
import androidx.compose.foundation.lazy.grid.*
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.automirrored.outlined.ArrowBack
|
import androidx.compose.material.icons.automirrored.outlined.ArrowBack
|
||||||
import androidx.compose.material.icons.filled.PlayArrow
|
import androidx.compose.material.icons.filled.PlayArrow
|
||||||
|
|
@ -18,19 +20,25 @@ import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.focus.*
|
import androidx.compose.ui.focus.*
|
||||||
|
import androidx.compose.ui.input.key.*
|
||||||
import androidx.compose.ui.geometry.Offset
|
import androidx.compose.ui.geometry.Offset
|
||||||
import androidx.compose.ui.graphics.Brush
|
import androidx.compose.ui.graphics.Brush
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.graphics.Shadow
|
import androidx.compose.ui.graphics.Shadow
|
||||||
|
import androidx.compose.ui.graphics.graphicsLayer
|
||||||
import androidx.compose.ui.layout.ContentScale
|
import androidx.compose.ui.layout.ContentScale
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
import androidx.compose.ui.platform.LocalDensity
|
||||||
import androidx.compose.ui.semantics.*
|
import androidx.compose.ui.semantics.*
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
|
import androidx.compose.ui.window.Dialog
|
||||||
|
import androidx.compose.ui.window.DialogProperties
|
||||||
import coil.compose.AsyncImage
|
import coil.compose.AsyncImage
|
||||||
import coil.request.ImageRequest
|
import coil.request.ImageRequest
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
@Composable fun DetailsScreen(vm:KaleidoViewModel) {
|
@Composable fun DetailsScreen(vm:KaleidoViewModel) {
|
||||||
val item=vm.detail ?: return
|
val item=vm.detail ?: return
|
||||||
|
|
@ -39,6 +47,7 @@ import coil.request.ImageRequest
|
||||||
val restoreFocus=remember(item.id){vm.focusId}
|
val restoreFocus=remember(item.id){vm.focusId}
|
||||||
val restoreRow=remember(item.id){listOf("cast:","children:","related:").any{restoreFocus.startsWith("$it${item.id}:")}}
|
val restoreRow=remember(item.id){listOf("cast:","children:","related:").any{restoreFocus.startsWith("$it${item.id}:")}}
|
||||||
val list=rememberLazyListState()
|
val list=rememberLazyListState()
|
||||||
|
val backdropFadeDistance=with(LocalDensity.current){180.dp.toPx()}
|
||||||
LaunchedEffect(item.id,vm.children.isNotEmpty(),vm.detailRelated.isNotEmpty()) {
|
LaunchedEffect(item.id,vm.children.isNotEmpty(),vm.detailRelated.isNotEmpty()) {
|
||||||
val castCount=if(item.castMembers.isNotEmpty())1 else 0
|
val castCount=if(item.castMembers.isNotEmpty())1 else 0
|
||||||
val target=when {
|
val target=when {
|
||||||
|
|
@ -53,14 +62,17 @@ import coil.request.ImageRequest
|
||||||
}
|
}
|
||||||
Box(Modifier.fillMaxSize().background(Ink)) {
|
Box(Modifier.fillMaxSize().background(Ink)) {
|
||||||
if(item.type=="show") {
|
if(item.type=="show") {
|
||||||
BrowseBackdrop(vm.api,item.art.ifBlank{item.thumb},Modifier.fillMaxSize(),cinematic=true)
|
BrowseBackdrop(vm.api,item.art.ifBlank{item.thumb},Modifier.fillMaxSize().graphicsLayer {
|
||||||
// Keep long descriptions and provider badges legible across bright artwork.
|
alpha=if(list.firstVisibleItemIndex>0)0f else (1f-list.firstVisibleItemScrollOffset/backdropFadeDistance).coerceIn(0f,1f)
|
||||||
Box(Modifier.fillMaxSize().background(Brush.verticalGradient(0f to Ink.copy(alpha=.4f),.48f to Ink.copy(alpha=.4f),.75f to Color.Transparent)))
|
},cinematic=true)
|
||||||
|
// Keep the scene in the header; rows and captions sit on near-black. Read scroll
|
||||||
|
// in the layer so scrolling doesn't recompose the details and cast hierarchy.
|
||||||
|
Box(Modifier.fillMaxSize().background(Brush.verticalGradient(0f to Ink.copy(alpha=.4f),.35f to Ink.copy(alpha=.5f),.62f to Ink.copy(alpha=.96f),.8f to Ink)))
|
||||||
}
|
}
|
||||||
CompositionLocalProvider(LocalBringIntoViewSpec provides DetailsScroll) {
|
CompositionLocalProvider(LocalBringIntoViewSpec provides DetailsScroll) {
|
||||||
LazyColumn(state=list,contentPadding=PaddingValues(bottom=30.dp),verticalArrangement=Arrangement.spacedBy(18.dp),modifier=Modifier.fillMaxSize()) {
|
LazyColumn(state=list,contentPadding=PaddingValues(bottom=30.dp),verticalArrangement=Arrangement.spacedBy(18.dp),modifier=Modifier.fillMaxSize()) {
|
||||||
item(key="details-${item.id}") {
|
item(key="details-${item.id}") {
|
||||||
Box(Modifier.fillMaxWidth().height(if(item.type in listOf("movie","episode"))322.dp else 286.dp)) {
|
Box(Modifier.fillMaxWidth().then(if(item.type=="show")Modifier.heightIn(min=248.dp)else Modifier.height(if(item.type in listOf("movie","episode"))322.dp else 286.dp))) {
|
||||||
if(item.type!="show") {
|
if(item.type!="show") {
|
||||||
Artwork(vm.api,item.art,Modifier.fillMaxSize(),1920,1080)
|
Artwork(vm.api,item.art,Modifier.fillMaxSize(),1920,1080)
|
||||||
Box(Modifier.fillMaxSize().background(Brush.horizontalGradient(listOf(Ink.copy(alpha=.98f),Ink.copy(alpha=.8f),Color.Transparent))))
|
Box(Modifier.fillMaxSize().background(Brush.horizontalGradient(listOf(Ink.copy(alpha=.98f),Ink.copy(alpha=.8f),Color.Transparent))))
|
||||||
|
|
@ -68,9 +80,9 @@ import coil.request.ImageRequest
|
||||||
}
|
}
|
||||||
IconControl(Icons.AutoMirrored.Outlined.ArrowBack,"Back",modifier=Modifier.padding(start=36.dp,top=14.dp)){vm.back()}
|
IconControl(Icons.AutoMirrored.Outlined.ArrowBack,"Back",modifier=Modifier.padding(start=36.dp,top=14.dp)){vm.back()}
|
||||||
if(item.type=="show") {
|
if(item.type=="show") {
|
||||||
Row(Modifier.fillMaxWidth().padding(start=Cinema.gutter,end=Cinema.gutter,top=68.dp),horizontalArrangement=Arrangement.spacedBy(24.dp),verticalAlignment=Alignment.Top) {
|
Row(Modifier.fillMaxWidth().padding(start=Cinema.gutter,end=Cinema.gutter,top=56.dp),horizontalArrangement=Arrangement.spacedBy(24.dp),verticalAlignment=Alignment.Top) {
|
||||||
Artwork(vm.api,item.poster.ifBlank{item.thumb},Modifier.width(128.dp).height(192.dp).clip(androidx.compose.foundation.shape.RoundedCornerShape(6.dp)),384,576,animate=false,contentScale=ContentScale.Fit)
|
Artwork(vm.api,item.poster.ifBlank{item.thumb},Modifier.width(128.dp).height(192.dp).clip(androidx.compose.foundation.shape.RoundedCornerShape(6.dp)),384,576,animate=false,contentScale=ContentScale.Fit)
|
||||||
TitleInformation(vm,item,actionFocus,childFocus,!restoreRow,Modifier.weight(1f))
|
TitleInformation(vm,item,actionFocus,childFocus,!restoreRow,Modifier.weight(1f,fill=false).widthIn(max=560.dp))
|
||||||
}
|
}
|
||||||
}else TitleInformation(vm,item,actionFocus,childFocus,!restoreRow,Modifier.align(Alignment.CenterStart).padding(start=Cinema.gutter,top=30.dp).width(560.dp))
|
}else TitleInformation(vm,item,actionFocus,childFocus,!restoreRow,Modifier.align(Alignment.CenterStart).padding(start=Cinema.gutter,top=30.dp).width(560.dp))
|
||||||
}
|
}
|
||||||
|
|
@ -94,6 +106,8 @@ private object DetailsScroll:BringIntoViewSpec {
|
||||||
|
|
||||||
@Composable private fun TitleInformation(vm:KaleidoViewModel,item:Title,actionFocus:FocusRequester,childFocus:FocusRequester,initialFocus:Boolean,modifier:Modifier) {
|
@Composable private fun TitleInformation(vm:KaleidoViewModel,item:Title,actionFocus:FocusRequester,childFocus:FocusRequester,initialFocus:Boolean,modifier:Modifier) {
|
||||||
val actionNavigation=Modifier.focusProperties{if(vm.children.isNotEmpty())down=childFocus}
|
val actionNavigation=Modifier.focusProperties{if(vm.children.isNotEmpty())down=childFocus}
|
||||||
|
var summaryOverflow by remember(item.id){mutableStateOf(false)}
|
||||||
|
var showSynopsis by remember(item.id){mutableStateOf(false)}
|
||||||
Column(modifier) {
|
Column(modifier) {
|
||||||
CompositionLocalProvider(LocalTextStyle provides LocalTextStyle.current.copy(shadow=Shadow(Color.Black.copy(alpha=.95f),Offset(0f,2f),6f))) {
|
CompositionLocalProvider(LocalTextStyle provides LocalTextStyle.current.copy(shadow=Shadow(Color.Black.copy(alpha=.95f),Offset(0f,2f),6f))) {
|
||||||
if(item.type=="episode")Text(item.grandparentTitle,color=Cinema.secondary,fontSize=11.sp)
|
if(item.type=="episode")Text(item.grandparentTitle,color=Cinema.secondary,fontSize=11.sp)
|
||||||
|
|
@ -102,7 +116,7 @@ private object DetailsScroll:BringIntoViewSpec {
|
||||||
Text(listOf(item.subtitle,item.contentRating).filter{it.isNotBlank()}.joinToString(" · "),color=Muted,fontSize=10.5.sp,lineHeight=16.sp,maxLines=1,overflow=TextOverflow.Ellipsis,modifier=Modifier.weight(1f,fill=false))
|
Text(listOf(item.subtitle,item.contentRating).filter{it.isNotBlank()}.joinToString(" · "),color=Muted,fontSize=10.5.sp,lineHeight=16.sp,maxLines=1,overflow=TextOverflow.Ellipsis,modifier=Modifier.weight(1f,fill=false))
|
||||||
AudienceRatings(item,Modifier.padding(start=12.dp))
|
AudienceRatings(item,Modifier.padding(start=12.dp))
|
||||||
}
|
}
|
||||||
Text(item.summary,color=Cinema.secondary,fontSize=12.sp,lineHeight=18.sp,maxLines=3,overflow=TextOverflow.Ellipsis,modifier=Modifier.padding(top=10.dp,bottom=17.dp))
|
Text(item.summary,color=Cinema.secondary,fontSize=12.sp,lineHeight=18.sp,maxLines=3,overflow=TextOverflow.Ellipsis,onTextLayout={summaryOverflow=it.hasVisualOverflow},modifier=Modifier.padding(top=10.dp,bottom=17.dp))
|
||||||
}
|
}
|
||||||
if(item.type!="collection")Row(horizontalArrangement=Arrangement.spacedBy(9.dp),verticalAlignment=Alignment.CenterVertically) {
|
if(item.type!="collection")Row(horizontalArrangement=Arrangement.spacedBy(9.dp),verticalAlignment=Alignment.CenterVertically) {
|
||||||
ActionButton(if(item.offset>0)"Resume · ${item.offset/60000} min"else if(item.type=="show")"Watch next"else "Play",Icons.Filled.PlayArrow,modifier=actionNavigation.focusRequester(actionFocus),primary=true,initialFocus=initialFocus){vm.play(item)}
|
ActionButton(if(item.offset>0)"Resume · ${item.offset/60000} min"else if(item.type=="show")"Watch next"else "Play",Icons.Filled.PlayArrow,modifier=actionNavigation.focusRequester(actionFocus),primary=true,initialFocus=initialFocus){vm.play(item)}
|
||||||
|
|
@ -111,9 +125,41 @@ private object DetailsScroll:BringIntoViewSpec {
|
||||||
val watched=item.isWatched(vm.watchedPercent)
|
val watched=item.isWatched(vm.watchedPercent)
|
||||||
ActionButton(if(vm.markingId==item.id)"Updating…"else if(watched)"Mark unwatched"else "Mark watched",if(watched)Icons.Outlined.CheckCircle else Icons.Outlined.Check,modifier=actionNavigation){vm.mark(item)}
|
ActionButton(if(vm.markingId==item.id)"Updating…"else if(watched)"Mark unwatched"else "Mark watched",if(watched)Icons.Outlined.CheckCircle else Icons.Outlined.Check,modifier=actionNavigation){vm.mark(item)}
|
||||||
}
|
}
|
||||||
|
if(item.type=="show"&&summaryOverflow)ActionButton("Synopsis",Icons.Outlined.Description,modifier=actionNavigation){showSynopsis=true}
|
||||||
}
|
}
|
||||||
if(item.type!="show")item.media.firstOrNull()?.let{media->Text(listOf(media.resolution.uppercase(),media.videoCodec.uppercase(),media.audioCodec.uppercase()).filter{it.isNotBlank()}.joinToString(" · "),color=Cinema.quiet,fontSize=9.sp,modifier=Modifier.padding(top=12.dp))}
|
if(item.type!="show")item.media.firstOrNull()?.let{media->Text(listOf(media.resolution.uppercase(),media.videoCodec.uppercase(),media.audioCodec.uppercase()).filter{it.isNotBlank()}.joinToString(" · "),color=Cinema.quiet,fontSize=9.sp,modifier=Modifier.padding(top=12.dp))}
|
||||||
}
|
}
|
||||||
|
if(showSynopsis)SynopsisDialog(vm.api,item){showSynopsis=false}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable private fun SynopsisDialog(api:PlexApi,item:Title,onDismiss:()->Unit) {
|
||||||
|
val scroll=rememberScrollState()
|
||||||
|
val scope=rememberCoroutineScope()
|
||||||
|
val step=with(LocalDensity.current){100.dp.toPx()}
|
||||||
|
Dialog(onDismissRequest=onDismiss,properties=DialogProperties(usePlatformDefaultWidth=false,decorFitsSystemWindows=false)) {
|
||||||
|
Box(Modifier.fillMaxSize().background(Color.Black.copy(alpha=.42f)).padding(Cinema.gutter),contentAlignment=Alignment.Center) {
|
||||||
|
Row(Modifier.width(760.dp).heightIn(max=420.dp).clip(RoundedCornerShape(Cinema.radius)).background(Ink).border(1.dp,Accent.copy(alpha=.12f),RoundedCornerShape(Cinema.radius)).padding(28.dp).onPreviewKeyEvent {
|
||||||
|
if(it.type==KeyEventType.KeyDown&&it.key in listOf(Key.DirectionUp,Key.DirectionDown)) {
|
||||||
|
scope.launch{scroll.animateScrollBy(if(it.key==Key.DirectionUp)-step else step)};true
|
||||||
|
}else false
|
||||||
|
},horizontalArrangement=Arrangement.spacedBy(28.dp),verticalAlignment=Alignment.Top) {
|
||||||
|
Artwork(api,item.poster.ifBlank{item.thumb},Modifier.padding(top=4.dp).width(128.dp).height(192.dp).clip(RoundedCornerShape(Cinema.radius)),384,576,animate=false,contentScale=ContentScale.Fit)
|
||||||
|
Column(Modifier.weight(1f)) {
|
||||||
|
Row(Modifier.fillMaxWidth(),horizontalArrangement=Arrangement.spacedBy(18.dp),verticalAlignment=Alignment.Top) {
|
||||||
|
Column(Modifier.weight(1f)) {
|
||||||
|
Eyebrow("Synopsis")
|
||||||
|
Text(item.title,color=Accent,fontSize=26.sp,lineHeight=32.sp,fontWeight=FontWeight.SemiBold,maxLines=2,overflow=TextOverflow.Ellipsis,modifier=Modifier.padding(top=6.dp))
|
||||||
|
Text(listOf(item.year,item.contentRating).filter{it.isNotBlank()}.joinToString(" · "),color=Muted,fontSize=10.sp,lineHeight=14.sp,modifier=Modifier.padding(top=6.dp))
|
||||||
|
}
|
||||||
|
IconControl(Icons.Outlined.Close,"Close",initialFocus=true,onClick=onDismiss)
|
||||||
|
}
|
||||||
|
Box(Modifier.padding(top=18.dp,bottom=16.dp).fillMaxWidth().height(1.dp).background(Accent.copy(alpha=.1f)))
|
||||||
|
Text(item.summary,color=Cinema.secondary,fontSize=12.5.sp,lineHeight=20.sp,modifier=Modifier.weight(1f,fill=false).verticalScroll(scroll))
|
||||||
|
Text(if(scroll.maxValue>0)"↑ ↓ Scroll · Back to close"else "Back to close",color=Cinema.quiet,fontSize=9.sp,lineHeight=13.sp,modifier=Modifier.padding(top=20.dp))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable private fun CastRail(vm:KaleidoViewModel,item:Title,actionFocus:FocusRequester) {
|
@Composable private fun CastRail(vm:KaleidoViewModel,item:Title,actionFocus:FocusRequester) {
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
894a949b7aa290b6f1f90d692a22ac4043c709182b77b65cfa7704841d4a7ffa Kaleido.apk
|
ddc9b089bd02aaa0e636e27786159d86419dba8eba8e9995a569a3a9902b576b Kaleido.apk
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"version": "0.1.8",
|
"version": "0.1.9",
|
||||||
"versionCode": 9,
|
"versionCode": 10,
|
||||||
"url": "https://git.elijahkuntz.com/Elijah/Kaleido/raw/tag/v0.1.8/distribution/Kaleido.apk",
|
"url": "https://git.elijahkuntz.com/Elijah/Kaleido/raw/tag/v0.1.9/distribution/Kaleido.apk",
|
||||||
"checksumUrl": "https://git.elijahkuntz.com/Elijah/Kaleido/raw/tag/v0.1.8/distribution/Kaleido.apk.sha256",
|
"checksumUrl": "https://git.elijahkuntz.com/Elijah/Kaleido/raw/tag/v0.1.9/distribution/Kaleido.apk.sha256",
|
||||||
"notes": "- Add cast portraits with character names to title information. Select an actor to browse their movies and shows across your Plex libraries.\n- Add Mark watched / Mark unwatched buttons that synchronize movies, series and episodes with Plex.\n- Put Seasons first on TV show pages, followed by Cast and related shows supplied by Plex.\n- Redesign TV show information with a full backdrop, fitted poster and stable header placement. Add text shadows and stronger contrast for readable descriptions and ratings.\n- Redesign Settings with a category rail and consistent controls for Connection, Playback, Interface and Updates.\n- Refresh the screenshots and rewrite the README around the app's features and installation."
|
"notes": "- Move Seasons up on TV show pages so the artwork and season labels fit together on the first screen.\n- Constrain show descriptions to the movie-detail text width, with full text in an artwork-led Synopsis panel styled to match title details. Fade artwork to near-black behind lower rows and as details scroll.\n- Combine newly added seasons from the same Plex show into one card. Multiple seasons open the show's full season list; a single season still opens directly.\n- Make Movies and TV navigation enter Discover immediately, without waiting for catalog scrolling. Preserve a quick Down press while switching tabs and focus visible cards before scrolling.\n- Align horizontal focus and scrolling with the next frame, retain each requested D-pad step, and prepare nearby cards ahead of navigation. Prevent unnecessary focus searches above the top navigation."
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ The interface gives artwork priority. App chrome uses neutral near-black, charco
|
||||||
- Browsing card widths: landscape 214 dp, TV episodes 264 dp, posters 120 dp. Landscape artwork uses 16:9; posters use 2:3. The full grid scales six columns to available width. Captions reserve a fixed height.
|
- Browsing card widths: landscape 214 dp, TV episodes 264 dp, posters 120 dp. Landscape artwork uses 16:9; posters use 2:3. The full grid scales six columns to available width. Captions reserve a fixed height.
|
||||||
- Search uses three columns of landscape results. Episodes use their actual stills, preserving their native proportions instead of cropping them into posters.
|
- Search uses three columns of landscape results. Episodes use their actual stills, preserving their native proportions instead of cropping them into posters.
|
||||||
- Movie and episode information pages place a horizontal Cast row beneath the description and actions, using Plex portraits, names and character roles. TV show pages place Seasons first, then Cast, then server-provided Related shows; season pages likewise keep Episodes ahead of Cast. Missing portraits use a neutral person placeholder. Actor cards open a six-column filmography of available movies and shows across the connected server's libraries, using Plex actor identifiers and pagination.
|
- Movie and episode information pages place a horizontal Cast row beneath the description and actions, using Plex portraits, names and character roles. TV show pages place Seasons first, then Cast, then server-provided Related shows; season pages likewise keep Episodes ahead of Cast. Missing portraits use a neutral person placeholder. Actor cards open a six-column filmography of available movies and shows across the connected server's libraries, using Plex actor identifiers and pagination.
|
||||||
- TV show information uses a full-screen backdrop behind a fitted 128 × 192 dp poster and a top-aligned text block. The Back control stays in the safe area; focus only scrolls controls that are out of view. A dark backdrop fade and soft text shadows preserve contrast for descriptions, metadata and audience ratings.
|
- TV show information uses a full-screen backdrop behind a fitted 128 × 192 dp poster and a top-aligned text block capped at 560 dp, matching movie details. The three-line summary offers a Synopsis action when truncated, opening the full text with D-pad scrolling. Its 248 dp minimum header keeps season artwork and captions on the initial screen at the standard TV density; longer titles can grow the header. The Back control stays in the safe area; focus only scrolls controls that are out of view. Artwork fades to near-black before the lower rows and disappears over the first 180 dp of scrolling. Soft text shadows preserve header contrast.
|
||||||
- Movie, episode, show and season information pages expose labelled Mark watched / Mark unwatched actions. Changes are sent to Plex and reflected in the title, descendant episodes/seasons, library cards, actor results and recommendations. An in-flight write survives navigation and prevents duplicate submissions. Partial episode-list records update watch fields without replacing full cast/detail metadata.
|
- Movie, episode, show and season information pages expose labelled Mark watched / Mark unwatched actions. Changes are sent to Plex and reflected in the title, descendant episodes/seasons, library cards, actor results and recommendations. An in-flight write survives navigation and prevents duplicate submissions. Partial episode-list records update watch fields without replacing full cast/detail metadata.
|
||||||
- Settings uses a fixed category rail (Connection, Playback, Interface, Updates) beside compact value/action rows. Focus selects categories; Right enters their controls and Left returns to the rail. Neutral surfaces, white focus, existing typography and restrained motion match the browsing destinations. Existing account, quality, watched-threshold, navigation-sound and updater preferences keep their behavior.
|
- Settings uses a fixed category rail (Connection, Playback, Interface, Updates) beside compact value/action rows. Focus selects categories; Right enters their controls and Left returns to the rail. Neutral surfaces, white focus, existing typography and restrained motion match the browsing destinations. Existing account, quality, watched-threshold, navigation-sound and updater preferences keep their behavior.
|
||||||
- Features use original Plex clear-logo artwork within 264 × 80 dp, falling back to title text. Detail title: 32/36 sp. Library title: 29/34 sp. Discovery rail heading: 17/22 sp. Supporting information: 10/14 sp.
|
- Features use original Plex clear-logo artwork within 264 × 80 dp, falling back to title text. Detail title: 32/36 sp. Library title: 29/34 sp. Discovery rail heading: 17/22 sp. Supporting information: 10/14 sp.
|
||||||
|
|
@ -25,10 +25,15 @@ The interface gives artwork priority. App chrome uses neutral near-black, charco
|
||||||
- Text actions scale to 1.025 over 160 ms. Navigation uses text, an understated selected underline, and a translucent charcoal focus surface.
|
- 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 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.
|
- 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.
|
- A spaced 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 horizontal input settles to the latest target before starting speculative work. 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 use the same window. The window only fills ahead after the list has scrolled, so once a section settles it is nudged 1 px and back, letting the next rows compose in idle frames instead of during the first move down. Card sizes, row targets and the large cinematic Home layout are unchanged.
|
- 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 use the same window. The window only fills ahead after the list has scrolled, so once a section settles it is nudged 1 px and back, letting the next rows compose in idle frames instead of during the first move down. 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, using per-draw alpha rather than an offscreen layer, and start once the new section's composition frames have passed (at most 300 ms). While a section enters, its cards lay out at their fixed size first and fill in artwork and titles three per frame under the fade, so the section's first frame stays short. Focusing a top tab lets its highlight draw before the section switches. The cold-start sequence lasts 2.9 seconds. The six exact facets begin as a closed, overlapping iris lit from behind; it holds there (at most 700 ms) until startup data has arrived and frames are steady, so cold-start hitches never interrupt the motion. The iris then twists 44° open and locks with a slight overshoot while light leaks through the six gaps, a single sheen crosses the settled mark, and the mark shrinks into a lockup scaled from the header brand as KALEIDO slides out from behind it. Once loading finishes (up to 600 ms extra) the camera flies through the aperture's dark center over 640 ms, revealing the app beneath as it settles from 114 percent scale. The completed mark itself is never redesigned. Android animation duration scale is honored, including animations off. It does not replay when returning from background.
|
- 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, using per-draw alpha rather than an offscreen layer, and start once the new section's composition frames have passed (at most 300 ms). While a section enters, its cards lay out at their fixed size first and fill in artwork and titles three per frame under the fade, so the section's first frame stays short. Focusing a top tab lets its highlight draw before the section switches. The cold-start sequence lasts 2.9 seconds. The six exact facets begin as a closed, overlapping iris lit from behind; it holds there (at most 700 ms) until startup data has arrived and frames are steady, so cold-start hitches never interrupt the motion. The iris then twists 44° open and locks with a slight overshoot while light leaks through the six gaps, a single sheen crosses the settled mark, and the mark shrinks into a lockup scaled from the header brand as KALEIDO slides out from behind it. Once loading finishes (up to 600 ms extra) the camera flies through the aperture's dark center over 640 ms, revealing the app beneath as it settles from 114 percent scale. The completed mark itself is never redesigned. 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.
|
- Returning from details restores the library's mode, scroll position, and previously focused title.
|
||||||
|
- Entering Movies/TV from the top bar focuses the fixed Discover control immediately. Down from Discover explicitly reveals the first catalog card; focus on already-visible targets changes before scrolling. A quick tab/Down sequence queues entry for the new destination, and focused tabs never repeat their delayed initial-focus request.
|
||||||
|
- Offscreen card navigation requests the next lazy layout instead of forcing synchronous composition between key events. Up at the top bar is consumed because there is no destination above it; it must not start a lazy-list focus search.
|
||||||
|
- Horizontal rows prepare one viewport ahead and retain half a viewport behind. New card artwork/text fills over up to three frames at fixed bounds. Horizontal focus commits on a frame boundary; a pending column accumulates rapid D-pad steps before committing the latest target, keeping accessibility layout work out of the gap between KeyDown and KeyUp.
|
||||||
|
- Horizontal presses less than 160 ms apart snap to the latest anchor and wait 70 ms before speculative metadata/artwork. Spaced presses retain the 140 ms scroll animation and immediate prediction.
|
||||||
|
- New seasons groups additions by Plex parent show ID, preserving newest-first order. Multiple seasons use the real show metadata and open its season list; single-season additions retain direct season navigation. The query samples 100 seasons before selecting up to 18 distinct shows, so one series import cannot occupy every card.
|
||||||
|
|
||||||
## Player
|
## Player
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -130,3 +130,17 @@ The TV show header initially moved its title to y=21 px when Compose's default T
|
||||||
Settings now uses Connection / Playback / Interface / Updates categories. The underlying account, preferences and signed-updater behavior are preserved. Raw captures and server-specific verification results remain in ignored `evidence/private/`; the README gallery contains reviewed screenshots from the release build.
|
Settings now uses Connection / Playback / Interface / Updates categories. The underlying account, preferences and signed-updater behavior are preserved. Raw captures and server-specific verification results remain in ignored `evidence/private/`; the README gallery contains reviewed screenshots from the release build.
|
||||||
|
|
||||||
Final 0.1.8 verification: `Build.ps1 -Release -Test` passed; `verify_settings.py` passed category focus, Original quality / 80% dialog cancellation, live update checking and sign-out cancellation. `verify_navigation_sounds.py` passed Off and On persistence across cold starts, leaving sounds On. All six `verify_ui.py browse` checks passed, including real Plex PIN cancellation. The final signed APK (version code 9) was installed in place and profile compiled; the encrypted session and playback preferences were retained. The app was returned to Home. The release gallery includes nine new 1920 × 1080 captures, encoded as lossless WebP and checked for pixel equality with their source PNGs.
|
Final 0.1.8 verification: `Build.ps1 -Release -Test` passed; `verify_settings.py` passed category focus, Original quality / 80% dialog cancellation, live update checking and sign-out cancellation. `verify_navigation_sounds.py` passed Off and On persistence across cold starts, leaving sounds On. All six `verify_ui.py browse` checks passed, including real Plex PIN cancellation. The final signed APK (version code 9) was installed in place and profile compiled; the encrypted session and playback preferences were retained. The app was returned to Home. The release gallery includes nine new 1920 × 1080 captures, encoded as lossless WebP and checked for pixel equality with their source PNGs.
|
||||||
|
|
||||||
|
## Show details, season grouping and remote navigation - 2026-10-26 (0.1.9)
|
||||||
|
|
||||||
|
Show information now uses a 248 dp minimum header, with the fitted poster starting at 56 dp and description width capped at 560 dp. On the onn, the 3 Body Problem title stays at `[392,112,849,188]`, Back remains visible, and the full Season 1 caption fits inside the first screen. Truncated text opens a near-black, poster-led Synopsis panel with the existing typography and circular close control. The release layout check passed opening, D-pad scrolling, Close, Back and restoration to Synopsis. Scrolled Cast screenshots show a near-black background: the header artwork fades completely over the first 180 dp of scrolling, while the lower-screen scrim is opaque.
|
||||||
|
|
||||||
|
New seasons samples 100 Plex season records, deduplicates by parent show ID, then selects up to 18 groups in recency order. Multiple seasons use the actual parent show's metadata and open its season list; single seasons still open directly. Identity/order/limit tests and the live Plex query passed. The TV screenshot shows one Punkin Chunkin card among the other shows.
|
||||||
|
|
||||||
|
A rapid Right/Down sequence reproduced a dropped Down press in 0.1.8. Tab activation waited two frames, and delayed initial-focus effects could reclaim focus after the next move. The release queues entry for the intended destination, records already-focused tabs, and enters the fixed Discover control without waiting for catalog resets. Rapid Movies/Down and TV/Down, re-entry after catalog scrolling, and a four-step horizontal out-and-back check passed on the onn. The startup section regression and all six `verify_ui.py browse` checks passed, including live PIN cancellation preserving the session.
|
||||||
|
|
||||||
|
Performance was measured with the signed release and confirmed ART `speed-profile` compilation, retaining both accessibility services and all device settings. Initial browsing samples missed the p95 <40 ms gate. A controlled comparison rebuilt unchanged 0.1.8 source with version code 10 solely to allow an in-place install; it measured median 16 ms / p95 53 ms on the same current content. Tracing showed offscreen composition and layout between rapid key events. Horizontal rows now cache one viewport ahead and half a viewport behind, stage new card content at fixed bounds, and commit pending column changes on frame boundaries. Spaced presses retain their animation; presses less than 160 ms apart snap to the latest anchor and defer speculative artwork until 70 ms of settling. Up at the top bar does not run a lazy focus search. The final onn browsing check passed with median 17 ms / p95 34 ms, GPU p95 7 ms and zero horizontal Y drift (63 rendered frames). Some frames still missed 60 Hz; this is a device sample, not a guarantee.
|
||||||
|
|
||||||
|
The macOS checkout was reattached to the existing repository history without replacing its source files. Builds reused an existing JDK 17 with Gradle 8.13 and an isolated SDK 36, and used the original private signing key. `assembleRelease testDebugUnitTest lintDebug` passed (five unit tests); the signed debug build passed all 21 Android integration tests against the existing encrypted session. An outdated integration-test transcode argument was updated to `StreamQuality.Original`. Scripts accept `KALEIDO_ADB` for the local ADB executable and retain the authorized serial selection. Private keys, toolchains and raw device evidence remain ignored.
|
||||||
|
|
||||||
|
On the TCL (`192.168.50.200:5555`), 0.1.9 installed in place and ART confirmed `speed-profile` after a lost compilation reply. Rapid tab/Down, scrolled catalog re-entry and the horizontal round-trip passed. A longer transition run lost its ADB transport; `device.py` now reconnects when the serial disappears as well as on closed/offline errors. A shorter, complete Movies sample (`profile_transitions.py --skip-home`) measured tab → Discover p95 22.7 ms, Discover → row 23.2 ms and row → row 46.1 ms (baseline 74.8 ms). Entering Movies measured p95 94.2 ms / maximum 106.4 ms, versus baseline 106.8 / 150.1 ms. These are individual samples; the weaker TV still misses frames on section composition, and the interrupted run is not counted as a complete pass. Both comparisons retained the existing session and settings.
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
"""Operate only Kaleido on an authorized streamer. Credentials stay on stdin."""
|
"""Operate only Kaleido on an authorized streamer. Credentials stay on stdin."""
|
||||||
import argparse, json, os, pathlib, subprocess, sys, time, xml.etree.ElementTree as ET
|
import argparse, json, os, pathlib, shutil, subprocess, sys, time, xml.etree.ElementTree as ET
|
||||||
ROOT=pathlib.Path(__file__).resolve().parents[1]
|
ROOT=pathlib.Path(__file__).resolve().parents[1]
|
||||||
ADB=pathlib.Path(r'C:\Users\Elijah\Desktop\platform-tools\adb.exe')
|
ADB=pathlib.Path(os.environ.get('KALEIDO_ADB') or shutil.which('adb') or r'C:\Users\Elijah\Desktop\platform-tools\adb.exe')
|
||||||
# The onn is the default; KALEIDO_DEVICE selects the authorized Fire TV Stick (192.168.50.146:5555).
|
# The onn is the default; KALEIDO_DEVICE selects another authorized test streamer.
|
||||||
DEVICE=os.environ.get('KALEIDO_DEVICE','192.168.50.195:5555')
|
DEVICE=os.environ.get('KALEIDO_DEVICE','192.168.50.195:5555')
|
||||||
OUT=ROOT/'evidence/private'
|
OUT=ROOT/'evidence/private'
|
||||||
OUT.mkdir(parents=True,exist_ok=True)
|
OUT.mkdir(parents=True,exist_ok=True)
|
||||||
|
|
@ -11,7 +11,7 @@ def adb(*args, data=None):
|
||||||
p=subprocess.run([str(ADB),'-s',DEVICE,*args],input=data,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
|
p=subprocess.run([str(ADB),'-s',DEVICE,*args],input=data,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
|
||||||
error=p.stderr.decode(errors='replace')
|
error=p.stderr.decode(errors='replace')
|
||||||
# The TCL's network ADB link drops intermittently; reconnecting restores it.
|
# The TCL's network ADB link drops intermittently; reconnecting restores it.
|
||||||
if p.returncode and attempt<3 and ('closed' in error or 'offline' in error):
|
if p.returncode and attempt<3 and any(reason in error for reason in ('closed','offline',f"device '{DEVICE}' not found",f"no such device '{DEVICE}'")):
|
||||||
subprocess.run([str(ADB),'disconnect',DEVICE],capture_output=True);time.sleep(2)
|
subprocess.run([str(ADB),'disconnect',DEVICE],capture_output=True);time.sleep(2)
|
||||||
subprocess.run([str(ADB),'connect',DEVICE],capture_output=True);time.sleep(2);continue
|
subprocess.run([str(ADB),'connect',DEVICE],capture_output=True);time.sleep(2);continue
|
||||||
# It also occasionally fails a shell command silently. Retry, except key input,
|
# It also occasionally fails a shell command silently. Retry, except key input,
|
||||||
|
|
|
||||||
|
|
@ -65,11 +65,11 @@ def resummarize(label):
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser=argparse.ArgumentParser();parser.add_argument('label');parser.add_argument('--cycles',type=int,default=3)
|
parser=argparse.ArgumentParser();parser.add_argument('label');parser.add_argument('--cycles',type=int,default=3)
|
||||||
parser.add_argument('--window',type=float,default=1.2);parser.add_argument('--skip-movies',action='store_true');args=parser.parse_args()
|
parser.add_argument('--window',type=float,default=1.2);parser.add_argument('--skip-movies',action='store_true');parser.add_argument('--skip-home',action='store_true');args=parser.parse_args()
|
||||||
global LABEL;LABEL=args.label;(OUT/f'transitions-{LABEL}-frames.txt').unlink(missing_ok=True)
|
global LABEL;LABEL=args.label;(OUT/f'transitions-{LABEL}-frames.txt').unlink(missing_ok=True)
|
||||||
results={}
|
results={}
|
||||||
launch()
|
launch()
|
||||||
for _ in range(args.cycles):
|
for _ in range(0 if args.skip_home else args.cycles):
|
||||||
measure('home: tab -> hero',20,lambda r:focus(r) in HERO,args.window,results)
|
measure('home: tab -> hero',20,lambda r:focus(r) in HERO,args.window,results)
|
||||||
root=measure('home: hero -> row',20,card,args.window,results)
|
root=measure('home: hero -> row',20,card,args.window,results)
|
||||||
first=focus(root)
|
first=focus(root)
|
||||||
|
|
|
||||||
|
|
@ -17,4 +17,23 @@ assert back is not None,'Back control must remain visible on initial show entry'
|
||||||
back_bounds=list(map(int,re.findall(r'\d+',back.get('bounds'))))
|
back_bounds=list(map(int,re.findall(r'\d+',back.get('bounds'))))
|
||||||
assert back_bounds[1]>=0 and back_bounds[3]>back_bounds[1],'Back control must stay inside the visible header'
|
assert back_bounds[1]>=0 and back_bounds[3]>back_bounds[1],'Back control must stay inside the visible header'
|
||||||
assert 'Seasons' in labels(root),'Seasons must lead the rows beneath show information'
|
assert 'Seasons' in labels(root),'Seasons must lead the rows beneath show information'
|
||||||
print('PASS safe show header and Seasons first on initial entry')
|
screen=list(map(int,re.findall(r'\d+',root.find('node').get('bounds'))))
|
||||||
|
captions=[n for n in root.iter('node') if re.fullmatch(r'Season \d+',n.get('text',''))]
|
||||||
|
assert captions,'Season captions must be visible without scrolling'
|
||||||
|
for caption in captions:
|
||||||
|
box=list(map(int,re.findall(r'\d+',caption.get('bounds'))))
|
||||||
|
assert box[3]<=screen[3]-24,'Season caption must fit inside the bottom safe area'
|
||||||
|
summary=max((n for n in root.iter('node') if len(n.get('text',''))>120),key=lambda n:len(n.get('text')))
|
||||||
|
summary_bounds=list(map(int,re.findall(r'\d+',summary.get('bounds'))))
|
||||||
|
assert summary_bounds[2]-summary_bounds[0]<=screen[2]*560/960+2,'Show synopsis must use the bounded movie-detail text width'
|
||||||
|
print('PASS safe show header, bounded synopsis, and complete season captions on initial entry')
|
||||||
|
key(22,2);focused('Synopsis');key(23);focused('Close')
|
||||||
|
dialog=snapshot();screenshot('show-full-synopsis')
|
||||||
|
assert summary.get('text') in labels(dialog),'Full synopsis must remain available in the dialog'
|
||||||
|
key(20);key(19);focused('Close');key(23);focused('Synopsis')
|
||||||
|
key(23);focused('Close');key(4);focused('Synopsis')
|
||||||
|
print('PASS full synopsis opens, scrolls, and restores focus after Close or Back')
|
||||||
|
key(20);focused('Season 1');key(20)
|
||||||
|
wait(lambda r:'Cast' in labels(r) and bool(focus(r)) and 'Season 1' not in focus(r),'Cast focus beneath Seasons')
|
||||||
|
screenshot('show-scrolled-cast')
|
||||||
|
print('PASS Seasons-to-Cast navigation; captured scrolled backdrop for visual review')
|
||||||
|
|
|
||||||
29
scripts/verify_navigation_entry.py
Normal file
29
scripts/verify_navigation_entry.py
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
"""Check immediate tab/Down input and entry after the catalog was scrolled."""
|
||||||
|
from device import adb,screenshot
|
||||||
|
from verify_ui import launch,key,focused,wait,focus,labels
|
||||||
|
|
||||||
|
launch()
|
||||||
|
# Keep both events in one shell command: a pending two-frame tab activation must
|
||||||
|
# not let Down enter the old Home hero or get lost during composition.
|
||||||
|
adb('shell','input','keyevent','22','20')
|
||||||
|
wait(lambda r:'Recently released' in labels(r),'Rapid entry must load Movies')
|
||||||
|
focused('Discover')
|
||||||
|
key(20);wait(lambda r:focus(r) not in ('','Home','Movies','Discover','Play','Resume'),'Movies first poster')
|
||||||
|
key(20);wait(lambda r:focus(r) not in ('','Home','Movies','Discover'),'Movies second row')
|
||||||
|
key(19);key(19);focused('Discover');key(19);focused('Movies')
|
||||||
|
key(20);focused('Discover');key(20)
|
||||||
|
wait(lambda r:focus(r) not in ('','Home','Movies','Discover'),'Re-enter scrolled catalog')
|
||||||
|
screenshot('navigation-entry')
|
||||||
|
key(4);focused('Home')
|
||||||
|
adb('shell','input','keyevent','22','22','20')
|
||||||
|
wait(lambda r:'Next episodes' in labels(r),'Rapid double-tab entry must load TV')
|
||||||
|
focused('Discover')
|
||||||
|
key(4);focused('Home');key(20)
|
||||||
|
wait(lambda r:focus(r) in ('Play','Resume'),'Home hero')
|
||||||
|
key(20);root=wait(lambda r:focus(r) not in ('','Home','Play','Resume'),'Continue Watching card')
|
||||||
|
first=focus(root)
|
||||||
|
adb('shell','input','keyevent',*(['22']*4))
|
||||||
|
wait(lambda r:bool(focus(r)) and focus(r)!=first,'Rapid horizontal navigation')
|
||||||
|
adb('shell','input','keyevent',*(['21']*4))
|
||||||
|
focused(first)
|
||||||
|
print('PASS rapid Movies/Down and TV/Down, direct Discover entry, scrolled catalog re-entry, and rapid horizontal round-trip',flush=True)
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
versionName=0.1.8
|
versionName=0.1.9
|
||||||
versionCode=9
|
versionCode=10
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue