[TV] Add Leanback-to-Compose TV migration snippets#994
Conversation
|
Here is the summary of changes. You are about to add 5 region tags.
This comment is generated by snippet-bot.
|
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
chikoski
left a comment
There was a problem hiding this comment.
I quickly reviewed the snippets and left some comments. Please take a look.
Overall, the snippets seems slightly long, which might make it difficult for developers to digest. To make it easier to read, I'd suggest to focus on the essential part, such as how to coordinate list item selection and background image update for the immersive list snippet.
Key event handling and updating the visibility of playback controls in the video player screen might be a bit out of scope here, or could be omitted to keep the focus clear.
| } | ||
| } | ||
|
|
||
| categories.entries.forEachIndexed { catIndex, (categoryName, videos) -> |
There was a problem hiding this comment.
itemsIndexed could simplify the code as follows;
itemsIndex(categories) { index, (categoryName, videos) ->
// snip
}| modifier: Modifier = Modifier | ||
| ) { | ||
| val context = LocalContext.current | ||
| val exoPlayer = remember { ExoPlayer.Builder(context).build() } |
There was a problem hiding this comment.
Proposing to update the exoPlayer value when active context is updated:
val exoPlayer = remember(context) {
// snip;
}| focusRequester.requestFocus() | ||
| scheduleAutoHide() | ||
|
|
||
| val listener = object : Player.Listener { |
There was a problem hiding this comment.
I am wondering if the ExoPlayer object adds new listener every time the user chooses new video to play. I'd suggest to add DisposableEffect and move the code creating and setting lister object outside of the LaunchedEffect to it.
No description provided.