Fixed
Status Update
Comments
yu...@gmail.com <yu...@gmail.com> #2
Hi. Thanks for reporting this. Fixed in alpha-04
il...@google.com <il...@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
il...@google.com <il...@google.com> #4
deleted
ap...@google.com <ap...@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
jb...@google.com <jb...@google.com> #6
This has been fixed internally and will be available in the next Navigation release.
yu...@gmail.com <yu...@gmail.com> #7
That's great! Is there Snapshot build number I can try before the release to test/use it?
yu...@gmail.com <yu...@gmail.com> #8
Looks like
yu...@gmail.com <yu...@gmail.com> #9
I tried build #7796270 and looks like the bug is gone. Thanks!
Description
Component used: Navigation Version used: Snapshot #7634339 or 2.4.0-alpha07 Devices/Android versions reproduced on: Pixel 4a
This issue is related to another fixed issue: https://issuetracker.google.com/issues/194925622
2.4.0-alpha05 introduced a bug where tab reselection causes empty screens, unless the current screen is the
startDestination
of the root graph.The issue was fixed in Snapshot #7634339 , but it introduced another bug:
Flows collected in compose screens via
rememberFlowWithLifecycle(flow).collectAsState(initial)
complete early on tab reselection, like in the original issue. AboutrememberFlowWithLifecycle
Attaching the minimal sample that shows the problem and a video.
In sample view model, there is a simple flow that emits text in some interval.
In 2.4.0-alpha04 - Collecting flows directly via collectAsState or via rememberFlowWithLifecycle works as expected (interval Flow doesn't complete until the user leaves the screen)
In 2.4.0-alpha05-06 - Screen becomes empty on tab reselection
In Snapshot #7634339 / 2.4.0-alpha07:
rememberFlowWithLifecycle