diff --git a/CHANGELOG.md b/CHANGELOG.md
index e10d864..6236a1d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,11 @@
# Kaleido releases
+## 0.2.1
+
+- Season and episode pages are one horizontal layout again. Moving along the season row shows that episode at the top, and selecting it or Play plays it, instead of opening another page with the same information. Back from playback returns to the episode you played.
+- Remove the Go to show button from season and episode pages; Back returns to the show, and quick actions still offer Go to show.
+- Play buttons are solid white only when focused, so an unfocused Play no longer looks selected.
+
## 0.2.0
- Search works fully with the remote: press Down or the keyboard's Search key to reach results, grouped into Movies, TV shows, Episodes and People. Search by voice with the microphone, the remote's search key or the Assistant.
diff --git a/README.md b/README.md
index b58a60d..271b74b 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,7 @@ A Plex client for Android TV, designed for browsing from the couch. Kaleido puts
- **Movies** starts with recent releases and recommendations. **TV Shows** leads with your next episodes, new seasons and newly added episodes.
- **Library** gives you an A–Z poster grid with genre, watched-status and sorting controls. If you have more than one movie or TV library, choose which one each section shows.
- **Search** finds movies, shows, episodes and people across your libraries. Type with the remote or search by voice.
-- **Title pages** include ratings, a synopsis, trailers and extras, and cast portraits with character names. Select an actor to see their available movies and shows. Series pages put seasons first; season pages list every episode with its synopsis.
+- **Title pages** include ratings, a synopsis, trailers and extras, and cast portraits with character names. Select an actor to see their available movies and shows. Series pages put seasons first. Season and episode pages show the episode you move to in the season row; select it, or Play, to watch.
- **Quick actions**: hold OK (or press Menu) on any title to play, start over, mark it watched, remove it from Continue Watching, or jump to its season or show.
### Watch the way you want
@@ -23,7 +23,7 @@ Choose audio tracks, subtitles, playback speed and chapters from the player. Tap
### Keep your place
-Playback progress and watched status sync with Plex, so your place carries across clients. Mark a movie, season or whole show watched or unwatched from its information page. You can set the playback percentage that counts as watched, too.
+Playback progress and watched status sync with Plex, so your place carries across clients. Mark a movie, episode, season or whole show watched or unwatched from its page or its quick actions. You can set the playback percentage that counts as watched, too.
Settings groups connection, playback, subtitles, interface and updates in one place. Navigation tap sounds can be turned on or off. The built-in updater checks for releases and downloads new versions without another manual sideload.
diff --git a/app/src/main/java/tv/kaleido/app/BrowseScreens.kt b/app/src/main/java/tv/kaleido/app/BrowseScreens.kt
index e829780..b4f2bb2 100644
--- a/app/src/main/java/tv/kaleido/app/BrowseScreens.kt
+++ b/app/src/main/java/tv/kaleido/app/BrowseScreens.kt
@@ -102,13 +102,15 @@ import androidx.compose.ui.text.input.TextFieldValue
}
/** [episodeTitles] labels episodes by number and name, for rows already inside their show. [onClick] replaces opening details. */
-@Composable fun MediaRow(vm:KaleidoViewModel,title:String,items:List
,rowId:String,landscape:Boolean=false,subtitle:String?=null,entryFocus:FocusRequester?=null,episodeTitles:Boolean=false,initialItem:String?=null,onClick:((Title)->Unit)?=null) {
+/** [selectedItem] is marked and is where [entryFocus] enters, e.g. the episode a season page shows. */
+@Composable fun MediaRow(vm:KaleidoViewModel,title:String,items:List,rowId:String,landscape:Boolean=false,subtitle:String?=null,entryFocus:FocusRequester?=null,episodeTitles:Boolean=false,initialItem:String?=null,selectedItem:String?=initialItem,up:FocusRequester?=null,onFocused:((Title)->Unit)?=null,onClick:((Title)->Unit)?=null) {
val initial=remember(rowId){items.indexOfFirst{it.id==initialItem}.coerceAtLeast(0)}
+ val entry=items.indexOfFirst{it.id==selectedItem}.takeIf{it>=0} ?: initial
val row=rememberLazyListState(initialFirstVisibleItemIndex=(initial-1).coerceAtLeast(0))
Column {
Box(Modifier.padding(horizontal=Cinema.gutter)){SectionHeading(title,subtitle)}
LazyRow(state=row,contentPadding=PaddingValues(start=Cinema.gutter,end=Cinema.gutter,top=5.dp,bottom=5.dp),horizontalArrangement=Arrangement.spacedBy(if(landscape)13.dp else 12.dp),modifier=Modifier.focusRestorer(fallback=entryFocus ?: FocusRequester.Default)) {
- itemsIndexed(items,key={_,it->it.id}){index,item->MediaTile(vm,item,"$rowId:${item.id}",landscape,modifier=if(index==initial&&entryFocus!=null)Modifier.focusRequester(entryFocus)else Modifier,onMove={anticipateTileMove(vm,items,index,it,0)},episodeTitle=episodeTitles,current=item.id==initialItem,onClick=onClick)}
+ itemsIndexed(items,key={_,it->it.id}){index,item->MediaTile(vm,item,"$rowId:${item.id}",landscape,modifier=(if(index==entry&&entryFocus!=null)Modifier.focusRequester(entryFocus)else Modifier).then(if(up!=null)Modifier.focusProperties{this.up=up}else Modifier),onMove={anticipateTileMove(vm,items,index,it,0)},episodeTitle=episodeTitles,current=item.id==selectedItem,onFocused=onFocused,onClick=onClick)}
}
}
}
@@ -124,12 +126,12 @@ internal fun anticipateTileMove(vm:KaleidoViewModel,items:List,index:Int,
items.getOrNull(target)?.let{vm.anticipate(it,backdrop=false)}
}
-@Composable fun MediaTile(vm:KaleidoViewModel,item:Title,focusKey:String,landscape:Boolean=false,fillWidth:Boolean=false,initialFocus:Boolean=false,modifier:Modifier=Modifier,onMove:(Key)->Unit={},episodeTitle:Boolean=false,current:Boolean=false,onClick:((Title)->Unit)?=null) {
+@Composable fun MediaTile(vm:KaleidoViewModel,item:Title,focusKey:String,landscape:Boolean=false,fillWidth:Boolean=false,initialFocus:Boolean=false,modifier:Modifier=Modifier,onMove:(Key)->Unit={},episodeTitle:Boolean=false,current:Boolean=false,onFocused:((Title)->Unit)?=null,onClick:((Title)->Unit)?=null) {
var focused by remember{mutableStateOf(false)}
val requester=remember{FocusRequester()}
val scale by animateFloatAsState(if(focused)1.035f else 1f,tween(180),label="artworkFocus")
LaunchedEffect(Unit){if(vm.focusId==focusKey||initialFocus){delay(220);runCatching{requester.requestFocus()}}}
- Column(modifier.then(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}.titleActions{vm.showActions(item)}.clickable{if(onClick!=null)onClick(item)else vm.open(item)}) {
+ Column(modifier.then(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;onFocused?.invoke(item)}}.titleActions{vm.showActions(item)}.clickable{if(onClick!=null)onClick(item)else 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)
diff --git a/app/src/main/java/tv/kaleido/app/KaleidoViewModel.kt b/app/src/main/java/tv/kaleido/app/KaleidoViewModel.kt
index 903c353..c8e915a 100644
--- a/app/src/main/java/tv/kaleido/app/KaleidoViewModel.kt
+++ b/app/src/main/java/tv/kaleido/app/KaleidoViewModel.kt
@@ -65,6 +65,8 @@ class KaleidoViewModel(app: Application): AndroidViewModel(app) {
private var retryAction:(()->Unit)?=null
private var previousTab="home"
private val mediaChoices=mutableMapOf()
+ /** The episode a season or episode page shows, by page id. Focus in its season row chooses it. */
+ val episodeSelections=androidx.compose.runtime.mutableStateMapOf()
var query by mutableStateOf(""); private set
var pin by mutableStateOf(null); private set
var servers by mutableStateOf(emptyList()); private set
@@ -282,10 +284,10 @@ class KaleidoViewModel(app: Application): AndroidViewModel(app) {
if(kind in listOf("search","settings")&&pages.first().kind in listOf("home","movies","tv"))previousTab=pages.first().kind
cancelAnticipation();loadJob?.cancel();busy=false;focusId="";if(kind in listOf("movies","tv"))allTitles=false;pages=listOf(Page(kind));loadPage(true)
}
- fun open(item: Title){detailsCache[item.id]=item;pages=pages+Page(if(item.type in listOf("collection","season")) "group" else "details",item.id,item.title,focusId);loadPage()}
+ fun open(item: Title){detailsCache[item.id]=item;episodeSelections.remove(item.id);pages=pages+Page(if(item.type in listOf("collection","season")) "group" else "details",item.id,item.title,focusId);loadPage()}
/** Opens an episode's show, or a season's show. */
fun openShow(item:Title){val id=if(item.type=="episode")item.grandparentId else item.parentId;if(id.isBlank())return;pages=pages+Page("details",id,if(item.type=="episode")item.grandparentTitle else item.parentTitle,focusId);loadPage()}
- fun openSeason(item:Title){if(item.parentId.isBlank())return;pages=pages+Page("group",item.parentId,item.parentTitle,focusId);loadPage()}
+ fun openSeason(item:Title){if(item.parentId.isBlank())return;episodeSelections.remove(item.parentId);pages=pages+Page("group",item.parentId,item.parentTitle,focusId);loadPage()}
/** "View all" for a Plex hub row. */
fun openHub(hub:Hub){if(hub.key.isBlank())return;pages=pages+Page("hub",hub.key,hub.title,focusId);focusId="";loadPage()}
fun openSearch(text:String=""){if(page.kind!="search")tab("search");if(text.isNotBlank())search(text)}
@@ -454,7 +456,20 @@ class KaleidoViewModel(app: Application): AndroidViewModel(app) {
}catch(e:CancellationException){throw e}catch(e:Exception){fail(e.message ?: "The next episode could not be loaded."){nextEpisode(item)}}finally{transitioningEpisode=false}
}
}
- fun stopPlayback(){if(playing!=null)playbackReturn++;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 stopPlayback(){
+ val finished=playing
+ if(finished!=null)playbackReturn++;playing=null;sectionCache.clear();detailsCache.clear();previews.clear();cancelAnticipation()
+ // A season or episode page shows the last episode played, with fresh progress in its row.
+ detail?.let{if(finished?.type=="episode"&&it.type in listOf("season","episode"))episodeSelections[it.id]=finished.id}
+ launchLoad {
+ homeHubs=loadHome()
+ detail?.let {
+ if(it.type in listOf("movie","episode"))detail=api.details(it.id)
+ val season=when(it.type){"season"->it.id;"episode"->it.parentId;else->""}
+ if(season.isNotBlank())try{val fresh=api.children(season);if(detail?.id==it.id)children=fresh}catch(e:CancellationException){throw e}catch(_:Exception){}
+ }
+ }
+ }
// Earlier versions stored a mode (Original/Direct stream/Transcode) and a separate transcode quality.
private fun savedStreamQuality()=preferences.getString("streamQuality",null)?.let{name->StreamQuality.entries.firstOrNull{it.name==name}}
?: if(preferences.getInt("playbackModeV2",1)==2)(if(preferences.getInt("quality",20000)>20000)StreamQuality.UltraHD else StreamQuality.FullHD)else StreamQuality.Original
diff --git a/app/src/main/java/tv/kaleido/app/Theme.kt b/app/src/main/java/tv/kaleido/app/Theme.kt
index 7bdf424..8194866 100644
--- a/app/src/main/java/tv/kaleido/app/Theme.kt
+++ b/app/src/main/java/tv/kaleido/app/Theme.kt
@@ -72,8 +72,9 @@ object Cinema {
var focused by remember{mutableStateOf(false)}
val requester=remember{FocusRequester()}
val scale by animateFloatAsState(if(focused)1.025f else 1f,tween(160),label="actionScale")
- 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
+ // Only focus is solid white, as with TvButton; an unfocused Play must not look selected.
+ val background by animateColorAsState(if(focused)Accent else if(primary)Color.White.copy(alpha=.24f)else Color.White.copy(alpha=.12f),tween(160),label="actionSurface")
+ val foreground=if(focused)Ink else Accent
LaunchedEffect(initialFocus){if(initialFocus){withFrameNanos{};runCatching{requester.requestFocus()}}}
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))
diff --git a/app/src/main/java/tv/kaleido/app/TitleDetails.kt b/app/src/main/java/tv/kaleido/app/TitleDetails.kt
index 753c766..f72e5f7 100644
--- a/app/src/main/java/tv/kaleido/app/TitleDetails.kt
+++ b/app/src/main/java/tv/kaleido/app/TitleDetails.kt
@@ -49,27 +49,37 @@ import kotlinx.coroutines.launch
val restoreRow=remember(item.id){listOf("cast:","children:","related:","extras:").any{restoreFocus.startsWith("$it${item.id}:")}}
val list=rememberLazyListState()
val backdropFadeDistance=with(LocalDensity.current){180.dp.toPx()}
- val season=item.type=="season"
val extras=item.playableExtras
+ // Season and episode pages show one episode in the header; focus in the season row chooses it.
+ val episodic=item.type in listOf("season","episode")
+ val selectedId=vm.episodeSelections[item.id]
+ val selected=when {
+ !episodic->item
+ item.type=="episode"&&(selectedId==null||selectedId==item.id)->item
+ else->vm.children.firstOrNull{it.id==selectedId} ?: if(item.type=="episode")item else nextUp(vm.children,vm.watchedPercent) ?: item
+ }
+ // Row records are summaries; show full metadata once focus settles, keeping the row's progress.
+ var full by remember(item.id){mutableStateOf(null)}
+ LaunchedEffect(selected.id){if(selected!==item&&selected.type=="episode"){kotlinx.coroutines.delay(250);full=vm.previewDetails(selected)}}
+ val shown=if(selected===item)item else full?.takeIf{it.id==selected.id}?.copy(watched=selected.watched,offset=selected.offset) ?: selected
LaunchedEffect(item.id,vm.children.isNotEmpty(),vm.detailRelated.isNotEmpty()) {
// Lazy items in display order, so a restored row is revealed at its real index.
val rows=buildList {
add("details")
- if(vm.children.isNotEmpty()){if(season){add("episodes");vm.children.forEach{add("children:${item.id}:${it.id}")}}else add("children")}
+ if(vm.children.isNotEmpty())add("children")
if(item.castMembers.isNotEmpty())add("cast")
if(extras.isNotEmpty())add("extras")
if(vm.detailRelated.isNotEmpty())add("related")
}
- val target=listOf("children","cast","extras","related").firstOrNull{restoreFocus.startsWith("$it:${item.id}:")}?.let{row->
- if(row=="children"&&season)rows.indexOf(restoreFocus)else rows.indexOf(row)
- }?.takeIf{it>0}
+ val target=listOf("children","cast","extras","related").firstOrNull{restoreFocus.startsWith("$it:${item.id}:")}?.let{rows.indexOf(it)}?.takeIf{it>0}
// Async rows may not exist during the first restored layout. Reveal the
// requested row after it loads, then its card restores the exact focus.
if(target!=null)list.scrollToItem(target)
}
// Back from playback focuses Play/Resume rather than the first control on the page.
val seenReturn=remember{intArrayOf(vm.playbackReturn)}
- LaunchedEffect(vm.playbackReturn){if(vm.playbackReturn!=seenReturn[0]){seenReturn[0]=vm.playbackReturn;withFrameNanos{};list.scrollToItem(0);withFrameNanos{};runCatching{actionFocus.requestFocus()}}}
+ // An episode started from the season row gets focus back itself, once the rebuilt row composes.
+ LaunchedEffect(vm.playbackReturn){if(vm.playbackReturn!=seenReturn[0]){seenReturn[0]=vm.playbackReturn;if(vm.focusId.startsWith("children:${item.id}:"))return@LaunchedEffect;withFrameNanos{};list.scrollToItem(0);withFrameNanos{};runCatching{actionFocus.requestFocus()}}}
Box(Modifier.fillMaxSize().background(Ink)) {
val usesPosterHeader=item.type in listOf("show","movie")
if(usesPosterHeader) {
@@ -85,7 +95,8 @@ import kotlinx.coroutines.launch
CompositionLocalProvider(LocalBringIntoViewSpec provides DetailsScroll) {
LazyColumn(state=list,contentPadding=PaddingValues(bottom=30.dp),verticalArrangement=Arrangement.spacedBy(18.dp),modifier=Modifier.fillMaxSize()) {
item(key="details-${item.id}") {
- Box(Modifier.fillMaxWidth().then(if(usesPosterHeader)Modifier.heightIn(min=248.dp)else Modifier.heightIn(min=if(item.type=="episode")322.dp else 286.dp))) {
+ // A fixed episode header, so moving along the season row never shifts the page.
+ Box(Modifier.fillMaxWidth().then(if(usesPosterHeader)Modifier.heightIn(min=248.dp)else if(episodic)Modifier.height(322.dp)else Modifier.heightIn(min=286.dp))) {
if(!usesPosterHeader) {
Artwork(vm.api,item.art,Modifier.matchParentSize(),1920,1080)
Box(Modifier.matchParentSize().background(Brush.horizontalGradient(listOf(Ink.copy(alpha=.98f),Ink.copy(alpha=.8f),Color.Transparent))))
@@ -95,19 +106,16 @@ import kotlinx.coroutines.launch
if(usesPosterHeader) {
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)
- TitleInformation(vm,item,actionFocus,below,!restoreRow,Modifier.weight(1f))
+ TitleInformation(vm,item,item,actionFocus,below,!restoreRow,Modifier.weight(1f))
}
- }else TitleInformation(vm,item,actionFocus,below,!restoreRow,Modifier.align(Alignment.CenterStart).padding(start=Cinema.gutter,end=Cinema.gutter,top=64.dp,bottom=24.dp).fillMaxWidth())
+ }else TitleInformation(vm,shown,item,actionFocus,below,!restoreRow,Modifier.align(Alignment.CenterStart).padding(start=Cinema.gutter,end=Cinema.gutter,top=64.dp,bottom=24.dp).fillMaxWidth())
}
}
- if(vm.children.isNotEmpty()) {
- if(season) {
- item(key="episodes-${item.id}"){Box(Modifier.padding(horizontal=Cinema.gutter)){SectionHeading("Episodes")}}
- itemsIndexed(vm.children,key={_,ep->"ep-${ep.id}"}){index,ep->EpisodeRow(vm,ep,"children:${item.id}:${ep.id}",if(index==0)childFocus else null)}
- }else item(key="children-${item.id}") {
- if(item.type=="episode")MediaRow(vm,"Season ${item.parentIndex}",vm.children,"children:${item.id}",landscape=true,entryFocus=childFocus,episodeTitles=true,initialItem=item.id)
- else MediaRow(vm,if(item.type=="show")"Seasons"else "In this collection",vm.children,"children:${item.id}",entryFocus=childFocus)
- }
+ // Rebuilt after playback so the row scrolls to the episode last played.
+ if(vm.children.isNotEmpty())item(key="children-${item.id}-${if(episodic)vm.playbackReturn else 0}") {
+ if(episodic)MediaRow(vm,if(item.type=="season")item.title else "Season ${item.parentIndex}",vm.children,"children:${item.id}",landscape=true,entryFocus=childFocus,episodeTitles=true,
+ initialItem=selected.id,selectedItem=selected.id,up=actionFocus,onFocused={vm.episodeSelections[item.id]=it.id},onClick={vm.play(it)})
+ else MediaRow(vm,if(item.type=="show")"Seasons"else "In this collection",vm.children,"children:${item.id}",entryFocus=childFocus)
}
if(item.castMembers.isNotEmpty())item(key="cast-${item.id}"){CastRail(vm,item,actionFocus,castFocus)}
if(extras.isNotEmpty())item(key="extras-${item.id}"){MediaRow(vm,"Trailers & extras",extras,"extras:${item.id}",landscape=true,onClick={vm.play(it)})}
@@ -126,7 +134,8 @@ private object DetailsScroll:BringIntoViewSpec {
}
}
-@Composable private fun TitleInformation(vm:KaleidoViewModel,item:Title,actionFocus:FocusRequester,below:FocusRequester?,initialFocus:Boolean,modifier:Modifier) {
+/** [page] is the open title; on a season or episode page, [item] is the episode it shows. */
+@Composable private fun TitleInformation(vm:KaleidoViewModel,item:Title,page:Title,actionFocus:FocusRequester,below:FocusRequester?,initialFocus:Boolean,modifier:Modifier) {
val actionNavigation=Modifier.focusProperties{if(below!=null)down=below}
var summaryOverflow by remember(item.id){mutableStateOf(false)}
var showSynopsis by remember(item.id){mutableStateOf(false)}
@@ -135,9 +144,9 @@ private object DetailsScroll:BringIntoViewSpec {
Column(modifier) {
CompositionLocalProvider(LocalTextStyle provides LocalTextStyle.current.copy(shadow=Shadow(Color.Black.copy(alpha=.95f),Offset(0f,2f),6f))) {
// Seasons and episodes name their show above the title.
- val show=when(item.type){"episode"->item.grandparentTitle;"season"->item.parentTitle;else->""}
+ val show=when(page.type){"episode"->page.grandparentTitle;"season"->page.parentTitle;else->""}.ifBlank{item.grandparentTitle.takeIf{item.type=="episode"}.orEmpty()}
if(show.isNotBlank())Text(show,color=Cinema.secondary,fontSize=12.sp,lineHeight=16.sp,fontWeight=FontWeight.Medium)
- Text(item.title,color=Accent,fontSize=32.sp,lineHeight=36.sp,fontWeight=FontWeight.Bold,maxLines=2,overflow=TextOverflow.Ellipsis,modifier=Modifier.widthIn(max=560.dp))
+ Text(item.title,color=Accent,fontSize=32.sp,lineHeight=36.sp,fontWeight=FontWeight.Bold,maxLines=if(page.type in listOf("season","episode"))1 else 2,overflow=TextOverflow.Ellipsis,modifier=Modifier.widthIn(max=560.dp))
Row(Modifier.widthIn(max=620.dp).padding(top=9.dp),verticalAlignment=Alignment.CenterVertically) {
Text(listOf(item.subtitle,airDate(item.releaseDate).takeIf{item.type=="episode"}.orEmpty(),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))
@@ -146,8 +155,8 @@ private object DetailsScroll:BringIntoViewSpec {
}
// Scrolls sideways only if a title has more actions than fit beside its poster.
if(item.type!="collection")Row(Modifier.horizontalScroll(rememberScrollState()).padding(vertical=3.dp),horizontalArrangement=Arrangement.spacedBy(9.dp),verticalAlignment=Alignment.CenterVertically) {
- ActionButton(if(item.offset>0)"Resume from ${clockTime(item.offset)}"else if(item.type=="show")"Watch next"else "Play",Icons.Filled.PlayArrow,modifier=actionNavigation.focusRequester(actionFocus),primary=true,initialFocus=initialFocus){vm.play(item)}
- if(item.offset>0)ActionButton("Start over",Icons.Outlined.Replay,modifier=actionNavigation){vm.play(item,true)}
+ ActionButton(if(item.offset>0)"Resume from ${clockTime(item.offset)}"else if(item.type=="show")"Watch next"else "Play",Icons.Filled.PlayArrow,modifier=actionNavigation.focusRequester(actionFocus),primary=true,initialFocus=initialFocus){played(vm,page);vm.play(item)}
+ if(item.offset>0)ActionButton("Start over",Icons.Outlined.Replay,modifier=actionNavigation){played(vm,page);vm.play(item,true)}
if(item.type in listOf("movie","show","season","episode")) {
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)}
@@ -156,7 +165,6 @@ private object DetailsScroll:BringIntoViewSpec {
// Name the version by resolution unless several share it, e.g. two 1080p encodes.
if(item.media.size>1)ActionButton(if(item.media.map{it.resolutionLabel}.distinct().size==item.media.size&&media?.resolutionLabel?.isNotBlank()==true)"Version · ${media.resolutionLabel}"
else "Version ${vm.mediaIndex(item)+1} of ${item.media.size}",Icons.Outlined.Layers,modifier=actionNavigation){showVersions=true}
- if(item.type in listOf("episode","season")&&(if(item.type=="episode")item.grandparentId else item.parentId).isNotBlank())ActionButton("Go to show",Icons.Outlined.Tv,modifier=actionNavigation){vm.openShow(item)}
if(item.type in listOf("show","movie")&&summaryOverflow)ActionButton("Synopsis",Icons.Outlined.Description,modifier=actionNavigation){showSynopsis=true}
}
if(item.type !in listOf("show","season"))media?.let{Text(it.description(),color=Cinema.quiet,fontSize=9.5.sp,modifier=Modifier.padding(top=12.dp))}
@@ -165,36 +173,17 @@ private object DetailsScroll:BringIntoViewSpec {
if(showVersions)ChoiceDialog("Versions",item.media.map{it.description(includeSize=true)},vm.mediaIndex(item),{showVersions=false}){vm.chooseMedia(item,it);showVersions=false}
}
+/** Playback from the header returns to Play, not to the season row card focused last. */
+private fun played(vm:KaleidoViewModel,page:Title){vm.focusId="actions:${page.id}"}
+
/** "Jul 11, 2004" in the TV's locale, from Plex's ISO date. */
internal fun airDate(iso:String):String = runCatching{
java.time.LocalDate.parse(iso.take(10)).format(java.time.format.DateTimeFormatter.ofLocalizedDate(java.time.format.FormatStyle.MEDIUM))
}.getOrDefault("")
-/** A season's episode: still, number and title, runtime, air date and synopsis. */
-@Composable private fun EpisodeRow(vm:KaleidoViewModel,ep:Title,focusKey:String,entry:FocusRequester?) {
- var focused by remember{mutableStateOf(false)}
- val requester=remember{FocusRequester()}
- LaunchedEffect(Unit){if(vm.focusId==focusKey){withFrameNanos{};runCatching{requester.requestFocus()}}}
- Row(Modifier.padding(horizontal=Cinema.gutter-8.dp).fillMaxWidth().then(if(entry!=null)Modifier.focusRequester(entry)else Modifier).focusRequester(requester).navigationSound()
- .onFocusChanged{focused=it.isFocused;if(it.isFocused)vm.focusId=focusKey}.titleActions{vm.showActions(ep)}
- .clip(RoundedCornerShape(Cinema.radius)).background(if(focused)Color.White.copy(alpha=.1f)else Color.Transparent).clickable{vm.open(ep)}
- .clearAndSetSemantics{contentDescription=listOf("Episode ${ep.index}",ep.title,ep.watchStatus(vm.watchedPercent)).filter{it.isNotBlank()}.joinToString(". ");this.focused=focused;role=Role.Button;onClick{vm.open(ep);true}}
- .padding(8.dp),horizontalArrangement=Arrangement.spacedBy(18.dp),verticalAlignment=Alignment.CenterVertically) {
- Box(Modifier.width(160.dp).aspectRatio(16f/9f).clip(RoundedCornerShape(Cinema.radius))) {
- Artwork(vm.api,ep.thumb.ifBlank{ep.art},Modifier.fillMaxSize(),480,270,animate=false)
- if(ep.offset>0)Box(Modifier.align(Alignment.BottomCenter).fillMaxWidth().padding(start=6.dp,end=6.dp,bottom=5.dp).height(2.dp).background(Color.Black.copy(alpha=.5f))) {
- Box(Modifier.fillMaxWidth(ep.progress.coerceAtLeast(.015f)).fillMaxHeight().background(Accent))
- }
- WatchBadge(ep,vm.watchedPercent)
- if(focused)Box(Modifier.fillMaxSize().border(2.dp,Accent,RoundedCornerShape(Cinema.radius)))
- }
- Column(Modifier.weight(1f),verticalArrangement=Arrangement.spacedBy(3.dp)) {
- Text("${ep.index}. ${ep.title}",color=Accent,fontSize=14.sp,lineHeight=18.sp,fontWeight=if(focused)FontWeight.SemiBold else FontWeight.Medium,maxLines=1,overflow=TextOverflow.Ellipsis)
- Text(listOf(if(ep.duration>0)"${ep.duration/60000} min"else "",airDate(ep.releaseDate),if(ep.offset>0)"${((ep.duration-ep.offset)/60000).coerceAtLeast(0)} min left"else ep.watchStatus(vm.watchedPercent)).filter{it.isNotBlank()}.joinToString(" · "),color=Muted,fontSize=10.sp,lineHeight=14.sp,maxLines=1)
- if(ep.summary.isNotBlank())Text(ep.summary,color=Cinema.secondary,fontSize=11.sp,lineHeight=16.sp,maxLines=2,overflow=TextOverflow.Ellipsis,modifier=Modifier.widthIn(max=720.dp))
- }
- }
-}
+/** A season's next episode: in progress, else the first unwatched, else the first. */
+internal fun nextUp(episodes:List,watchedPercent:Int)=episodes.firstOrNull{it.offset>0&&!it.isWatched(watchedPercent)}
+ ?: episodes.firstOrNull{!it.isWatched(watchedPercent)} ?: episodes.firstOrNull()
@Composable private fun SynopsisDialog(api:PlexApi,item:Title,onDismiss:()->Unit) {
val scroll=rememberScrollState()
diff --git a/app/src/test/java/tv/kaleido/app/PlaybackModelTest.kt b/app/src/test/java/tv/kaleido/app/PlaybackModelTest.kt
index f53430c..6f91867 100644
--- a/app/src/test/java/tv/kaleido/app/PlaybackModelTest.kt
+++ b/app/src/test/java/tv/kaleido/app/PlaybackModelTest.kt
@@ -51,4 +51,12 @@ class PlaybackModelTest {
@Test fun speedLabels() {
assertEquals("Normal",speedLabel(1f));assertEquals("1.25×",speedLabel(1.25f));assertEquals("2×",speedLabel(2f))
}
+ @Test fun seasonPagesShowTheNextEpisode() {
+ val watched=title("episode","1").copy(watched=true)
+ val unwatched=title("episode","2");val started=title("episode","3").copy(duration=60_000,offset=10_000)
+ assertEquals("3",nextUp(listOf(watched,unwatched,started),80)?.id)
+ assertEquals("2",nextUp(listOf(watched,unwatched),80)?.id)
+ assertEquals("1",nextUp(listOf(watched),80)?.id)
+ assertNull(nextUp(emptyList(),80))
+ }
}
diff --git a/distribution/Kaleido.apk b/distribution/Kaleido.apk
index 49b0e46..9acb2ae 100644
Binary files a/distribution/Kaleido.apk and b/distribution/Kaleido.apk differ
diff --git a/distribution/Kaleido.apk.sha256 b/distribution/Kaleido.apk.sha256
index 3a6d160..090566a 100644
--- a/distribution/Kaleido.apk.sha256
+++ b/distribution/Kaleido.apk.sha256
@@ -1 +1 @@
-83592b2954402db222ed3e5e3f533fe3f2f17f8413cff85e77973213b4eb3233 Kaleido.apk
+aaf650185f6854837afae9f69aee40e64060e5b22d8783aa1850a31196bf075a Kaleido.apk
diff --git a/distribution/latest.json b/distribution/latest.json
index 7157628..0955a38 100644
--- a/distribution/latest.json
+++ b/distribution/latest.json
@@ -1,7 +1,7 @@
{
- "version": "0.2.0",
- "versionCode": 13,
- "url": "https://git.elijahkuntz.com/Elijah/Kaleido/raw/tag/v0.2.0/distribution/Kaleido.apk",
- "checksumUrl": "https://git.elijahkuntz.com/Elijah/Kaleido/raw/tag/v0.2.0/distribution/Kaleido.apk.sha256",
- "notes": "- Search works fully with the remote: press Down or the keyboard's Search key to reach results, grouped into Movies, TV shows, Episodes and People. Search by voice with the microphone, the remote's search key or the Assistant.\n- Hold OK (or press Menu) on any title for quick actions: play or resume, start over, mark watched, remove from Continue Watching, or go to the season or show.\n- Title pages add a Trailer button and a Trailers & extras row, a version picker for titles with several files, and a fuller media line with HDR/Dolby Vision, audio channels and bitrate. Season pages list episodes with synopses and air dates; episode pages show the rest of their season and link to the show.\n- Rows with more titles end in View all. Back from the rows returns to the top before leaving Kaleido. A second movie or TV library can be chosen from Discover and is remembered.\n- New settings: a separate remote-connection quality (1080p by default), autoplay countdown or off, automatic intro and credit skipping, and subtitle size and style with a preview. OK skips a visible intro or credits.\n- Stacked multi-part movies play through every part. Kaleido finds your server again if its address changes. A finished movie returns to its page, and focus returns to Play after playback.\n- Fix chapter numbering, menus that opened away from the current choice, a misleading checkmark in Playback options, season cards without their show name, faint focus on light posters, and Try again repeating the action that failed."
+ "version": "0.2.1",
+ "versionCode": 14,
+ "url": "https://git.elijahkuntz.com/Elijah/Kaleido/raw/tag/v0.2.1/distribution/Kaleido.apk",
+ "checksumUrl": "https://git.elijahkuntz.com/Elijah/Kaleido/raw/tag/v0.2.1/distribution/Kaleido.apk.sha256",
+ "notes": "- Season and episode pages are one horizontal layout again. Moving along the season row shows that episode at the top, and selecting it or Play plays it, instead of opening another page with the same information. Back from playback returns to the episode you played.\n- Remove the Go to show button from season and episode pages; Back returns to the show, and quick actions still offer Go to show.\n- Play buttons are solid white only when focused, so an unfocused Play no longer looks selected."
}
diff --git a/docs/runtime-verification.md b/docs/runtime-verification.md
index ec63d81..056c9fb 100644
--- a/docs/runtime-verification.md
+++ b/docs/runtime-verification.md
@@ -4,6 +4,13 @@ For the 2026-10-26 codec/HDR sweep and its native-versus-converted playback find
Target: the authorized onn at `192.168.50.195:5555`, package `tv.kaleido.app`. Other applications and the launcher were not modified. Screenshots, traces, UI dumps and server-specific logs stay in ignored `evidence/private/`.
+## 2026-10-27 one season layout (0.2.1)
+
+- 0.2.0 gave seasons a vertical episode list whose items opened an episode page with a horizontal season row, so the same season appeared in two layouts and selecting an episode never played it. Season and episode pages now share the episode header and horizontal season row: focusing a card shows that episode (summary row data at once, full metadata after 250 ms, keeping the row's progress), and OK on the card or Play plays it. The header has a fixed height so moving along the row never shifts the page. Up from the row returns to Play; Down from Play enters the shown episode.
+- The shown episode is kept per page in the ViewModel. Back from playback shows the last episode played and reloads the season's progress; focus returns to the card you played, or to Play when playback started there. Recording focus whenever the action row gained focus broke related-title focus restoration (`verify_details.py`), so only Play/Start over clicks record it.
+- Go to show left the season/episode header (it stays in quick actions). `ActionButton` primary actions are a tint until focused.
+- Verified on the onn with Cyberpunk: Edgerunners and the Silo fixtures (Play → 8594, card → 7604, return focus, Back to the show), `verify_ui.py browse` and `player`, `repro_runtime.py controls/episode/postplay/credits/sections/browse` (profiled release median 16 ms / p95 36 ms), `verify_details.py`, `verify_details_layout.py`, `verify_movie_details.py`, `verify_settings.py` and the unit tests. `verify_details_layout.py` now moves right until Synopsis (the fixture gained a Trailer button), and `verify_settings.py` accepts the saved Remote quality and Subtitle style rather than requiring defaults.
+
## 2026-10-27 audit fixes, quick actions, extras, voice search and new settings (0.2.0)
Addresses the findings in [the 0.1.11 audit](audit-2026-10-27.md).
diff --git a/scripts/verify_details_layout.py b/scripts/verify_details_layout.py
index 170e0ac..31b7718 100644
--- a/scripts/verify_details_layout.py
+++ b/scripts/verify_details_layout.py
@@ -27,7 +27,11 @@ summary=max((n for n in root.iter('node') if len(n.get('text',''))>120),key=lamb
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')
+# Trailer and other actions depend on the fixture; move right until Synopsis.
+for _ in range(5):
+ if 'Synopsis' in focus(snapshot()):break
+ key(22)
+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')
diff --git a/scripts/verify_settings.py b/scripts/verify_settings.py
index a76c017..e57528f 100644
--- a/scripts/verify_settings.py
+++ b/scripts/verify_settings.py
@@ -1,18 +1,21 @@
"""D-pad checks for the category settings page; dialogs are cancelled without changes."""
-from verify_ui import launch,key,text,focused,focus,snapshot
+from verify_ui import launch,key,text,focused,focus,snapshot,wait
from device import screenshot
launch();key(22,4);focused('Settings');key(23);focused('Switch account')
key(21);focused('Connection');key(20);focused('Playback');key(22);focused('Playback quality')
key(23);focused('Original quality');key(4);focused('Playback quality')
-key(20);focused('Remote quality');key(23);focused('1080p');key(4);focused('Remote quality')
+key(20);focused('Remote quality');key(23)
+# Opens on the current choice: 1080p by default.
+wait(lambda r:any(q in focus(r) for q in ('Original quality','4K','1080p','720p','480p')),'Remote quality choices');key(4);focused('Remote quality')
key(20);focused('Watched status');key(23);focused('80%');key(4);focused('Watched status')
key(20);focused('Autoplay next episode');key(23);focused('After 5 seconds');key(4);focused('Autoplay next episode')
key(20);focused('Skip intros');key(20);focused('Skip credits')
print('PASS playback dialogs cancel back to their controls',flush=True)
screenshot('settings-playback-current')
key(21);focused('Playback');key(20);focused('Subtitles');key(22);focused('Size');key(23);focused('Normal');key(4);focused('Size')
-key(20);focused('Style');key(23);focused('White on black');key(4);focused('Style')
+key(20);focused('Style');key(23)
+wait(lambda r:any(q in focus(r) for q in ('White on black','White with shadow','White with outline','Yellow with outline','Follow TV caption settings')),'Subtitle style choices');key(4);focused('Style')
screenshot('settings-subtitles-current')
key(21);focused('Subtitles');key(20);focused('Interface');key(22);focused('Navigation sounds')
key(21);focused('Interface');key(20);focused('Updates');key(22);focused('Check for updates');key(23)
diff --git a/version.properties b/version.properties
index 9b827af..529144c 100644
--- a/version.properties
+++ b/version.properties
@@ -1,2 +1,2 @@
-versionName=0.2.0
-versionCode=13
+versionName=0.2.1
+versionCode=14