Fixed
Status Update
Comments
lp...@google.com <lp...@google.com> #2
Hi. Thanks for reporting this. Fixed in alpha-04
nj...@google.com <nj...@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
na...@google.com <na...@google.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
Description
See: b/336270922
Currently Modifier.drawWithCache queries the current density and layout direction from
DelegatableNode#requireDensity
andDelegatableNode#requireLayoutDirection
. However, LayoutNode currently does not broadcast changes back to the modifier chain whenever the density or layout direction change. That leads to issues where Modifier.drawWithCache does not update based on the latest density/layout direction that was available.There is already prior art that special cases PointerInput modifiers to receive updates to density/layoutdirection changes and the fix for b/336270922 does the same for Modifier.drawWithCache. This is because at the time b/336270922 was addressed, API changes to add APIs to DelegatableNode are disallowed. So introduce a stopgap solution to fix the bug now and introduce a more holistic solution going forward.
Discussions with the wider team in the Modifier task force group lead to consensus that introducinghttps://chat.google.com/room/AAAAbSAVMlo/m_-HpV0vl1o
DelegateableNode#onLayoutDirectionChanged
andDelegatabelNode#onDensityChanged
would be a preferable longer term solution. See: