Fixed
Status Update
Comments
ra...@google.com <ra...@google.com>
ma...@google.com <ma...@google.com> #2
Ah yes,
This is precisely because nothing is set up to do nested scrolling on the "pre" pass where a parent consumes scroll distances before a child.
We are moving away from the nested scrolling system that is currently set up (that uses lower level pointer input system features) and towards a higher level nested scrolling system that hooks up higher level composables.
:)
sc...@gmail.com <sc...@gmail.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
ma...@google.com <ma...@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
af...@gmail.com <af...@gmail.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
la...@team.bumble.com <la...@team.bumble.com> #6
Comment has been deleted.
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.
ap...@google.com <ap...@google.com> #9
Project: platform/frameworks/support
Branch: androidx-main
commit 7bb04688b802b7572aaac654629d11cfcf40fcb3
Author: Marcello Albano <maralb@google.com>
Date: Wed Apr 19 15:48:18 2023
Changed PerfettoHttpServer to upload in chuncks
The trace shell processor http server has 64mb of payload hard limit.
Uploading a trace larger than that in a single `parse` call will result
in a `broken pipe` error. This PR ensures that the trace is sent in
chunks of 32Mb max.
Fixes: 269949822
Test: ./gradlew :benchmark:benchmark-macro:cC
Change-Id: Ief831b2c58ebfeac3ae5cb2bfcb8623b920ad356
Relnote: Fixed trace processor parsing for traces larger than 64Mb.
M benchmark/benchmark-macro/lint-baseline.xml
M benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/perfetto/PerfettoTraceProcessorTest.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/server/PerfettoHttpServer.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/perfetto/PerfettoTraceProcessor.kt
https://android-review.googlesource.com/2549513
Branch: androidx-main
commit 7bb04688b802b7572aaac654629d11cfcf40fcb3
Author: Marcello Albano <maralb@google.com>
Date: Wed Apr 19 15:48:18 2023
Changed PerfettoHttpServer to upload in chuncks
The trace shell processor http server has 64mb of payload hard limit.
Uploading a trace larger than that in a single `parse` call will result
in a `broken pipe` error. This PR ensures that the trace is sent in
chunks of 32Mb max.
Fixes: 269949822
Test: ./gradlew :benchmark:benchmark-macro:cC
Change-Id: Ief831b2c58ebfeac3ae5cb2bfcb8623b920ad356
Relnote: Fixed trace processor parsing for traces larger than 64Mb.
M benchmark/benchmark-macro/lint-baseline.xml
M benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/perfetto/PerfettoTraceProcessorTest.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/perfetto/server/PerfettoHttpServer.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/perfetto/PerfettoTraceProcessor.kt
na...@google.com <na...@google.com> #10
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.benchmark:benchmark-macro:1.2.0-alpha14
Description
Hi!
For the following setup:
Component used:
androidx.benchmark:benchmark-macro-junit4
Version used:
1.2.0-alpha09
Devices/Android versions reproduced on: Zenfone 9 (Android 13) / Pixel 3A (Android 12)
IDE: Android Studio Giraffe + AGP 7.4.1
Gradle 7.6
I keep getting the following exception randomly during test execution:
Happens on both of my devices. It was also present in
1.2.0-alpha07
which I tested some time ago.It seems that this occurs at a random time - sometime just at the beginning of a test or in the middle of it. Happens for both builds with and without baseline profile.
Going back to version 1.1.1 resolves the issue.