mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
Fix two home row focus bugs (#1376)
## Description 1. Fixes when moving from nav drawer to home page content, focus would sometimes move up a row 2. Fixes when moving up/down between rows, focus would sometimes move to the later card (usually the last visible) The second above is fixed by downgrading `tv-material` to `1.0.1-alpha01`. Switching to [`1.0.1-beta01`](https://developer.android.com/jetpack/androidx/releases/tv#tv-material-1.1.0-beta01) or newer causes the bug. Not clear if its a bug in the library or Wholphin though. ### Related issues Fixes #1359 ### Testing Emulator ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
4928c1156d
commit
8b9b0ddec8
2 changed files with 11 additions and 2 deletions
|
|
@ -31,6 +31,7 @@ import androidx.compose.runtime.setValue
|
|||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.focus.FocusRequester
|
||||
import androidx.compose.ui.focus.focusProperties
|
||||
import androidx.compose.ui.focus.focusRequester
|
||||
import androidx.compose.ui.focus.focusRestorer
|
||||
import androidx.compose.ui.focus.onFocusChanged
|
||||
|
|
@ -307,7 +308,15 @@ fun HomePageContent(
|
|||
focusedItem?.let { onUpdateBackdrop.invoke(it) }
|
||||
}
|
||||
Box(modifier = modifier) {
|
||||
Column(modifier = Modifier.fillMaxSize()) {
|
||||
Column(
|
||||
modifier =
|
||||
Modifier
|
||||
.focusProperties {
|
||||
onEnter = {
|
||||
rowFocusRequesters.getOrNull(currentPosition.row)?.tryRequestFocus()
|
||||
}
|
||||
}.fillMaxSize(),
|
||||
) {
|
||||
headerComposable.invoke(focusedItem)
|
||||
|
||||
val density = LocalDensity.current
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue