Status Update
Comments
ja...@google.com <ja...@google.com>
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
il...@google.com <il...@google.com>
il...@google.com <il...@google.com> #4
Yep, you're right. Looks like the root cause of this separate issue was already fixed by 1.3.0
version would pull in the fix.
That fix is part of a 1.2.X
release, unfortunately.
I'll leave this open while we investigate what that would take.
th...@outlook.com <th...@outlook.com> #5
My apologies for not trying the latest alpha release beforehand. Upgrading to version 1.3.0
solves my case. Thank you for pointing that out.
th...@outlook.com <th...@outlook.com> #6
When using fragment-ktx:1.3.0-alpha03
, I'm still able to reproduce this issue. The following crash occurs on a configuration change:
java.lang.IllegalStateException: Fragment androidx.fragment.app.Fragment$4@5ff632e does not have a view
at androidx.fragment.app.Fragment$4.onFindViewById(Fragment.java:2711)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:464)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1170)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1316)
at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1394)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1460)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2695)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2644)
at androidx.fragment.app.Fragment.performActivityCreated(Fragment.java:2784)
at androidx.fragment.app.FragmentStateManager.activityCreated(FragmentStateManager.java:507)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1171)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1316)
at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1394)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1460)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2695)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2644)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:251)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:546)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:201)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1392)
at android.app.Activity.performStart(Activity.java:7172)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:2967)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6854)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:860)
il...@google.com <il...@google.com> #7
Thanks, this looks like an issue with DialogFragment
so fixing that underlying issue should fix PreferenceDialogFragmentCompat
as well.
ap...@google.com <ap...@google.com> #8
Branch: androidx-master-dev
commit 3c698888435fee8af2d911e54d1b9df9fd46648c
Author: Ian Lake <ilake@google.com>
Date: Tue Apr 21 16:46:50 2020
Fix onFindViewById in DialogFragment
Instead of only considering the Fragment's view,
DialogFragment should also consider the Dialog's
view when calling onFindViewById(). This ensures
that any <fragment> or FragmentContainerView that
is created as part of the Dialog's view structure
will properly be reattached to its view hierarchy
after a configuration change.
Test: updated DialogFragmentInflatedChildTest tests pass
BUG: 154366601
Change-Id: I59ada3193974f00ab4df475d992e237baa03c5bf
M fragment/fragment/src/androidTest/java/androidx/fragment/app/DialogFragmentInflatedChildTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/DialogFragment.java
M fragment/fragment/src/main/java/androidx/fragment/app/Fragment.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentStateManager.java
il...@google.com <il...@google.com> #9
This has been fixed internally and will be available in Fragment 1.3.0-alpha04.
You can confirm the fix in your project by following the snapshot instructions at buildId
of 6419956
and Fragment 1.3.0-SNAPSHOT
.
th...@outlook.com <th...@outlook.com> #10
That was quick! It works as expected now. Much appreciated
Description
I have a
PreferenceScreen
with aDialogPreference
that opens aPreferenceDialogFragmentCompat
when there is being clicked on. TheDialogPreference
has a custom dialogLayoutResource in which I set a newPreferenceFragmentCompat
through xml using the<FragmentContainerView/>
tag. On clicking theDialogPreference
, the crash posted below occurs.This crash does not occur when commenting out
<FragmentContainerView/>
I was able to workaround this issue by using the following code in
PreferenceDialogFragmentCompat
:A sample project demonstrating the isue can be found here