Status Update
Comments
po...@google.com <po...@google.com> #2
Branch: androidx-master-dev
commit 75c42d0ee50b884d71f407e909b050822afcb05d
Author: Matvei Malkov <malkov@google.com>
Date: Mon Mar 30 16:03:11 2020
Deprecate ColoredRect
With full-modifiers-mode we don't need ColoredRect anymore. There's little to no cases where you actually need Colored Rectangle in real life. People need some layout with background. ColoredRect was failing us in few ways, starting form accepting params that should be modifiers to sending incorrect message, so people were putting together Stack with coloredRect for background.
This CL deprecates ColoredRecr with recommendation to use Box(Modifier.preferedSize(width, height).drawBackground(color)) instead.
All places when ColoredRect is used has been changed to Box.
RelNote: ColoredRect has been deprecated. Use Box(Modifier.preferredSize(width, height).drawBackground(color)) instead.
Bug: 152753731
Test: changed tests, should pass
Change-Id: I499fa26b66b128943500fbdf9ba490d754adf561
M compose/compose-runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/benchmark/realworld4/RealWorld4_Widgets.kt
M ui/integration-tests/test/src/androidTest/java/androidx/ui/integration/test/TableRecompositionTest.kt
M ui/integration-tests/test/src/main/java/androidx/ui/integration/test/foundation/NestedScrollerTestCase.kt
M ui/integration-tests/test/src/main/java/androidx/ui/integration/test/foundation/RectsInColumnSharedModelTestCase.kt
M ui/integration-tests/test/src/main/java/androidx/ui/integration/test/foundation/RectsInColumnTestCase.kt
M ui/ui-animation/samples/src/main/java/androidx/ui/animation/samples/AnimatedValueSamples.kt
M ui/ui-animation/samples/src/main/java/androidx/ui/animation/samples/TransitionSamples.kt
M ui/ui-foundation/api/0.1.0-dev09.txt
M ui/ui-foundation/api/current.txt
M ui/ui-foundation/api/public_plus_experimental_0.1.0-dev09.txt
M ui/ui-foundation/api/public_plus_experimental_current.txt
M ui/ui-foundation/api/restricted_0.1.0-dev09.txt
M ui/ui-foundation/api/restricted_current.txt
D ui/ui-foundation/samples/src/main/java/androidx/ui/foundation/samples/ColoredRectSamples.kt
M ui/ui-foundation/samples/src/main/java/androidx/ui/foundation/samples/DarkThemeSample.kt
M ui/ui-foundation/samples/src/main/java/androidx/ui/foundation/samples/DeterminateProgressSamples.kt
M ui/ui-foundation/samples/src/main/java/androidx/ui/foundation/samples/TableBordersSamples.kt
M ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ColoredRectTest.kt
M ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/DeterminateProgressTest.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/ColoredRect.kt
M ui/ui-layout/samples/src/main/java/androidx/ui/layout/samples/SizeModifierSample.kt
M ui/ui-material/integration-tests/material-studies/src/main/java/androidx/ui/material/studies/rally/CommonUi.kt
M ui/ui-material/samples/src/main/java/androidx/ui/material/samples/DrawerSamples.kt
M ui/ui-material/samples/src/main/java/androidx/ui/material/samples/ScaffoldSamples.kt
M ui/ui-material/samples/src/main/java/androidx/ui/material/samples/ThemeSamples.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ScaffoldTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/TabTest.kt
M ui/ui-material/src/main/java/androidx/ui/material/DataTable.kt
M ui/ui-material/src/main/java/androidx/ui/material/Divider.kt
M ui/ui-material/src/main/java/androidx/ui/material/Tab.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/BitmapCapturingTest.kt
M ui/ui-tooling/src/androidTest/java/androidx/ui/tooling/InspectableTests.kt
an...@google.com <an...@google.com> #3
mo...@google.com <mo...@google.com> #4
Branch: androidx-master-dev
commit bdb7e3ae509091f240313922244daefda0c24dea
Author: Matvei Malkov <malkov@google.com>
Date: Fri May 01 17:11:57 2020
Remove ColoredRect
After ColoredRect was deprecated, few releases have passed, so it's time to delete it completely
Change-Id: I983c7fe9b61d873421278caf1c46ff9461307642
Relnote: ColoredRect has been removed. User Box with drawBackground modifier instead
Bug: 152753731
Test: n/a
M ui/ui-foundation/api/0.1.0-dev11.txt
M ui/ui-foundation/api/current.txt
M ui/ui-foundation/api/public_plus_experimental_0.1.0-dev11.txt
M ui/ui-foundation/api/public_plus_experimental_current.txt
M ui/ui-foundation/api/restricted_0.1.0-dev11.txt
M ui/ui-foundation/api/restricted_current.txt
D ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ColoredRectTest.kt
D ui/ui-foundation/src/main/java/androidx/ui/foundation/ColoredRect.kt
ap...@google.com <ap...@google.com> #5
Branch: androidx-main
commit af7fc218d744cf0a2560d9352a1efe88cb02c9e9
Author: George Mount <mount@google.com>
Date: Fri Jan 22 00:00:19 2021
Added ability to get parent layout modifier's coordinates
Bug: 177926591
Relnote: "Renamed LayoutCoordinates.parentCoordinates to
LayoutCoordinates.parentLayoutCoordinates to allow for a new
parentCoordinates property. The parentCoordinates property
now offers the parent modifier's LayoutCoordintes. This will
make for more complete use cases for onSizeChanged() and
onGloballyPositioned()"
Test: new test
Change-Id: Idfbfd3012d88b8661b097cb50e4554f2b73f3b64
M compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text/TextFieldDelegateTest.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Actions.kt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/OnGloballyPositionedSamples.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/HitPathTrackerTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/PointerInteropFilterTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/OnGloballyPositionedTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/window/AndroidPopup.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/LayoutCoordinates.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/InnerPlaceable.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNodeWrapper.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/ModifiedLayoutNode.kt
M compose/ui/ui/src/test/kotlin/androidx/compose/ui/node/LayoutNodeTest.kt
M compose/ui/ui/src/test/kotlin/androidx/compose/ui/selection/MockCoordinates.kt
ae...@google.com <ae...@google.com> #6
After I ran myself into unexpected brittleness in unit tests caused by onGloballyPositioned's current behavior, I've come to feel this is quite important to fix. So I would ideally like to see this issue remain in scope for 1.0 (since the current behavior will become sticky once we have enough developer adoption).
Andrey, I understand it is hard for you to find time to work on this given the other top priorities on your plate though. George, do you think you might be able to squeeze this change in whenever you get a break from overscroll and CTS tests? (You can reassign to me if not. This is something I might also try to find the cycles to fix myself given it's my pet peeve and I'm familiar with the area.)
an...@google.com <an...@google.com>
an...@google.com <an...@google.com> #7
I wasn't sure I will find time for this task, but after you mentioned the importance of it I decided to explore and realised there is a pretty trivial solution. So I went ahead and uploaded aosp/1707955
ae...@google.com <ae...@google.com> #8
Great, thanks Andrey!
ap...@google.com <ap...@google.com> #9
Branch: androidx-main
commit eef6d918107789be7c43b293df82d2b9ae02f058
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Fri May 14 13:12:45 2021
Change Modifier.onGloballyPositioned to report the modifier coordinates
Relnote: Modifier.onGloballyPositioned() was changed to report the coordinates of this modifier in the modifier chain, not the layout coordinates after applying all the modifiers. This means that now the ordering of modifiers is affecting what coordinates would be reported.
Fixes: 177926591
Test: OnGloballyPositionedTest
Change-Id: Ieb67da0c327c9dc323a4b0a8bf33dbb66f0611e3
M compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/AnimatedVisibilityTest.kt
M compose/foundation/foundation-layout/src/androidAndroidTest/kotlin/androidx/compose/foundation/layout/AlignmentLineTest.kt
M compose/foundation/foundation-layout/src/androidAndroidTest/kotlin/androidx/compose/foundation/layout/IntrinsicTest.kt
M compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/IndicationSamples.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldDefaultWidthTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/BottomSheetScaffoldTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ScaffoldTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Drawer.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/ModalBottomSheet.kt
M compose/ui/ui-inspection/src/androidTest/java/androidx/compose/ui/inspection/rules/ComposeInspectionRule.kt
M compose/ui/ui-tooling-data/src/androidTest/java/androidx/compose/ui/tooling/data/ToolingTest.kt
M compose/ui/ui-tooling/src/androidTest/java/androidx/compose/ui/tooling/ToolingTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/draw/GraphicsLayerTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/OnGloballyPositionedTest.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/OnGloballyPositionedModifierWrapper.kt
Description
Based on comment:https://android-review.googlesource.com/c/platform/frameworks/support/+/1552681/comment/e10d2507_68d1ed41/
We've changed onSizeChanged to report the size at the position of the modifier, but onGloballyPositioned() reports the size/position of the content. Should this be changed to be the size/position of the place in the modifier chain? Andrey, as you wrote the original modifier, you know the use cases better and can comment on it.