Status Update
Comments
si...@gmail.com <si...@gmail.com> #2
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
aa...@yandex-team.ru <aa...@yandex-team.ru> #3
si...@gmail.com <si...@gmail.com> #4
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically (
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
si...@gmail.com <si...@gmail.com> #5
In 1.6.0-beta01 testTag() no longer prunes semantics nodes, but pruning still occurs on other unimportant semantics properties, such as isTraversalGroup/traversalIndex. See attached video for visual cue
si...@gmail.com <si...@gmail.com> #6
Also there's new code:
@OptIn(ExperimentalMaterialApi::class)
@Composable
fun MyScreen2() {
Box {
var value by remember { mutableStateOf(Value.None) }
LazyColumn(Modifier.background(Color(0xFFEEEEEE))) {
item {
Spacer(
Modifier
.height(200.dp)
.fillMaxWidth()
)
}
items(50) {
ListItem(
Modifier
.fillMaxWidth()
.then(if (it == 0) Modifier.height(100.dp) else Modifier)
.clickable { }) {
Text("Item #${it + 1}")
}
}
}
Box(
modifier = Modifier
.fillMaxWidth()
.height(120.dp)
.background(MaterialTheme.colors.surface.copy(alpha = 0.9f))
.then(when (value) {
Value.None -> Modifier
Value.TestTag -> Modifier.testTag("tag")
Value.TraversalGroup -> Modifier.semantics { isTraversalGroup = true }
})
) {
Text("Screen title: 1.6.0-beta01", Modifier.align(Alignment.Center), fontWeight = FontWeight.Bold)
}
Column(
modifier = Modifier
.align(Alignment.BottomEnd)
.selectableGroup()
.background(Color.Black.copy(0.1f))
.padding(16.dp)
) {
Spacer(Modifier.height(4.dp))
for (enum in Value.entries) {
Row(
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.sizeIn(48.dp, 48.dp)
.clickable { value = enum }
) {
RadioButton(
selected = value == enum,
onClick = null,
)
Text(
when (enum) {
Value.None -> "None"
Value.TestTag -> "TestTag"
Value.TraversalGroup -> "TraversalGroup"
}
)
}
}
}
}
}
ae...@google.com <ae...@google.com> #7
Thanks for the update and for filing the bug originally. Indeed testTag
.
The full list of built-in properties that do not cause pruning is those that are defined as plain SemanticsPropertyKey
instead of AccessibilityKey
in testTag
, testTagsAsResourceId
, invisibleToUser
, textSubstitution
, isShowingTextSubstitution
, indexForKey
and editable
.
Re: traversalGroup
, making it continue to cause prune is by design.
- First on the general principle that it is an accessibility-related property and all of the others cause pruning too.
- Also because
traversalGroup
is the only semantics property on non-clickable Material Surfaces. And as described in point 3 of , these are designed to block touch input, and if elements underneath them cannot be reached by touch, then for consistency they should not be reachable by TalkBack linear traversal either.aosp/1660323
Re: traversalIndex
there is more flexibility: the only rationale for that one was the general principle but I'm guessing it would probably not break any behavior to switch it to a plain SemanticsPropertyKey
.
Anyway, either way to consider a further change, I would like to hear more about the real-life use case motivating the question. What is the scenario where you must use traversalGroup
to solve one problem but at the same the pruning causes an different problem? (And I would be more likely to consider a change in Compose if I'm convinced there's no reasonable workaround on the app side.)
aa...@yandex-team.ru <aa...@yandex-team.ru> #8
I tried on
As for Material Surface, if the change for IsTraversalGroup and TraversalIndex is to be implemented, you can add another semantics property to it, that will cause pruning. Perhaps IsContainer is a good candidate for such semantics property, it will work the same as IsTraversalGroup, but will also prune.
Here two videos: TraversalFalse demonstrates, that no pruning occurs, but traversal order is broken; and TraversalTrue demonstrates, that traversal order is good, but unwanted pruning occurs.
ap...@google.com <ap...@google.com> #9
Branch: androidx-main
commit c143a80f296dec3193417b9f839dfbb63896a753
Author: Alexandre Elias <aelias@google.com>
Date: Thu Nov 23 02:34:19 2023
A11y importance, visibility and pruning improvements
1. Make isTraversalGroup and traversalIndex no longer be marked
AccessibilityKey (that is, no longer be important nor prune nodes
under them, if they are the only semantics on a node).
2. Make hittesting and pruning algorithm consistent with each other: now
they both skip over unimportant and invisible nodes (previously,
hittesting only skipped invisible and pruning only skipped
unimportant).
- Likewise improve consistency by making screenReaderFocusable
take visibility into account (although it still retains a
distinct concept of "speaking" as a substitute for importance).
Also includes the following API additions, which help implement the
above without breaking any behavior:
- New property isOpaque, so that nonclickable Material Surfaces can
continue to prune even if they have no other semantics than
isContainer on them.
- New experimental SemanticsPropertyReceiver.unset to remove individual
properties, which is needed for 'isContainer = false' to avoid the
side effect of pruning, and is an overdue feature that should help
avoid overuse of clearAndSetSemantics.
Bug: 317966058
Bug: 246056649
Test: 7 new tests
Relnote: "New semantics API unset() to remove semantics properties that
are added in the same modifier chain. New semantics property isOpaque."
Change-Id: I8c583e571956d1501f4df7312a4c60edae0a1bc0
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/AndroidAccessibilityTest.kt
M compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/semantics/SemanticsTests.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/SemanticsUtils.android.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsConfiguration.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsProperties.kt
ae...@google.com <ae...@google.com> #10
testTag
no longer causes pruning in Compose 1.6, and traversalGroup/traversalIndex
will no longer cause pruning in Compose 1.7 (due this summer).
so...@google.com <so...@google.com>
ap...@google.com <ap...@google.com> #11
Branch: androidx-main
commit 55fb1224271bff2cda62b0fed18d8e95e667014f
Author: Melba Nuzen <mnuzen@google.com>
Date: Tue Jun 11 11:35:38 2024
Mark `isTraversalGroup` and `traversalIndex` as SemanticsPropertyKey
`isTraversalGroup` and `traversalIndex` are now SemanticsPropertyKeys instead of AccessibilityKey. This means they are no longer marked as important for a11y nor prune nodes under them, if they are the only semantics on a node.
Prior to this CL, `isContainer`'s underlying implementation called on `isTraversalGroup`. Changing `isTraversalGroup` changes `isContainer`'s too. To maintain the existing behavior of non-clickable Material surfaces that use `isContainer`, `isContainer` no longer uses `isTraversalGroup` for underlying implementation and is instead an AccessibilityKey.
Test: testSortedAccessibilityNodeInfo_traversalGroupClipping, isContainerProperty_unmergedConfig, and others. Also verified manually that TalkBack no longer clips inside lazy list.
Bug: 246056649
Bug: 335726351
Change-Id: I94ca844ced750c40bd9d0c4f0b17b1c40cf4dfe0
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/DatePicker.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Surface.kt
M compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/AndroidAccessibilityTest.kt
M compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/semantics/SemanticsTests.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsProperties.kt
mn...@google.com <mn...@google.com> #12
isTraversalGroup/traversalIndex
no longer prune again with a
Description
Jetpack Compose version: 1.3.0-beta01
Adding
Modifier.testTag()
to some element causes it to clip accessibility nodes underneath such element and making these nodes undiscoverable by accessibility service.In the attached video you can see, that when
testTag()
is not applied, everything works as expected - Item#1 isn't clipped, and navigation works correctly - when navigating from Item#16 forward, LazyColumn scrolls down one screen height and Item#17 becomes selected, then when navigating backwards LazyColumn scrolls up and Item#16 becomes selected. But whentestTag()
is applied to "top bar", Item#1 starts to clip, and also navigation breaks - when navigating from Item#16 forward, LazyColumn scrolls and Item#33 becomes selected (because Item#17 becomes clipped), and other way is the same - when navigating from Item#19 backwards, Item#2 becomes selected.