Fixed
Status Update
Comments
ma...@google.com <ma...@google.com>
sh...@google.com <sh...@google.com> #2
Project: platform/frameworks/support
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
https://android-review.googlesource.com/1360099
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
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 0eb95893ef5119b772cfe087d5fe972d1dc426a0
Author: Matvei Malkov <malkov@google.com>
Date: Fri Nov 27 18:35:01 2020
Nested scrolling subsystem.
This CL adds nested scrolling system in the ui module. This is modifier-chained system that binds together nested scroll nodes(or modifiers) to provide build-in contracts of the pre/post consumption as well as graph update handling.
The basic API consists of NestedScrollDispatcher to dispatch scroll events when scrollble container identifies some, as well as NestedScrollConnection to connect itself to the nested scroll system, receive the parent and connect itself to children to start receiving dispatched events from hierarchy below.
Dispatcher and connection bind together into the single modifier, that is later attach by system to the parent and updated.
The biggest two differences between view nested scroll system and compose one are:
1. in compose parent-child relationship, hierarchy updates as well as the call sequence is controlled by the system, not allowing nodes to cheat by not calling parent or preconsuming before the parent had their chance. Updates are automated, so there's no notion of the parent and child per se when you receive nested scroll events in connection, because parents will be approprietelly notified if connection return reasonable values from the callback.
2. In compose we don't have clear notion of parent/child, all nodes are middle-nodes with potential parent and child. Some nodes might opt in to dispatch events, but it's not necessary.
Few decisions made:
1. NestedScrollConnection is required as I want any node to be able to participate in the middle of the tree, there should be no nodes that dispatch scroll, emit children, but do not participate in nested scroll. This will inevitably result in the bad UX and to be avoided. Leaf components (that will never have children) will suffer from that a little bit, but it's ok to explicitly say that the conneciton is empty (transparent/noop).
2. Dispatching, on the other side, is optional, since you might be able to just listen to nested scroll events to hide/show toolbar or consume/redirect delta other way without being scrollable itself. Not all nested scroll nodes are scrollables themselves.
3. I had to add checks for referential equality in nested scroll system implmenetation as inevitable there are situations where we want to update our children, which is an expensive operation and I wanted to reduce the amount of expensive call since scrolling is quite hot of an operation. Therefore, I've added a requirement in the docs to pass same conneciton/dispatcher if they don't change.
4. For now in onPostFling there a callback to be called because of the non-linear nature of the animation. It will be gone presumably when onPostFling and others will be suspend when we will migrate to suspend motion
Change-Id: I36e1594231bddd0ab8e90bb04fd03bf930a434c5
Relnote: Nested scroll system added. Refer to Modifier.nestedScroll for more details
Bug: 162408885
Test: new tests added
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/integration-tests/ui-demos/build.gradle
M compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/UiDemos.kt
A compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/NestedScrollSamples.kt
A compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/gesture/nestedscroll/NestedScrollModifierTest.kt
A compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/gesture/nestedscroll/NestedScrollDelegatingWrapper.kt
A compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/gesture/nestedscroll/NestedScrollModifier.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/DelegatingLayoutNodeWrapper.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/LayoutNode.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNodeWrapper.kt
https://android-review.googlesource.com/1513309
Branch: androidx-master-dev
commit 0eb95893ef5119b772cfe087d5fe972d1dc426a0
Author: Matvei Malkov <malkov@google.com>
Date: Fri Nov 27 18:35:01 2020
Nested scrolling subsystem.
This CL adds nested scrolling system in the ui module. This is modifier-chained system that binds together nested scroll nodes(or modifiers) to provide build-in contracts of the pre/post consumption as well as graph update handling.
The basic API consists of NestedScrollDispatcher to dispatch scroll events when scrollble container identifies some, as well as NestedScrollConnection to connect itself to the nested scroll system, receive the parent and connect itself to children to start receiving dispatched events from hierarchy below.
Dispatcher and connection bind together into the single modifier, that is later attach by system to the parent and updated.
The biggest two differences between view nested scroll system and compose one are:
1. in compose parent-child relationship, hierarchy updates as well as the call sequence is controlled by the system, not allowing nodes to cheat by not calling parent or preconsuming before the parent had their chance. Updates are automated, so there's no notion of the parent and child per se when you receive nested scroll events in connection, because parents will be approprietelly notified if connection return reasonable values from the callback.
2. In compose we don't have clear notion of parent/child, all nodes are middle-nodes with potential parent and child. Some nodes might opt in to dispatch events, but it's not necessary.
Few decisions made:
1. NestedScrollConnection is required as I want any node to be able to participate in the middle of the tree, there should be no nodes that dispatch scroll, emit children, but do not participate in nested scroll. This will inevitably result in the bad UX and to be avoided. Leaf components (that will never have children) will suffer from that a little bit, but it's ok to explicitly say that the conneciton is empty (transparent/noop).
2. Dispatching, on the other side, is optional, since you might be able to just listen to nested scroll events to hide/show toolbar or consume/redirect delta other way without being scrollable itself. Not all nested scroll nodes are scrollables themselves.
3. I had to add checks for referential equality in nested scroll system implmenetation as inevitable there are situations where we want to update our children, which is an expensive operation and I wanted to reduce the amount of expensive call since scrolling is quite hot of an operation. Therefore, I've added a requirement in the docs to pass same conneciton/dispatcher if they don't change.
4. For now in onPostFling there a callback to be called because of the non-linear nature of the animation. It will be gone presumably when onPostFling and others will be suspend when we will migrate to suspend motion
Change-Id: I36e1594231bddd0ab8e90bb04fd03bf930a434c5
Relnote: Nested scroll system added. Refer to Modifier.nestedScroll for more details
Bug: 162408885
Test: new tests added
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/integration-tests/ui-demos/build.gradle
M compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/UiDemos.kt
A compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/NestedScrollSamples.kt
A compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/gesture/nestedscroll/NestedScrollModifierTest.kt
A compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/gesture/nestedscroll/NestedScrollDelegatingWrapper.kt
A compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/gesture/nestedscroll/NestedScrollModifier.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/DelegatingLayoutNodeWrapper.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/LayoutNode.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNodeWrapper.kt
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 11186877e27ca3826919baedad67003dc9eab1c4
Author: Matvei Malkov <malkov@google.com>
Date: Fri Nov 27 18:37:33 2020
Support nested scroll in Modifier.scrollable.
This CL support nested scrolling using new system in scrollable and, therefore, in LazyLayouts and ScrollableColumn/Row and other Modifier.scrollable users.
For now the fling curve will be interrupted when goes from one scrollable to another, will be solved separately.
Bug: 162408885
Test: new tests for scrollable nested scroll/fling handling were added
Change-Id: Iecac08e55bd2a489c609468f70eaf1a68efecaf6
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/AnimatedValue.kt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/FoundationDemos.kt
A compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/NestedScrollDemos.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollableTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyNestedScrollingTest.kt
M compose/foundation/foundation/src/androidMain/kotlin/androidx/compose/foundation/animation/AndroidFlingCalculator.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Scrollable.kt
https://android-review.googlesource.com/1513310
Branch: androidx-master-dev
commit 11186877e27ca3826919baedad67003dc9eab1c4
Author: Matvei Malkov <malkov@google.com>
Date: Fri Nov 27 18:37:33 2020
Support nested scroll in Modifier.scrollable.
This CL support nested scrolling using new system in scrollable and, therefore, in LazyLayouts and ScrollableColumn/Row and other Modifier.scrollable users.
For now the fling curve will be interrupted when goes from one scrollable to another, will be solved separately.
Bug: 162408885
Test: new tests for scrollable nested scroll/fling handling were added
Change-Id: Iecac08e55bd2a489c609468f70eaf1a68efecaf6
M compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/AnimatedValue.kt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/FoundationDemos.kt
A compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/NestedScrollDemos.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollableTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyNestedScrollingTest.kt
M compose/foundation/foundation/src/androidMain/kotlin/androidx/compose/foundation/animation/AndroidFlingCalculator.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Scrollable.kt
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 531cf5e982c93baddc18766479a3247ce1b8cd1e
Author: Matvei Malkov <malkov@google.com>
Date: Thu Dec 03 18:14:43 2020
Support nested scroll for backdrop, modal sheet, expanded sheet and bottom drawer.
This CL supports nested scroll by opening a few APIs in swipeable state, so any user that uses it would be able to set their desiged behaviour.
And them it implements such behaviour for main swipeable components that need it.
Note that swipeable is swiping, but not scrolling, therefore it doesn't dispatch the scroll events, only participates as the connection.
Test: Added new tests to test NestedScrollConnection in swipeable + demos
Bug: 162408885
Change-Id: Iaa17a40fec2949f6364a9339a5d269dc622570d6
Relnote: added API to manually trigger settle animation and drag in Modifier.swipeable
M compose/material/material/api/current.txt
M compose/material/material/api/public_plus_experimental_current.txt
M compose/material/material/api/restricted_current.txt
M compose/material/material/samples/src/main/java/androidx/compose/material/samples/BackdropScaffoldSamples.kt
M compose/material/material/samples/src/main/java/androidx/compose/material/samples/ModalBottomSheetSamples.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwipeableTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/BackdropScaffold.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/BottomSheetScaffold.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/material/material/src/commonMain/kotlin/androidx/compose/material/Swipeable.kt
https://android-review.googlesource.com/1516559
Branch: androidx-master-dev
commit 531cf5e982c93baddc18766479a3247ce1b8cd1e
Author: Matvei Malkov <malkov@google.com>
Date: Thu Dec 03 18:14:43 2020
Support nested scroll for backdrop, modal sheet, expanded sheet and bottom drawer.
This CL supports nested scroll by opening a few APIs in swipeable state, so any user that uses it would be able to set their desiged behaviour.
And them it implements such behaviour for main swipeable components that need it.
Note that swipeable is swiping, but not scrolling, therefore it doesn't dispatch the scroll events, only participates as the connection.
Test: Added new tests to test NestedScrollConnection in swipeable + demos
Bug: 162408885
Change-Id: Iaa17a40fec2949f6364a9339a5d269dc622570d6
Relnote: added API to manually trigger settle animation and drag in Modifier.swipeable
M compose/material/material/api/current.txt
M compose/material/material/api/public_plus_experimental_current.txt
M compose/material/material/api/restricted_current.txt
M compose/material/material/samples/src/main/java/androidx/compose/material/samples/BackdropScaffoldSamples.kt
M compose/material/material/samples/src/main/java/androidx/compose/material/samples/ModalBottomSheetSamples.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwipeableTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/BackdropScaffold.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/BottomSheetScaffold.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/material/material/src/commonMain/kotlin/androidx/compose/material/Swipeable.kt
tc...@google.com <tc...@google.com> #6
This bug/feature is targeting an iteration that has already passed. Can you please update the status or iteration? Thanks!
ma...@google.com <ma...@google.com> #7
Woops. Yeah it's done. It was a meta ticket for a big feature that is done.
Two smaller followups emerged:
This one is done, closing as fixed.
Description
There's a need for a
NestedScrollController
that scrolls only what's visible on the screen for situations where for example, theswipeable
modifier is used in a container that uses aLazyColumnFor
.At the moment, as you can see in the GIF, the child always wins and the content inside the
LazyColumn
scrolls until the last item reaches themaxValue
of theswipeable
modifier. After that, the wrapper starts moving.With nested scrolling, the last item should be visible on the screen before the container starts moving