Fixed
Status Update
Comments
yi...@google.com <yi...@google.com> #2
Hi. Thanks for reporting this. Fixed in alpha-04
so...@google.com <so...@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
cl...@google.com <cl...@google.com> #4
deleted
ma...@google.com <ma...@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
ma...@google.com <ma...@google.com> #6
Copy paste from
yi...@google.com <yi...@google.com> #7
The default in native android is
/** Selection mode where items are not selectable. */
public static final int SELECTION_MODE_NONE = 0;
CollectionItemInfo in android has a parameter called selected (view.java also has a selected property, and is translated to AccessibilityNodeInfo.selected). In Compose, we also have a selected property, which is used for radio button and tab (in native android, radio button uses checked property, and tab uses selected property). And I believe in talkback/switch access, CollectionItemInfo.selected is never used.
As you can see, there seems to be a chaos here for selected/checked/toggleable/collectionItemInfo.selected. In compose, we plan not to add the collectionItemInfo.selected property and use semantics selected instead. What if a developer sets selection mode to be none (default) and also set selected property in the items?
/** Selection mode where items are not selectable. */
public static final int SELECTION_MODE_NONE = 0;
CollectionItemInfo in android has a parameter called selected (view.java also has a selected property, and is translated to AccessibilityNodeInfo.selected). In Compose, we also have a selected property, which is used for radio button and tab (in native android, radio button uses checked property, and tab uses selected property). And I believe in talkback/switch access, CollectionItemInfo.selected is never used.
As you can see, there seems to be a chaos here for selected/checked/toggleable/collectionItemInfo.selected. In compose, we plan not to add the collectionItemInfo.selected property and use semantics selected instead. What if a developer sets selection mode to be none (default) and also set selected property in the items?
ap...@google.com <ap...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-main
commit 8dddaeb8d6af1e2c6ae4518376132d8c00d3cf97
Author: Anastasia Soboleva <soboleva@google.com>
Date: Wed Apr 07 16:17:46 2021
Add Collection(Item)Info semantics API
Any lazy list by default will report "-1" as the number of elements because we can't calculate correctly the number of elements that should be reported for a11y.
When `Modifier.selectableGroup()` is used with lazy lists, we won't report anymore only visible elements on the screen.
Test: new tests, manually with Talkback on
Bug: 180479017
Relnote: "Added CollectionInfo and CollectionItemInfo accessibility APIs that allows to mark collection and its items for accessibility services"
Change-Id: Id54ef37379e14e41ac52782b40e29de54f95eed0
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyList.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/selection/SelectableGroup.kt
M compose/material/material/integration-tests/material-demos/src/main/java/androidx/compose/material/demos/BottomNavigationDemo.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TabRow.kt
M compose/ui/ui/api/1.0.0-beta06.txt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_1.0.0-beta06.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_1.0.0-beta06.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/AndroidComposeViewAccessibilityDelegateCompatTest.kt
A compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/accessibility/CollectionInfoTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt
A compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/accessibility/CollectionInfo.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsProperties.kt
https://android-review.googlesource.com/1667155
Branch: androidx-main
commit 8dddaeb8d6af1e2c6ae4518376132d8c00d3cf97
Author: Anastasia Soboleva <soboleva@google.com>
Date: Wed Apr 07 16:17:46 2021
Add Collection(Item)Info semantics API
Any lazy list by default will report "-1" as the number of elements because we can't calculate correctly the number of elements that should be reported for a11y.
When `Modifier.selectableGroup()` is used with lazy lists, we won't report anymore only visible elements on the screen.
Test: new tests, manually with Talkback on
Bug: 180479017
Relnote: "Added CollectionInfo and CollectionItemInfo accessibility APIs that allows to mark collection and its items for accessibility services"
Change-Id: Id54ef37379e14e41ac52782b40e29de54f95eed0
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyList.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/selection/SelectableGroup.kt
M compose/material/material/integration-tests/material-demos/src/main/java/androidx/compose/material/demos/BottomNavigationDemo.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TabRow.kt
M compose/ui/ui/api/1.0.0-beta06.txt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_1.0.0-beta06.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_1.0.0-beta06.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/AndroidComposeViewAccessibilityDelegateCompatTest.kt
A compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/accessibility/CollectionInfoTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt
A compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/accessibility/CollectionInfo.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsProperties.kt
Description
We have a
selectableGroup
modifier for non-lazy lists which iterates through all the 'selectable' nodes to get the indices and number of elements (to setCollectionInfo
andCollectionItemInfo
). Obviously, this does not play well with lazy lists as it only reports the number of visible elements.We need to figure out what it the right approach/API for lazy lists.