Status Update
Comments
mo...@google.com <mo...@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
va...@google.com <va...@google.com> #3
isVisible
would just be the exposed value from WindowInsetsCompat.isVisible
:
Here is where it is set in accompanist/insets:
And yes, checking if the insets are 0 should be pretty much equivalent, but WindowInsetsCompat.isVisible
has the full backported behavior for the different types.
mo...@google.com <mo...@google.com> #4
I'm going to wait on shared element transitions work to be done before exploring the animation APIs. I think we're going to want to treat the animations completely differently.
I can add an isVisible
function. I can see that as being convenient.
ap...@google.com <ap...@google.com> #5
Branch: androidx-main
commit 9ad715087ea11e0d321c1da32cc2a62e8003a161
Author: George Mount <mount@google.com>
Date: Mon Mar 21 10:15:11 2022
Add window insets visibility
Bug: 217770337
Relnote: "WindowInsets companion now exposes the visibility
(whether they are on the screen, regardless of
whether thy intersect with the window), and the
size they could be if they are available on the device,
but not currently active."
Test: new tests for R+
Change-Id: I65182e3c8cdc868b9f6de3aef403c9f4d5074711
A compose/foundation/foundation-layout/src/androidAndroidTest/kotlin/androidx/compose/foundation/layout/WindowInsetsIgnoringVisibilityTest.kt
M compose/foundation/foundation-layout/api/public_plus_experimental_current.txt
M compose/foundation/foundation-layout/src/androidMain/kotlin/androidx/compose/foundation/layout/WindowInsets.android.kt
lu...@gmail.com <lu...@gmail.com> #6
Is there any temporary solution for a isVisible
function? Or should I wait for the issue to be fixed before I migrate Insets Accompanist to the Compose foundation insets?
va...@google.com <va...@google.com> #7
The isVisible
portion has been merged but didn't make it into 1.2.0-alpha07
that was just released.
If you'd like, you should be able to use isVisible
with one of the most recent androidx snapshots until it is released normally.
re...@gmail.com <re...@gmail.com> #8
In terms of temporary workaround, try this code:
val WindowInsets.Companion.isImeVisible: Boolean
@Composable
get() {
val density = LocalDensity.current
val ime = this.ime
return remember {
derivedStateOf {
ime.getBottom(density) > 0
}
}.value
}
Source:
ry...@educast.com <ry...@educast.com> #9
mo...@google.com <mo...@google.com> #10
LookaheadLayout
is now available, but isn't complete. SubcomposeLayout
implementations for BoxWithConstraints
and LazyColumn
/LazyRow
are yet to be done.
When those complete, I expect to make the look-ahead work with WindowInsets. You'll be able to see the target position of the IME, for example, and then customize your animation for it.
da...@gmail.com <da...@gmail.com> #11
Nice, thanks for the update. Where can we see the work in progress?
Please keep us updated!!
Nice work!
mo...@google.com <mo...@google.com> #12
Alex suggested a different solution that will work well. I can provide the source and target IME WindowInsets and you can use it to determine where the IME will be and the progress (combined with the current IME insets).
mo...@google.com <mo...@google.com>
ap...@google.com <ap...@google.com> #14
Branch: androidx-main
commit 977d53a595ad75ee1693140c84c052cc60bce305
Author: George Mount <mount@google.com>
Date: Fri Aug 26 14:58:13 2022
Added WindowInsets IME animation source and target
Fixes: 217770337
Relnote: "Added WindowInsets.imeAnimationSource and
WindowInsets.imeAnimationTarget to determine the
animation progress and know where the IME will be
after animation completes."
Test: new tests, manual
Change-Id: I356f1bac4ac4ff311573eb8df7227098b9186c20
M compose/foundation/foundation-layout/src/androidAndroidTest/kotlin/androidx/compose/foundation/layout/WindowInsetsActivity.kt
M compose/foundation/foundation-layout/src/androidAndroidTest/AndroidManifest.xml
A compose/foundation/foundation-layout/src/androidAndroidTest/kotlin/androidx/compose/foundation/layout/WindowInsetsAnimationTest.kt
M compose/foundation/foundation-layout/api/public_plus_experimental_current.txt
M compose/foundation/foundation-layout/src/androidMain/kotlin/androidx/compose/foundation/layout/WindowInsets.android.kt
na...@google.com <na...@google.com> #15
The following release(s) address this bug:
androidx.compose.foundation:foundation-layout:1.4.0-alpha01
Description
accompanist/insets provides a few additional pieces of information about each type of insets, other than just the current size.
These include:
isVisible
- if a type of insets are currently visible (especially useful for IME)animationInProgress
- whether that type of insets are currently being animatedanimationFraction
- the current fraction of animation (useful for running with another animation)layoutInsets
/animatedInsets
- contains the last normally applied insets, and the currently animated insets, respectively. (useful for informing external animations)