Verified
Status Update
Comments
no...@google.com <no...@google.com>
mo...@google.com <mo...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit c782265fe41c10491b770f73f79d97d547af8e67
Author: Jeremy Walker <jewalker@google.com>
Date: Thu May 26 10:40:08 2022
Adds more events to Tap Benchmark for testing pressure.
Bug: 205164819
Test: Manually tested.
Change-Id: I0c9e744c18d14876545d8b3b23066018a7c57471
M compose/ui/ui/benchmark/src/androidTest/java/androidx/compose/ui/benchmark/input/pointer/ComposeTapIntegrationBenchmark.kt
A compose/ui/ui/benchmark/src/androidTest/java/androidx/compose/ui/benchmark/input/pointer/ComposePreciseFingerTapIntegrationBenchmark.kt
A compose/ui/ui/benchmark/src/androidTest/java/androidx/compose/ui/benchmark/input/pointer/ComposePreciseStylusTapIntegrationBenchmark.kt
https://android-review.googlesource.com/2108527
Branch: androidx-main
commit c782265fe41c10491b770f73f79d97d547af8e67
Author: Jeremy Walker <jewalker@google.com>
Date: Thu May 26 10:40:08 2022
Adds more events to Tap Benchmark for testing pressure.
Bug: 205164819
Test: Manually tested.
Change-Id: I0c9e744c18d14876545d8b3b23066018a7c57471
M compose/ui/ui/benchmark/src/androidTest/java/androidx/compose/ui/benchmark/input/pointer/ComposeTapIntegrationBenchmark.kt
A compose/ui/ui/benchmark/src/androidTest/java/androidx/compose/ui/benchmark/input/pointer/ComposePreciseFingerTapIntegrationBenchmark.kt
A compose/ui/ui/benchmark/src/androidTest/java/androidx/compose/ui/benchmark/input/pointer/ComposePreciseStylusTapIntegrationBenchmark.kt
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit fe9050830b23ca5cfd09570e167f483e12318473
Author: Jeremy Walker <jewalker@google.com>
Date: Thu May 26 11:18:17 2022
Add pressure to Compose input events.
Bug: 205164819
Test: Manually tested
Relnote: "Added a new property `PointerInputChange#pressure` to retrieve the pressure."
Change-Id: I45a5e8a0097064b01bba449df9e1d455a82e696c
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerInputTestUtil.kt
M compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/UiDemos.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/input/pointer/MotionEventAdapter.android.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/TestUtils.kt
A compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/gestures/TapPressureGestureDetectorDemo.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/SuspendingPointerInputFilter.kt
M compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/input/pointer/TestPointerInputEventData.skiko.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessorTest.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessor.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerEvent.kt
M compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/ComposeScene.desktop.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/input/pointer/PointerEvent.android.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/InternalPointerInput.kt
M compose/ui/ui/api/public_plus_experimental_current.txt
https://android-review.googlesource.com/2108528
Branch: androidx-main
commit fe9050830b23ca5cfd09570e167f483e12318473
Author: Jeremy Walker <jewalker@google.com>
Date: Thu May 26 11:18:17 2022
Add pressure to Compose input events.
Bug: 205164819
Test: Manually tested
Relnote: "Added a new property `PointerInputChange#pressure` to retrieve the pressure."
Change-Id: I45a5e8a0097064b01bba449df9e1d455a82e696c
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerInputTestUtil.kt
M compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/UiDemos.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/input/pointer/MotionEventAdapter.android.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/TestUtils.kt
A compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/gestures/TapPressureGestureDetectorDemo.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/SuspendingPointerInputFilter.kt
M compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/input/pointer/TestPointerInputEventData.skiko.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessorTest.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessor.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerEvent.kt
M compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/ComposeScene.desktop.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/input/pointer/PointerEvent.android.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/InternalPointerInput.kt
M compose/ui/ui/api/public_plus_experimental_current.txt
je...@google.com <je...@google.com> #4
Pressure should now be available in the alpha.
Description
Description:
Android MotionEvents reports the pressure being applied to the screen by a finger, stylus or other pointer device.
There appears to be no way to get touch pressure in Jetpack Compose without resorting to
pointerInteropFilter
, which the documentation recommends we don't use and which in any case appears to break when inside a LazyItem scope. (pointerInteropFilter
gets very janky, and drops around 90 per cent of events when in something like a LazyColumn.)It would be nice if
androidx.compose.ui.input.pointer
orandroidx.compose.ui.input.pointer.pointerevent
(or indeed anywhere you liked!) contained pressure properties or methods.Use Case:
Any Jetpack Compose drawing or handwriting app could make use of touch pressure. I imagine games could also benefit from it?