Status Update
Comments
po...@google.com <po...@google.com>
an...@google.com <an...@google.com> #2
mo...@google.com <mo...@google.com> #3
This is an interesting question of what the developer wants. We'll have to discuss this as it is working as designed, but may not be working as the developer wants!
vs...@gmail.com <vs...@gmail.com> #4
Personally it just came unexpected for me because I didn't catch a concept of inner content for composable. I always thought about padding as a part of any content where it happens to be attached to. Maybe documentation should be a bit more specific about that.
Regarding the usefulness of such modifier that will count the padding in, I can say that I immediately added the helper extension in my project which I called onSizeChangedPaddingIncluded
:) It is useful part for my implementation of drag-n-drop reordering machinery for LazyColumn
.
ae...@google.com <ae...@google.com> #5
I see. We just ran into this in a foundation component CL as well:
ap...@google.com <ap...@google.com> #6
Branch: androidx-main
commit 940f677411cf9f83c5bfceb6f6db588de846e48b
Author: George Mount <mount@google.com>
Date: Fri Jan 15 20:59:22 2021
OnSizeChanged now reports the size within the modifier chain.
Relnote: "OnSizeChanged was reporting the size of the layout's
contents. It now reports the size at its position within the
modifier chain."
Fixes: 177562900
Test: new test
Change-Id: I36b78f445cf90b10f3df4ea6251bc19392bb7c11
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/OnSizeChangedTest.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/OnRemeasuredModifier.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt
A compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/RemeasureModifierWrapper.kt
Description
Jetpack Compose release version: 1.0.0-alpha10
Steps to Reproduce:
Expected printout:
150 x 150
Actual printout:
50 x 50
On the other hand if I replace
onSizeChanged
withlayout
it prints expected result.