Status Update
Comments
an...@google.com <an...@google.com>
sh...@google.com <sh...@google.com> #2
Our decision was:
- We will investigate if it is possible to unify EditorValue and TextField value. (keeping the name TextfieldValue)
la...@gmail.com <la...@gmail.com> #3
Correction: current structure is:
CoreTextField(EditorValue, (EditorValue) -> Unit) (in ui.text) TextField(TextFieldValue, (TextFieldValue) -> Unit) (in ui.foundation) FilledTextField(TextFieldValue, (TextFieldValue) -> Unit) (in ui.material) FilledTextField(String, (String) -> Unit) (in ui.material)
We have decided to investigate if it is possible to unify EditorValue and TextField value. (keeping the name TextfieldValue) at
I tried to see the side effects of such a change, and implemented a change that has two steps:
- Use TextFieldValue in CoreTextField/TextField/FilledTextField. Deprecated older functions. aosp/1326149
- Use TextFieldValue in ui-text-core, and lower layers of editing (below CoreTextField). aosp/1326150
Based on these changes what I see is:
- The change is costly, and changes a lot of API surface
foundation.TextField
usesTextFieldValue
which does not have composition. I agree with Nona and Anastasia that app developers will not need composition information. However on the other handfoundation.TextField
uses EditorValue.composition. When we moveTextFieldValue
toCoreTextField
we need to add TextFieldValue.composition which in turn is accepted or returned to the developers. I believe the previous layering for TextFieldValue and EditorValue is correct. We can think more about the restructuring however I am not sure if it would make big changes in the API- i.e. Rename EditorValue as CoreTextFieldValue
- i.e. Extend TextFieldValue from CoreTextFieldValue, or reuse CoreTextFieldValue in TextFieldValue etc, but somehow hide composition from TextFieldValue
Looking at the CLs my suggestion would be not making such a change, and at most renaming EditorValue and making in sync with TextFieldValue. (CoreTextFieldValue? TextInputValue? CoreInputFieldValue) (Note: We also had a discussion of changing TextField to InputField (and therefore CoreTextField to CoreInputField)
la...@gmail.com <la...@gmail.com> #4
When
@Deprecated
data class Data1 {}
@Deprecated
@Composable fun Fun1{value=Data1}
Lint on server doesn't like it
it gave me error:
w: /buildbot/src/android/androidx-master-dev/frameworks/support/ui/ui-text/src/main/java/androidx/ui/text/CoreTextField.kt: (52, 26): 'EditorValue' is deprecated. Use androidx.ui.input.TextFieldValue instead
w: /buildbot/src/android/androidx-master-dev/frameworks/support/ui/ui-text/src/main/java/androidx/ui/text/CoreTextField.kt: (58, 12): 'EditorValue' is deprecated. Use androidx.ui.input.TextFieldValue instead
w: /buildbot/src/android/androidx-master-dev/frameworks/support/ui/ui-text/src/main/java/androidx/ui/text/CoreTextField.kt: (60, 21): 'EditorValue' is deprecated. Use androidx.ui.input.TextFieldValue instead
w: /buildbot/src/android/androidx-master-dev/frameworks/support/ui/ui-text/src/main/java/androidx/ui/text/CoreTextField.kt: (88, 13): 'EditorValue' is deprecated. Use androidx.ui.input.TextFieldValue instead
Therefore I tried by not deprecating Data1
but only the composable.
so...@google.com <so...@google.com>
mo...@google.com <mo...@google.com> #5
I first created changes that I took a two step approach:
- change ui-text and ui-text-core, while using deprecated composable in ui-foundation.
- change ui-foundation and ui-material to start using new object
Because of the problem mentioned in the previous comment, I abandoned those attempts:
https://android-review.googlesource.com/q/topic:%2522textfieldvalue%2522 https://android-review.googlesource.com/q/topic:%2522editor_value%2522+
Created one CL that contains all the change
mo...@google.com <mo...@google.com> #6
CL is ready to go, marking as fixed.
la...@gmail.com <la...@gmail.com> #7
Branch: androidx-master-dev
commit c2e5559d05db4329d7e0d3e92e53508194bf5d8d
Author: Siyamed Sinir <siyamed@google.com>
Date: Tue Jun 09 09:37:23 2020
Use TextFieldValue in all TextFields
Test: ./gradlew ui:ui-material:test
Test: ./gradlew ui:ui-material:cAT
Test: ./gradlew ui:ui-foundation:test
Test: ./gradlew ui:ui-foundation:cAT
Test: ./gradlew ui:ui-text:test
Test: ./gradlew ui:ui-text:cAT
Test: ./gradlew ui:ui-text-core:test
Test: ./gradlew ui:ui-text-core:cAT
Test: ./gradlew ui:ui-core:test
Test: ./gradlew ui:ui-core:cAT
Test: Manual test in the Demo app.
RelNote: "androidx.ui.foundation.TextFieldValue and
androidx.ui.input.EditorValue is deprecated. TextField,
FilledTextField and CoreTextField composables that uses
that type is also deprecated. Please use
androidx.ui.input.TextFieldValue instead"
Bug: 155211005
Change-Id: I4066d1f4d2e3e3514753aa3495680292dc55f89d
M compose/compose-runtime/samples/src/main/java/androidx/compose/samples/ModelSamples.kt
M ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/input/EditProcessorBenchmark.kt
M ui/integration-tests/demos/src/main/java/androidx/ui/demos/DemoApp.kt
M ui/integration-tests/demos/src/main/java/androidx/ui/demos/DemoFilter.kt
M ui/ui-core/integration-tests/ui-core-demos/src/main/java/androidx/ui/core/demos/PopupDemo.kt
M ui/ui-core/integration-tests/ui-core-demos/src/main/java/androidx/ui/core/demos/autofill/ExplicitAutofillTypesDemo.kt
M ui/ui-core/src/androidTest/java/androidx/ui/input/RecordingInputConnectionTest.kt
M ui/ui-core/src/main/java/androidx/ui/input/InputState.kt
M ui/ui-core/src/main/java/androidx/ui/input/RecordingInputConnection.kt
M ui/ui-core/src/main/java/androidx/ui/input/TextInputServiceAndroid.kt
M ui/ui-core/src/test/java/androidx/ui/input/RecordingInputConnectionUpdateTextFieldValueTest.kt
M ui/ui-core/src/test/java/androidx/ui/input/TextInputServiceAndroidTest.kt
M ui/ui-desktop/src/jvmMain/kotlin/androidx/ui/desktop/DesktopPlatformInput.kt
M ui/ui-foundation/api/0.1.0-dev14.txt
M ui/ui-foundation/api/current.txt
M ui/ui-foundation/api/public_plus_experimental_0.1.0-dev14.txt
M ui/ui-foundation/api/public_plus_experimental_current.txt
M ui/ui-foundation/api/restricted_0.1.0-dev14.txt
M ui/ui-foundation/api/restricted_current.txt
M ui/ui-foundation/samples/src/main/java/androidx/ui/foundation/samples/TextFieldSample.kt
M ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/SoftwareKeyboardTest.kt
M ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldFocusTest.kt
M ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldOnValueChangeTextFieldValueTest.kt
M ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldTest.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Scroller.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/TextField.kt
M ui/ui-layout/src/androidTest/java/androidx/ui/layout/test/TextLayoutDirectionModifierTest.kt
M ui/ui-material/api/0.1.0-dev14.txt
M ui/ui-material/api/current.txt
M ui/ui-material/api/public_plus_experimental_0.1.0-dev14.txt
M ui/ui-material/api/public_plus_experimental_current.txt
M ui/ui-material/api/restricted_0.1.0-dev14.txt
M ui/ui-material/api/restricted_current.txt
M ui/ui-material/samples/src/main/java/androidx/ui/material/samples/TextFieldSamples.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/FilledTextFieldTest.kt
M ui/ui-material/src/main/java/androidx/ui/material/TextField.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt
M ui/ui-test/src/main/java/androidx/ui/test/TextInputServiceForTests.kt
M ui/ui-text-core/api/0.1.0-dev14.txt
M ui/ui-text-core/api/current.txt
M ui/ui-text-core/api/public_plus_experimental_0.1.0-dev14.txt
M ui/ui-text-core/api/public_plus_experimental_current.txt
M ui/ui-text-core/api/restricted_0.1.0-dev14.txt
M ui/ui-text-core/api/restricted_current.txt
M ui/ui-text-core/build.gradle
M ui/ui-text-core/src/commonMain/kotlin/androidx/ui/input/EditProcessor.kt
D ui/ui-text-core/src/commonMain/kotlin/androidx/ui/input/EditorValue.kt
A ui/ui-text-core/src/commonMain/kotlin/androidx/ui/input/TextFieldValue.kt
M ui/ui-text-core/src/commonMain/kotlin/androidx/ui/input/TextInputService.kt
M ui/ui-text-core/src/test/java/androidx/ui/input/EditProcessorTest.kt
M ui/ui-text-core/src/test/java/androidx/ui/text/TextInputServiceTest.kt
M ui/ui-text/api/0.1.0-dev14.txt
M ui/ui-text/api/current.txt
M ui/ui-text/api/public_plus_experimental_0.1.0-dev14.txt
M ui/ui-text/api/public_plus_experimental_current.txt
M ui/ui-text/api/restricted_0.1.0-dev14.txt
M ui/ui-text/api/restricted_current.txt
M ui/ui-text/integration-tests/ui-text-compose-demos/src/main/java/androidx/ui/text/demos/ComposeInputField.kt
M ui/ui-text/integration-tests/ui-text-compose-demos/src/main/java/androidx/ui/text/demos/ComposeInputFieldFocusTransition.kt
M ui/ui-text/integration-tests/ui-text-compose-demos/src/main/java/androidx/ui/text/demos/ComposeInputFieldTrickyUseCase.kt
M ui/ui-text/integration-tests/ui-text-compose-demos/src/main/java/androidx/ui/text/demos/ComposeVariousInputField.kt
M ui/ui-text/integration-tests/ui-text-compose-demos/src/main/java/androidx/ui/text/demos/TailFollowingTextField.kt
M ui/ui-text/integration-tests/ui-text-compose-demos/src/main/java/androidx/ui/text/demos/TextFieldWIthScroller.kt
M ui/ui-text/src/androidTest/java/androidx/ui/text/TextFieldDelegateIntegrationTest.kt
M ui/ui-text/src/main/java/androidx/ui/text/CoreTextField.kt
M ui/ui-text/src/main/java/androidx/ui/text/TextFieldDelegate.kt
M ui/ui-text/src/test/java/androidx/ui/text/TextFieldDelegateTest.kt
mo...@google.com <mo...@google.com> #8
FYI: this caused far too many work. I regret pushing the change in.
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.