Fixed
Status Update
Comments
ra...@google.com <ra...@google.com>
my...@globallogic.com <my...@globallogic.com> #2
Hi. Thanks for reporting this. Fixed in alpha-04
vi...@google.com <vi...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit e782987543a9f8ccd485e970ddc74564b24378db
Author: Vighnesh Raut <vighnesh.raut13@gmail.com>
Date: Mon Jan 02 15:27:40 2023
fix: tab row crashes when only 1 tab is added
Bug: b/264018028
Test: Added unit test
Change-Id: I6381dbac304fc1d69d3708c6655f8b595668e93f
M tv/tv-material/src/androidTest/java/androidx/tv/material/TabRowTest.kt
M tv/tv-material/src/main/java/androidx/tv/material/TabRow.kt
https://android-review.googlesource.com/2373449
Branch: androidx-main
commit e782987543a9f8ccd485e970ddc74564b24378db
Author: Vighnesh Raut <vighnesh.raut13@gmail.com>
Date: Mon Jan 02 15:27:40 2023
fix: tab row crashes when only 1 tab is added
Bug:
Test: Added unit test
Change-Id: I6381dbac304fc1d69d3708c6655f8b595668e93f
M tv/tv-material/src/androidTest/java/androidx/tv/material/TabRowTest.kt
M tv/tv-material/src/main/java/androidx/tv/material/TabRow.kt
ap...@google.com <ap...@google.com> #4
deleted
ma...@gmail.com <ma...@gmail.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.tv:tv-material:1.0.0-alpha04
rv...@google.com <rv...@google.com> #6
I think this has already been fixed. If you still reproduce this issue using lazy layouts from compose.foundation
(tv lazy layouts have been deprecated and removed), feel free to re-open the ticket.
Description
Steps to reduce:
- Go from one route to another, while having an element focused
- Go back to the initial route
Actual behaviour - the focus is lost
Expected behaviour - the focus should be present
TvLazyRow was used as a demonstration, but the same bug is reproduced while using other components.
NB: The expected behaviour is present in components of Leanback library.
Additional notes on behaviour - If you use a sample project I attach you can observe, that position in the list is retained correctly, but the focus is lost. When you try to press LEFT/RIGHT button, the focus will be moved to a wrong item.
Example: Select element 2, press Enter, go back, press left -> the element 4 is selected.
Example: Select element 2, press Enter, go back, press right -> the element 1 is selected
Example: Select element 2, press Enter, go back, press Enter -> the element 1 is selected and navigation is triggered.
The issue is not device/android version specific.
While it is possible to implement saving/restoring focus on your own, it would be nice to have this this as an out the box feature, since custom solution complexity can significantly increase with complexity of a screen