Fixed
Status Update
Comments
cl...@google.com <cl...@google.com>
pa...@gmail.com <pa...@gmail.com> #2
Project: platform/frameworks/support
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
https://android-review.googlesource.com/1360099
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
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit e465976de8f05f0d1db49b4e2887c9f3cd4beab5
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 17 17:07:42 2021
Add OnBackPressedDispatcher observer before NavController observer
If you add a OnBackPressed callback with the NavBackStackEntry as the
lifecycle owner, if the Activity Lifecycle is STOPPED and STARTED again, the navController callback and NavBackStackEntry callback are readded to the Activity Lifecycle in the wrong order. This means that the new callback will not properly intercept onBackPressed() calls from the system, they will instead be intercepted by NavController.
If an OnBackPressedDispatcher is set, we should remove and readd the
NavController observer after we add the callback to the dispatcher.
RelNote: "OnBackPressedCallbacks added to a dispatcher with the
NavBackStackEntry as the LifecycleOwner now properly intercept back
after the Activity Lifecycle is STOPPED, then STARTED"
Test: NavControllerTest
Bug: 182284739
Change-Id: I6acf78848546160eaea7ed700ef8875664a125d0
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
https://android-review.googlesource.com/1643646
Branch: androidx-main
commit e465976de8f05f0d1db49b4e2887c9f3cd4beab5
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 17 17:07:42 2021
Add OnBackPressedDispatcher observer before NavController observer
If you add a OnBackPressed callback with the NavBackStackEntry as the
lifecycle owner, if the Activity Lifecycle is STOPPED and STARTED again, the navController callback and NavBackStackEntry callback are readded to the Activity Lifecycle in the wrong order. This means that the new callback will not properly intercept onBackPressed() calls from the system, they will instead be intercepted by NavController.
If an OnBackPressedDispatcher is set, we should remove and readd the
NavController observer after we add the callback to the dispatcher.
RelNote: "OnBackPressedCallbacks added to a dispatcher with the
NavBackStackEntry as the LifecycleOwner now properly intercept back
after the Activity Lifecycle is STOPPED, then STARTED"
Test: NavControllerTest
Bug: 182284739
Change-Id: I6acf78848546160eaea7ed700ef8875664a125d0
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
jb...@google.com <jb...@google.com> #4
This has been fixed internally and will be part of the Navigation 2.3.5
release (via 2.4.0-alpha01
).
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit f231e0f384f9fd2e7a078bfcbeb7768c82c617b1
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 17 17:40:05 2021
Add BackHandler callback with a LifecycleOwner
We need to ensure that the callback from BackHandler remains in the
proper position in the event of Lifecycle changes.
RelNote: "The BackHandler will now properly intercept back presses in
the event that the Activity is STOPPED, then STARTED again, and other
callbacks were added with a LifecycleOwner."
Test: BackHandlerTest
Bug: 182284739
Change-Id: I71de6184ba73f56b34de9dcddaf138d98c46417f
M activity/activity-compose/build.gradle
M activity/activity-compose/src/androidTest/java/androidx/activity/compose/BackHandlerTest.kt
M activity/activity-compose/src/main/java/androidx/activity/compose/BackHandler.kt
https://android-review.googlesource.com/1644062
Branch: androidx-main
commit f231e0f384f9fd2e7a078bfcbeb7768c82c617b1
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 17 17:40:05 2021
Add BackHandler callback with a LifecycleOwner
We need to ensure that the callback from BackHandler remains in the
proper position in the event of Lifecycle changes.
RelNote: "The BackHandler will now properly intercept back presses in
the event that the Activity is STOPPED, then STARTED again, and other
callbacks were added with a LifecycleOwner."
Test: BackHandlerTest
Bug: 182284739
Change-Id: I71de6184ba73f56b34de9dcddaf138d98c46417f
M activity/activity-compose/build.gradle
M activity/activity-compose/src/androidTest/java/androidx/activity/compose/BackHandlerTest.kt
M activity/activity-compose/src/main/java/androidx/activity/compose/BackHandler.kt
jb...@google.com <jb...@google.com> #6
This has been addressed internally and will be available when using both the Activity 1.3.0-alpha06
and Navigation 2.3.5
releases.
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-main
commit d1d6f89ba90be8e7fba193570b427f52ec98f57a
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 31 09:40:42 2021
Make nav compose depend on Navigation 2.3.5
Upgrading to the latest Navigation version to take advantage of fixed
bugs, (particularly around OnBackPressedDispatcher and lifecycles
b/182284739 ).
RelNote: "Navigation-compose now depends on Navigation version `2.3.5`"
Test: ./gradlew bOS
Change-Id: I7e63b32c93deaee60b1d5e132d3fa255c3ba85e2
M navigation/navigation-compose/build.gradle
https://android-review.googlesource.com/1660640
Branch: androidx-main
commit d1d6f89ba90be8e7fba193570b427f52ec98f57a
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 31 09:40:42 2021
Make nav compose depend on Navigation 2.3.5
Upgrading to the latest Navigation version to take advantage of fixed
bugs, (particularly around OnBackPressedDispatcher and lifecycles
RelNote: "Navigation-compose now depends on Navigation version `2.3.5`"
Test: ./gradlew bOS
Change-Id: I7e63b32c93deaee60b1d5e132d3fa255c3ba85e2
M navigation/navigation-compose/build.gradle
mc...@gmail.com <mc...@gmail.com> #8
does not work for me on '2.4.2'
val navController: NavHostController = rememberNavController()
HomeNavHost(navController = navController)
BackHandler(true) {
// code doesnt get called here
}
val navController: NavHostController = rememberNavController()
HomeNavHost(navController = navController)
BackHandler(true) {
// code doesnt get called here
}
ri...@gmail.com <ri...@gmail.com> #9
I got similar issue, after I run launcher (exp: select document), BackHandler no longer triggers
BackHandler{
action.onBack()
}
BackHandler{
action.onBack()
}
ri...@gmail.com <ri...@gmail.com> #10
to solve BackHandler no longer triggers after i run launcher, i am using this
@Composable
fun BaseBackHandler(onBackHandler: () -> Unit = {}) {
var refreshBackHandler by rememberSaveable { mutableStateOf(false) }
OnLifecycleEvent { _, event ->
when (event) {
Lifecycle.Event.ON_PAUSE -> {
refreshBackHandler = false
}
Lifecycle.Event.ON_RESUME -> {
refreshBackHandler = true
}
else -> {}
}
}
if (refreshBackHandler) {
BackHandler {
onBackHandler()
}
}
}
@Composable
fun BaseBackHandler(onBackHandler: () -> Unit = {}) {
var refreshBackHandler by rememberSaveable { mutableStateOf(false) }
OnLifecycleEvent { _, event ->
when (event) {
Lifecycle.Event.ON_PAUSE -> {
refreshBackHandler = false
}
Lifecycle.Event.ON_RESUME -> {
refreshBackHandler = true
}
else -> {}
}
}
if (refreshBackHandler) {
BackHandler {
onBackHandler()
}
}
}
sb...@doximity.com <sb...@doximity.com> #11
Is there a way to re-open this issue? Still experiencing this on latest version of the navigation library.
il...@google.com <il...@google.com> #12
Re
[Deleted User] <[Deleted User]> #13
I opened a new bug as requested by
Description
Jetpack Compose release version: 1.0.0-beta01
Android Studio Build: #AI-203.7148.57.2031.7185775, built on March 5, 2021
Steps to Reproduce:
Code to reproduce the issue (from attached sample project):