Status Update
Comments
an...@google.com <an...@google.com>
sh...@google.com <sh...@google.com> #2
Hi larrywang10,
Thanks so much for this bug! I made some fixes for pointer input in Alpha05 (recently released) that I believe should fix this issue. Would you mind verifying for me? :)
la...@gmail.com <la...@gmail.com> #3
Hi, thanks for looking into this bug. I can still repro for 1.0.0-alpha05, using API-30 emulator. Please try the attached project.
la...@gmail.com <la...@gmail.com> #4
Is this bug being worked on?
so...@google.com <so...@google.com>
mo...@google.com <mo...@google.com> #5
I think this may be fixed as of aosp/1530587. There was an error in the way that LayoutCoordinates were calculated and it was affecting pointer input. I will try to test this after the next alpha is released.
mo...@google.com <mo...@google.com> #6
I'm trying to reproduce this bug and having some trouble. Can you give a full project that I can use to test it out?
la...@gmail.com <la...@gmail.com> #7
Hi, does the BubbleCompose.zip project from October 16, 2020 work for you?
mo...@google.com <mo...@google.com> #8
Oh, yes. Of course, thanks. I missed it!
tc...@google.com <tc...@google.com> #9
mo...@google.com <mo...@google.com> #10
I've tested this with alpha-10 and it appears to be working, so I will close this as Obsolete.
mo...@google.com <mo...@google.com> #11
Realized that it isn't obsolete as much as fixed, so used fixed instead.
la...@gmail.com <la...@gmail.com> #12
Unfortunately, this is still not fixed in the latest attached BubbleCompose.zip. Android Studio 2020.3.1 Canary 4 Jetpack Compose 1.0.0-alpha-10 Android Emulator Revision 3, API 30
mo...@google.com <mo...@google.com> #13
I'm trying this on physical hardware and not seeing any issues. I'll try the emulator.
mo...@google.com <mo...@google.com> #14
I am able to reproduce this on the emulator.
mo...@google.com <mo...@google.com> #15
This is the same bug as another that we've seen elsewhere. The global position of the window is not being updated when it is needed.
tc...@google.com <tc...@google.com> #16
ap...@google.com <ap...@google.com> #17
Branch: androidx-main
commit f1cab8853ca8a98c99f5c475f15e445965134d60
Author: George Mount <mount@google.com>
Date: Fri Jan 22 23:38:32 2021
Change pointer input dependency on screen position.
Bug: 169874631
Bug: 175142755
Bug: 168920689
Bug: 169438847
* Changed hit testing so that it works relative to its
position rather than the global position. This
removes the walk-up for every modifier in the hit
test path.
* Removed all dependencies on global LayoutCoordinates
methods and removed those methods.
* Fixed problem where an AndroidComposeView that itself
was transformed could have its input mangled. For
example, if the AndroidComposeView was rotated, then
pointer input would previously only recognize the
offset and not the rotation, so pointer input would
be wrong about its position.
* Wrote a test to verify transforms to/from window
coordinates.
* Added tests to verify the coordinates in window are correct when view moved/rotated or window is moved
Relnote: Removed deprecated LayoutCoordinates methods, use function instead of the property for positionInParent and boundsInParent
Test: new tests. Ran all android pointer input tests.
Change-Id: I580edba74283600c3aafba6130a7af806df7d6c5
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/BoxTest.kt
M compose/foundation/foundation-layout/src/androidAndroidTest/kotlin/androidx/compose/foundation/layout/RowColumnTest.kt
M compose/foundation/foundation-layout/src/androidAndroidTest/kotlin/androidx/compose/foundation/layout/SizeTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/selection/SelectionContainerFocusTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/selection/TextSelectionColorsScreenshotTest.kt
M compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text/TextFieldDelegateTest.kt
M compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text/selection/MockCoordinates.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/BottomSheetScaffoldTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/MaterialTextSelectionColorsScreenshotTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ScaffoldTest.kt
M compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/AndroidAssertions.android.kt
M compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/AndroidInputDispatcher.android.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Actions.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/GestureScope.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Output.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/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/autofill/ExplicitAutofillTypesDemo.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/AccessibilityIteratorsTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/AndroidAccessibilityTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/AndroidPointerInputTest.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/MotionEventAdapterTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessorTest.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/input/pointer/TestUtils.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/OnGloballyPositionedTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/node/ModelReadsTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/window/PopupDismissTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/input/pointer/MotionEventAdapter.android.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AccessibilityIterators.android.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/HitPathTracker.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/InternalPointerInput.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerEvent.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/layout/LayoutCoordinates.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
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/Owner.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/PointerInputDelegatingWrapper.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsNode.kt
M compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/input/pointer/PointerInputEvent.desktop.kt
M compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopOwner.desktop.kt
M compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopOwners.desktop.kt
M compose/ui/ui/src/test/kotlin/androidx/compose/ui/node/LayoutNodeTest.kt
an...@google.com <an...@google.com>
la...@gmail.com <la...@gmail.com> #18
Hi,
What is the target release for this fix? After upgrading to the latest versions, I can still repro the issue (please cf. the newly attached BubbleCompose.zip).
Android Studio 2020.3.1 Canary 8 Jetpack Compose 1.0.0-beta01 Android Emulator 30.5.0, API 30
la...@gmail.com <la...@gmail.com> #20
Hi, I can still repro the issue with the Feb 25 BubbleCompose.zip, after upgrading to Android Studio 2020.3.1 Canary 10, Jetpack Compose 1.0.0-beta02, Android Emulator 30.5.2, API 30
mo...@google.com <mo...@google.com> #21
I'm able to reproduce this with the Feb 25 BubbleCompose.zip
mo...@google.com <mo...@google.com> #22
The source of the bug appears to be that getLocationOnScreen()
is returning (0, 0)
for the window containing the bubble contents. I think I'll have to work around the bug.
ap...@google.com <ap...@google.com> #23
Branch: androidx-main
commit 03b281a865ebeba81087864dbccc4476ec071dc4
Author: George Mount <mount@google.com>
Date: Fri Apr 02 23:53:03 2021
Fix problem with pointer input having a bad position.
Fixes: 169874631
In some circumstances, getLocationOnScreen() can return an invalid
result during pointer input dispatching. This CL uses the motion
event's raw position and position in the view to determine the
window position. It also calculates the view matrix once and caches
it so that it won't have to be calculated multiple times during
pointer input dispatch.
Test: ran breaking application.
Change-Id: Ic99fc8b4628b92d79f76da6e46363cebbd95ee4f
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/AndroidPointerInputTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/input/pointer/MotionEventAdapter.android.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
ap...@google.com <ap...@google.com> #24
Branch: androidx-main
commit 991ec6d090dfc0c088803dfa972e9570e6dbd577
Author: George Mount <mount@google.com>
Date: Wed Apr 14 17:51:56 2021
Fix problem with window having a scroll position.
Fixes: 169804790
Bug: 169874631
It turns out that the problem with
in getLocationOnScreen(), but just that the window had a scrolled
content. This CL fixes the problem by properly retrieving the
position, including the scroll position of the window.
Also changed cache check to use animation time instead of
drawing time because the view may not draw on every frame
that can have the position changed.
Test: new tests, bubble test, text handles demo
Change-Id: Id907e4dc5d134debc9260fff8c09ced9e7a7a754
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/window/PositionInWindowTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
la...@gmail.com <la...@gmail.com> #25
Unfortunately this issue is still not fixed in the BubbleCompose.zip project after bumping to the latest versions.
Compose 1.0.0-beta08 androidx.activity:activity-compose:1.3.0-beta01
mo...@google.com <mo...@google.com> #26
How does this keep not being fixed?!!?
mo...@google.com <mo...@google.com> #27
I verified that this is broken again. I think that every time I fix this, something else is broken and it gets changed again. It is difficult to get unit tests to identify this particular problem.
mo...@google.com <mo...@google.com> #28
It appears that the fix in getLocationOnScreen()
for the AndroidComposeView
, I'm seeing (0, 0), which is incorrect. This is not a problem with scroll position as getLocationOnScreen()
should be considering this.
I'll restore the fix for #23 to see if that fixes the issue (again).
ap...@google.com <ap...@google.com> #29
Branch: androidx-main
commit 9a9f6ab21c3f71bc2b20261ecb824bbd34472014
Author: George Mount <mount@google.com>
Date: Wed Jun 16 18:25:04 2021
Use MotionEvent for window position during touch events
Fixes: 169874631
In some special circumstances getLocationOnScreen() does
not properly retrieve the position. We can compensate for
it by using the MotionEvent raw coordinates in comparison
with their positions to determine the real window position.
Test: new test, manual testing using BubbleCompose
Change-Id: I2a19717f0e602b88f5445541fdf59ca82b1aa474
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/AndroidPointerInputTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
la...@gmail.com <la...@gmail.com> #30
Confirmed fixed in Compose 1.0.0-rc01. Thank you!
Description
Jetpack Compose release version: 1.0.0-alpha03
Android Studio Build: 4.2 Canary 12
Steps to Reproduce:
Expected: The button with label "Button 0" gets the touch events.
It looks like there is a missing coordinating adjustment when a Compose view is shown in a bubble.