Status Update
Comments
il...@google.com <il...@google.com> #2
Branch: androidx-master-dev
commit c60f33e229e31ab328ef6b59dab63b264954831c
Author: Alexandre Elias <aelias@google.com>
Date: Fri Jul 10 16:23:09 2020
Semantics no-op cleanups
Partly in response to lmr's broad code review, I did a pass of
superficial API/implementation cleanup. The main changes are:
- I changed each Boolean SemanticsProperty where false is equivalent to
not being present to take "Unit" instead. This is conceptually
clearer: it avoids questions like "can I cancel out a semantics from a
merged child by setting it to false?" Because "property = Unit" looks
weird, I also changed the style of these to "property()".
- I moved the Semantics id generator closer to where it's used, in
SemanticsModifierCore. I made it internal and an AtomicInt.
(Note that integer ids are heavily used in the Android
AccessibilityNodeInfo APIs so I can't simply remove them entirely.)
- I deleted dead code. Some examples include SemanticsHintOverrides,
a public API not connected to anything, and SemanticsPropertyKey
merge() open method which is never called. (In both cases I have
a different plan in mind for accessibility.)
Fixes: 145951226
Fixes: 145955412
Test: existing tests
Relnote: "Single-value semantics properties now use a calling style.
For example, 'semantics { hidden = true }' is now written as:
'semantics { hidden() }'."
Change-Id: Ic1afd12ea22c926babc9662f1804d80b33aa0cfc
M ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/LayoutNodeModifierBenchmark.kt
M ui/ui-core/api/0.1.0-dev15.txt
M ui/ui-core/api/current.txt
M ui/ui-core/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-core/api/public_plus_experimental_current.txt
M ui/ui-core/api/restricted_0.1.0-dev15.txt
M ui/ui-core/api/restricted_current.txt
M ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/graphics/vector/VectorTest.kt
M ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/semantics/SemanticsTests.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidActuals.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeView.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeViewAccessibilityDelegateCompat.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidPopup.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Expect.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsConfiguration.kt
D ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsHintOverrides.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsModifier.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsNode.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsOwner.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsWrapper.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/semantics/SemanticsProperties.kt
M ui/ui-foundation/api/0.1.0-dev15.txt
M ui/ui-foundation/api/current.txt
M ui/ui-foundation/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-foundation/api/public_plus_experimental_current.txt
M ui/ui-foundation/api/restricted_0.1.0-dev15.txt
M ui/ui-foundation/api/restricted_current.txt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Clickable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Dialog.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Scroller.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Selectable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Toggleable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/semantics/FoundationSemanticsProperties.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ButtonTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/CardTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxScreenshotTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/RadioButtonScreenshotTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ScaffoldTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/SnackbarTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/SurfaceTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ripple/RippleIndicationTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldScreenshotTest.kt
M ui/ui-material/src/main/java/androidx/ui/material/AppBar.kt
M ui/ui-material/src/main/java/androidx/ui/material/TextFieldImpl.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/AssertsTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/CallSemanticsActionTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/ErrorMessagesTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/FindersTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/PrintToStringTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/ScrollToTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt
M ui/ui-test/src/main/java/androidx/ui/test/Actions.kt
M ui/ui-test/src/main/java/androidx/ui/test/Filters.kt
M ui/ui-text/api/0.1.0-dev15.txt
M ui/ui-text/api/current.txt
M ui/ui-text/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-text/api/public_plus_experimental_current.txt
M ui/ui-text/api/restricted_0.1.0-dev15.txt
M ui/ui-text/api/restricted_current.txt
M ui/ui-text/src/commonMain/kotlin/androidx/ui/text/CoreTextField.kt
M ui/ui-text/src/commonMain/kotlin/androidx/ui/text/TextSemanticsProperties.kt
yu...@gmail.com <yu...@gmail.com> #3
Attaching minimal sample projects & screencasts
il...@google.com <il...@google.com>
m....@futuremind.com <m....@futuremind.com> #4
I'm not sure how it's even possible but it may be helpful in debugging the issue here. After changing alpha04 to alpha05 I have an issue with xml sax parser, reported it here:
co...@protonmail.com <co...@protonmail.com> #5
Just adding that this still exists in alpha06.
ap...@google.com <ap...@google.com> #6
Branch: androidx-main
commit ce0a07e52f9bbc60ff0983101da22d782ddff391
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue Aug 10 17:42:26 2021
Ensure we keep track of all transitioning entries
We currently keep up with all transitioning entries in a set, which
means we can't keep up with multiple entries that are considered "equal"
but actually are different objects.
This currently breaks navigate with popUpTo and transitions since we
will pop first, causing us to consider the old entry as transitioning,
then when we navigate we attempt to add the new entry as transitioning,
but since it is "equal" to the old one, the set just ignores the add.
We need to instead make transitionsInProgress a List, meaning we can
have multiple entries that "equal" each other. This also means we need
to be sure to clear all the "equal" entries from the list whenever one
of them is complete.
Relnote: "Re-selecting the same tab when using navigation compose with
multiple back stacks will no longer result in a blank screen."
Test: added testSameEntry
Bug: 194925622
Change-Id: I860dc9f2cc2516924c03dba491a37aa8ace99bb3
M navigation/navigation-common/api/current.txt
M navigation/navigation-common/api/public_plus_experimental_current.txt
M navigation/navigation-common/api/restricted_current.txt
M navigation/navigation-common/src/main/java/androidx/navigation/NavigatorState.kt
M navigation/navigation-testing/src/androidTest/java/androidx/navigation/testing/TestNavigatorStateTest.kt
M navigation/navigation-testing/src/main/java/androidx/navigation/testing/TestNavigatorState.kt
jb...@google.com <jb...@google.com> #7
This has been fixed internally and will be available in the Navigation 2.4.0-alpha07
release.
You can try this out by following the #7634339
.
yu...@gmail.com <yu...@gmail.com> #8
I don't know if it's related to this, but now my flows collected in compose screens via collectAsState complete early when I reselect already selected home tab. Similarly, it doesn't happen when current screen is root graph's startDestination.
yu...@gmail.com <yu...@gmail.com> #9
So I debugged more using the sample I previously provided and it seems like it's related to this, although it only happens when using flowWithLifecycle as described here:
Attaching the sample that shows the problems and the video.
In sample view model, there is simple flow that emits text in some interval.
In 2.4.0-alpha04 - Collecting flow 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 tab reselection
In Snapshot #7634339:
- Tab reselection doesn't cause empty screens.
- Tab reselection doesn't cause early flow completion when collecting interval flow directly via collectAsState
- Tab reselection does cause early flow completion when collecting interval flow wrapped rememberFlowWithLifecycle (as show in attached video)
ro...@gmail.com <ro...@gmail.com> #10
mi...@gmail.com <mi...@gmail.com> #11
so...@gmail.com <so...@gmail.com> #12
jb...@google.com <jb...@google.com> #13
Please file a new bug with a minimal sample project that reproduces this issue.
mi...@gmail.com <mi...@gmail.com> #14
de...@gmail.com <de...@gmail.com> #15
Additionally, I attached two videos. One using Navigation 2.6.0 shows it is working fine, while the other video using Navigation 2.7.1 shows the strange behavior of a blank flash.
I tested all 2.7.x versions and the 2.8.0 alpha, and it's still happening.
Additionally, in some cases, the transition of the screens is that it enters from the upper right corner to the lower left. This behavior is bizarre and erratic since there is no defined animation, and it happens randomly on the screen. Only when many buttons on the screens are pressed quickly.
Feel free to tag me if there is any advance :(. (I am new here, IDK how this works)
yu...@gmail.com <yu...@gmail.com> #16
ja...@gmail.com <ja...@gmail.com> #17
if (navController.previousBackStackEntry != null) {
navController.popBackStack()
}
ja...@gmail.com <ja...@gmail.com> #18
onClick = {
if (selectedItemIndex != index) {
localNavController.navigate(
route = item.route,
builder = {
launchSingleTop = true
restoreState = true
popUpTo(localNavController.graph.startDestinationId) {
saveState = true
}
}
)
}
}
Description
Component used: Navigation Compose
Version used: androidx.navigation:navigation-compose:2.4.0-alpha05
Devices/Android versions reproduced on: Android 12 beta
Problem: When re-selecting the same tab (i.e clicking already selected tab), the screen becomes empty. It doesn't happen when current destination is the root graph's startDestination.
I first noticed this on my app, then confirmed it by trying it on github.com/chrisbanes/tivi and upgrading nav compose to 2.4.0-alpha05.