mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 08:01:20 +02:00
Fix yet another focus problem
This commit is contained in:
parent
83a543ad7d
commit
b8e8a1d913
1 changed files with 9 additions and 0 deletions
|
|
@ -106,6 +106,7 @@ fun SeriesOverviewContent(
|
||||||
|
|
||||||
val scrollState = rememberScrollState()
|
val scrollState = rememberScrollState()
|
||||||
val scrollConnection = rememberDelayedNestedScroll()
|
val scrollConnection = rememberDelayedNestedScroll()
|
||||||
|
var requestFocusAfterSeason by remember { mutableStateOf(false) }
|
||||||
Box(
|
Box(
|
||||||
modifier =
|
modifier =
|
||||||
modifier
|
modifier
|
||||||
|
|
@ -146,6 +147,7 @@ fun SeriesOverviewContent(
|
||||||
onClick = {
|
onClick = {
|
||||||
selectedTabIndex = it
|
selectedTabIndex = it
|
||||||
onChangeSeason.invoke(it)
|
onChangeSeason.invoke(it)
|
||||||
|
requestFocusAfterSeason = true
|
||||||
},
|
},
|
||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
|
|
@ -180,6 +182,13 @@ fun SeriesOverviewContent(
|
||||||
}
|
}
|
||||||
|
|
||||||
is EpisodeList.Success -> {
|
is EpisodeList.Success -> {
|
||||||
|
if (requestFocusAfterSeason) {
|
||||||
|
// Changing seasons, so move focus once the new episodes are loaded
|
||||||
|
LaunchedEffect(Unit) {
|
||||||
|
firstItemFocusRequester.tryRequestFocus()
|
||||||
|
requestFocusAfterSeason = false
|
||||||
|
}
|
||||||
|
}
|
||||||
val state = rememberLazyListState(position.episodeRowIndex)
|
val state = rememberLazyListState(position.episodeRowIndex)
|
||||||
|
|
||||||
LazyRow(
|
LazyRow(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue