android / android/tv-samples

Immersive list doesn't scroll to the top of the screen when expending

Open
#172 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
1.3k
Forks
396
PR merge metrics
No merged PRs in 30d

Description

When utilizing the immersive list component on Android TV, the row expands upon selection. However, it fails to scroll to the top of the screen, resulting in the ImmersiveListScope occupying only half of the screen.

use library: implementation "androidx.tv:tv-material:1.0.0-beta01"

```
ImmersiveList(
selectedMovie = selectedMovie,
isListFocused = isListFocused,
movieList = movieList,
sectionTitle = title,
onMovieClick = onMovieClick,
parentItem = parentItem,
onViewMoreClick = onViewMoreClick,
onMovieFocused = {
selectedMovie = it
},
onFocusChanged = {
isListFocused = it.hasFocus
},
modifier = modifier.bringIntoViewIfChildrenAreFocused(
PaddingValues(bottom = 80.dp)
)
)
```

![Screenshot_20240522_161144](https://github.com/android/tv-samples/assets/154320838/2ee8c06e-2cbd-4278-8e2a-05c44224b3c2)

Contributor guide

Open the contributing guide

Research direction

Start by locating the sample screen that uses ImmersiveList and reproduce the expansion with androidx.tv:tv-material:1.0.0-beta01 on Android TV. Inspect the interaction between bringIntoViewIfChildrenAreFocused and the expanding row. Done means selecting a row scrolls the ImmersiveListScope to the top instead of leaving it half-screen.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.