Status Update
Comments
an...@tomorrow.one <an...@tomorrow.one> #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
le...@google.com <le...@google.com>
le...@google.com <le...@google.com>
le...@google.com <le...@google.com>
va...@gmail.com <va...@gmail.com> #3
Still reproducible on compose 1.7.0-alpha01
Brand:Samsung
Model:Galaxy S21 Ultra 5G
Orientation: Landscape
Logs show weird behavior - the user opened a page with the pager while that same page was open. Seems that this happens on configuration change from portrait to landscape. Looks like a race in measuring pager content and the pager itself.
Stacktrace is virtually the same as the OPs.
Requesting this to be prioritized as Google Play Vitals blames us for this significant amount of crashes. Happens for about 1.5% of users regularly.
fe...@gmail.com <fe...@gmail.com> #4
Same for compose compiler 1.5.11
Fatal Exception: java.lang.IllegalArgumentException maxWidth(-90) must be >= than minWidth(0)
at androidx.compose.ui.unit.ConstraintsKt.Constraints(Constraints.kt:424)
at androidx.compose.ui.unit.ConstraintsKt.Constraints$default(Constraints.kt:418)
jo...@google.com <jo...@google.com>
ap...@google.com <ap...@google.com> #5
Branch: androidx-main
commit 51900c870dcafca33f1dfddf9ecd4e711d36e914
Author: Jossi Wolf <jossiwolf@google.com>
Date: Tue May 07 17:39:14 2024
Coerce Pager's page size to min 0
In some cases, we could previously end up with a negative size returned from PageSize. There were two scenarios:
- Custom PageSize implementation returning a negative value
- PageSize.Fill (the default size) returning the incoming value, which could be negative if the content padding is bigger than the constraints' main axis space
Relnote: Fixed a bug where Pager would crash when the contentPadding was bigger than the incoming constraints. Pager now coerces negative values returned from PageSize to 0.
Test: contentPadding_largerThanConstraints_measuresAsZero, pageSize_smallerThanAvailableSpace_measuresAsZero
Bug: 314008560
Change-Id: Iba5d8eccddaf1a49bb09dc4f93d8a4f38276d60b
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/pager/PagerTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/pager/PagerMeasurePolicy.kt
jo...@google.com <jo...@google.com>
ra...@inmobi.com <ra...@inmobi.com> #6
jo...@google.com <jo...@google.com> #7
This fix is included in tip of tree, you can try it out by using a snapshot build (androidx.dev). We have an automated integration that will add a comment once this change has been included in a release.
pr...@google.com <pr...@google.com> #8
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.7.0-beta01
androidx.compose.foundation:foundation-android:1.7.0-beta01
androidx.compose.foundation:foundation-desktop:1.7.0-beta01
wi...@kakaomobility.com <wi...@kakaomobility.com> #9
I'm using compose 1.6.3 and I got crash when update content padding to lager value. ex) Portrait -> Landscape.
To workaround this problem, I updated pager before adjusting the content padding. It seems worthless, but worked well.
val contentPadding = remember { mutableStateOf(10000.dp) }
val newContentPadding = calcPadding()
val scope = rememberCoroutineScope()
if (newContentPadding <= contentPadding.value) { // smaller padding : no problem
contentPadding.value = newContentPadding
} else { // larger padding : crash!
scope.launch {
pagerState.scrollToPage(pagerState.currentPage) // update pager
contentPadding.value = newContentPadding // then update padding
}
}
ga...@gmail.com <ga...@gmail.com> #10
We're still seeing high volumes of this in 1.7.0
fi...@gmail.com <fi...@gmail.com> #11
I encountered similar exception on Nothing Phone (1) @ API 34 with ComposeView inside CardView. Opens normally, then 100% reproducible when switching day/night mode, probably other layout recreations will do. Didn't crash tho on neither of AVD Pixel API 35, redmi 10 API 31, samsung a70 api 30.
For me WORKAROUND was to add android:layout_marginTop="0dp"
to ComposeView, I hope it'll help someone.
My xml: ConstraintLayout(root) > LinearLayout(wrap_content) > CardView(wrap_content) > ComposeView(wrap_content)
Sorry if that does not make sense lol, but works as expected with various non-compose children. I thought it might be relevant since ConstraintLayout is also present.
kotlin = "2.0.21"
appcompat = "1.7.0"
activityCompose = "1.9.3"
composeBom = "2024.10.00"
java.lang.IllegalArgumentException: maxWidth(-252) must be >= than minWidth(0)
at androidx.compose.ui.unit.InlineClassHelperKt.throwIllegalArgumentException(InlineClassHelper.kt:30)
at androidx.compose.ui.unit.ConstraintsKt.Constraints(Constraints.kt:721)
at androidx.compose.ui.unit.ConstraintsKt.Constraints$default(Constraints.kt:543)
at androidx.compose.ui.node.NodeMeasuringIntrinsics.minHeight$ui_release(LayoutModifierNode.kt:297)
at androidx.compose.ui.node.LayoutModifierNode.minIntrinsicHeight(LayoutModifierNode.kt:95)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.minIntrinsicHeight(LayoutModifierNodeCoordinator.kt:220)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.minIntrinsicHeight(LayoutNodeLayoutDelegate.kt:912)
at androidx.compose.material3.ListItemMeasurePolicy.measure-3p2s80s(ListItem.kt:234)
at androidx.compose.ui.layout.MultiContentMeasurePolicyImpl.measure-3p2s80s(MultiContentMeasurePolicy.kt:209)
at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(InnerNodeCoordinator.kt:135)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(LayoutNodeLayoutDelegate.kt:316)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(LayoutNodeLayoutDelegate.kt:315)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:503)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:502)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:258)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:133)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeMeasureSnapshotReads$ui_release(OwnerSnapshotObserver.kt:113)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate.performMeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:1782)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate.access$performMeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:40)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.remeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:696)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.measure-BRTryo0(LayoutNodeLayoutDelegate.kt:672)
at androidx.compose.foundation.layout.BoxMeasurePolicy.measure-3p2s80s(Box.kt:151)
at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(InnerNodeCoordinator.kt:135)
at androidx.compose.ui.graphics.SimpleGraphicsLayerModifier.measure-3p2s80s(GraphicsLayerModifier.kt:646)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(LayoutModifierNodeCoordinator.kt:188)
at androidx.compose.animation.SizeAnimationModifierNode.measure-3p2s80s(AnimationModifier.kt:195)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(LayoutModifierNodeCoordinator.kt:188)
at androidx.compose.ui.graphics.SimpleGraphicsLayerModifier.measure-3p2s80s(GraphicsLayerModifier.kt:646)
at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(LayoutModifierNodeCoordinator.kt:188)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(LayoutNodeLayoutDelegate.kt:316)
at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(LayoutNodeLayoutDelegate.kt:315)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:503)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:502)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:258)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:133)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeMeasureSnapshotReads$ui_release(OwnerSnapshotObserver.kt:113)
jo...@google.com <jo...@google.com> #12
Hi, can you please share a reproduction case with us?
fi...@gmail.com <fi...@gmail.com> #13
I realized later it stopped reproducing after minor changes in code not even close to UI, which I had to add to try other devices (the Card contained play integrity error specific to Nothing). This was midcommit, I tried to recover setup, but failed.
Idk, maybe it was related more to build cache issues, rather than view/compose interop.
If I catch it again, I come back
jo...@google.com <jo...@google.com> #14
#13, thanks!
#10, please let us know if you have a repro case for us!
Description
Affected compose versions:
Suspected Jetpack Compose components:
Kotlin version: 1.9.20
The crash is not reproducible and we can’t figure out the app code origin
Stack trace (if applicable):