Status Update
Comments
si...@google.com <si...@google.com> #2
First of all thanks for this detailed issue.
This issue had been investigated thoroughly when it was first reported internally. The surprising detail in this report is that the issue is not reproducible before 1.7
. I will look into this.
The main problem with POBox is the fact that it is deprecated. Since 2021 Sony has been shipping new Xperia devices with Gboard pre-installed. Although we are aware that there is still a considerable amount of users still using POBox, the described behavior is caused by POBox's noncompliant behavior with InputConnection
and InputMethodManager
documentation. However, this is understandable since TextView
implementation was also not respecting the behavior that is expected from Editors.
Ultimately we have decided to enforce the documented behavior with specifically regards to when editors should call InputMethodManager.updateSelection
. Also, although unconfirmed, there were traces of possible custom code being included in Sony OEM images that changed how InputMethodManager was notified from TextView. If POBox also depended on something like this, it would be impossible for Compose code to replicate the same unknown behavior.
si...@google.com <si...@google.com>
si...@google.com <si...@google.com> #3
Or is that option not available?
Even if the root cause is POBox, from the perspective of the app's customers, it looks like an app bug, so this issue is a blocker against updating Jetpack Compose.
mo...@google.com <mo...@google.com> #4
Just to be sure, it is dangerous to replace Compose TextField with Android View EditText as a workaround for this issue.
Compose 1.7 has a bug that causes ANR when the focus is on EditText.
Another View-related bug in Compose 1.7 is that an Android View is focused by calling FocusManager.clearFocus().
Perhaps there is a lack of testing of Compose 1.7 in combination with Android View. There is also a possibility that there are other fatal bugs related to View.
In other words, the only options for apps targeting the Japanese market that require POBox support are to continue using Compose 1.6 or to use EditText in combination with various workarounds.
si...@google.com <si...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
Author: Halil Ozercan <
Link:
Fix POBox keyboard issue
Expand for full commit details
Fix POBox keyboard issue
Fix: 373743376
Fix: 329209241
Test: NullableInputConnectionWrapperTest
Change-Id: I94e0e598274fb88b255f977f9fbd50dfbbb1ecb1
Files:
- M
compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/text/input/NullableInputConnectionWrapperTest.kt
- M
compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/NullableInputConnectionWrapper.android.kt
Hash: 57f58c4b80d5d8470b2aca325dfdcd55f235231e
Date: Thu Oct 24 01:25:20 2024
si...@google.com <si...@google.com> #6
Many thanks again for this report. Especially for giving us a huge clue in terms of what could be going wrong. The fix is now merged and I will ask for a cherry-pick into a stable release.
mo...@google.com <mo...@google.com> #7
Do you have any concrete plan to cherry-pick the fix into current stable version (1.7.x)? We are currently waiting it.
mo...@google.com <mo...@google.com> #8
Yes, this fix is planned to be included in a future 1.7.x
release.
se...@google.com <se...@google.com> #9
Thanks for the fix. Sorry to follow up on this. is it possible for you to share specific release version/date for the stable version? We are waiting on this to decide on our direction.
se...@google.com <se...@google.com> #10
One workaround (in app code) is to save the layout position for the TextField then manually scroll a ScrollState.
ma...@google.com <ma...@google.com> #11
Coming back to this to give me 5 cents.
Modifier.scrollable
itself doesn't have any notion of layout at all, so I'm unsure if that would be the right place for it. Thing to node is that we also need to provide a proper nestedscroll support (+ account for nested scroll as well, as you want your toolbar to collapse if the textField is below the soft input, don't you?).
It seems like we would need to account for that in the scrollable implementations, e.g Modifier.verticalScroll
or LazyColumn
, as they also might want to process it differently. Some bits might live in the Modifier.scrollable
as well, but it's mostly a layout thing I suppose.
Another alternative: could it be possible to utilise semantics for this purpose? I don't know how idiomatic it would be but it seems like it is somewhat related. WE could basically ask whatever container to scroll to the bounds (which we could retrieve from the layout node) and the scroll bit will just work out of the box if the semantics are set right.
ra...@google.com <ra...@google.com>
ma...@google.com <ma...@google.com> #12
Ralston, let me know if you need any help or input from the scrolling side! Thanks!
ap...@google.com <ap...@google.com> #13
Branch: androidx-main
commit 421a738e446c6118de69765225a1508bdfd39372
Author: Ralston Da Silva <ralu@google.com>
Date: Wed May 05 06:33:28 2021
Golden images for RelocationRequester Modifier
This CL adds snapshots for the RelocationRequesterModifierTest
Bug: 178211874
Change-Id: I337d81b2176be1da4b7645b941c48c92e0d3075e
Test: ./gradlew compose:ui:ui:connectedCheck -P android.testInstrumentationRunnerArguments.class=androidx.compose.ui.layout.RelocationRequesterModifierTest
A compose/ui/ui/bringIntoParentBounds_blueBoxBottom_cuttlefish.png
A compose/ui/ui/bringIntoParentBounds_blueBoxCenterHorizontal_cuttlefish.png
A compose/ui/ui/bringIntoParentBounds_blueBoxCenterVertical_cuttlefish.png
A compose/ui/ui/bringIntoParentBounds_blueBoxLeft_cuttlefish.png
A compose/ui/ui/bringIntoParentBounds_blueBoxRight_cuttlefish.png
A compose/ui/ui/bringIntoParentBounds_blueBoxTop_cuttlefish.png
A compose/ui/ui/bringIntoParentBounds_blueBox_cuttlefish.png
A compose/ui/ui/bringIntoParentBounds_grayRectangleHorizontal_cuttlefish.png
A compose/ui/ui/bringIntoParentBounds_grayRectangleVertical_cuttlefish.png
ap...@google.com <ap...@google.com> #14
Branch: androidx-main
commit bd6db32649c6060ddead0d1f7e55636e60c9ff61
Author: Ralston Da Silva <ralu@google.com>
Date: Mon Apr 19 17:54:18 2021
Relocation Modifier
This is a modifier that can be used to bring an item into view by requesting that
all its scrollable parents scroll so that this item is visible.
Bug: 178211874
Test: ./gradlew compose:ui:ui:connectedCheck -P android.testInstrumentationRunnerArguments.class=androidx.compose.ui.layout.RelocationRequesterModifierTest
Relnote: Added Experimental Modifier.relocate()
Change-Id: I48322e5f84f5d688f92c7a397e9b1328b3824f63
M compose/ui/ui/api/1.0.0-beta08.txt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_1.0.0-beta08.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_1.0.0-beta08.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/UiDemos.kt
A compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/scroll/BringIntoParentBoundsDemo.kt
A compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/RelocationSamples.kt
A compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/RelocationRequesterModifierTest.kt
A compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/RelocationRequester.kt
A compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/RelocationRequesterModifier.kt
ap...@google.com <ap...@google.com> #15
Branch: androidx-main
commit 42303ba13af7818755606f2a3ebf931914b2b50e
Author: Ralston Da Silva <ralu@google.com>
Date: Thu May 20 15:12:54 2021
Bring item into View
This CL renames RelocationRequester.bringIntoParentBounds() to RelocationRequester.bringIntoView.
It also supports the use-case where they keyobard could be hiding the element, and brings
it into view by calling view.requestRectangleOnScreen.
Bug: 178211874
Test: ./gradlew compose:ui:ui:connectedCheck -P android.testInstrumentationRunnerArguments.class=androidx.compose.ui.layout.RelocationRequesterModifierTest
Relnote: N/A
Change-Id: I4124888de3b67fda965372380b5a166406817ce1
M compose/ui/ui/api/public_plus_experimental_1.0.0-beta08.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/UiDemos.kt
M compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/scroll/BringIntoViewDemo.kt
A compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/scroll/RequestRectangleOnScreeenDemo.kt
M compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/RelocationSamples.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/layout/RelocationRequesterModifierTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/RelocationRequester.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/RelocationRequesterModifier.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/Owner.kt
M compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopOwner.desktop.kt
M compose/ui/ui/src/test/kotlin/androidx/compose/ui/node/LayoutNodeTest.kt
ni...@google.com <ni...@google.com> #16
Bulk edit: This bug is currently marked as blocking Compose 1.0. Once rc01 is cut, all changes will need to go through our cherry-pick process.
If you intend to fix it in Compose 1.0, no action is needed except prioritizing finishing this work.
Otherwise, please remove this bug from the appropriate 1.0 hotlist (likely
Thanks!
ra...@google.com <ra...@google.com> #17
For this fix we need TextField to use RelocationRequester.bringIntoView() which is an experimental UI API, and it so it can't be fixed for Compose 1.0
ap...@google.com <ap...@google.com> #18
Branch: androidx-main
commit e40d3772b9a36196f94dfaef0483e3fc52951b53
Author: Ralston Da Silva <ralu@google.com>
Date: Fri Jun 04 18:02:01 2021
Implement bringIntoView
We initially tried to implement bringIntoView by making changes
to nested scroll. This CL adds a Modifier.onRelocationRequest
that responds to requests from Modifier.relocationRequester
more details at go/compose-bringIntoView
Bug: 178211874
Test: ./gradlew compose:ui:ui:connectedCheck -P android.testInstrumentationRunnerArguments.class=androidx.compose.ui.layout.RelocationModifierTest
Relnote: Added experimental modifier to handle relocation requests.
Change-Id: I65a97bd7fca7271781efe31fcc9cb387e9857b51
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/UiDemos.kt
M compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/scroll/BringIntoViewDemo.kt
M compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/scroll/RequestRectangleOnScreeenDemo.kt
M compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/RelocationSamples.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessorTest.kt
A compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/RelocationModifierTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/RelocationRequesterModifierTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
A compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/RelocationModifier.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/RelocationRequester.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/RelocationRequesterModifier.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
A compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/ModifiedRelocationNode.kt
A compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/ModifiedRelocationRequesterNode.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/Owner.kt
M compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/platform/DesktopOwner.desktop.kt
M compose/ui/ui/src/test/kotlin/androidx/compose/ui/node/LayoutNodeTest.kt
si...@google.com <si...@google.com>
so...@google.com <so...@google.com> #19
ap...@google.com <ap...@google.com> #20
Branch: androidx-main
commit a5c92f31181087df9a6a7100111d4248b94e75d4
Author: Zach Klippenstein <klippenstein@google.com>
Date: Fri Jan 28 12:36:11 2022
Change CoreTextField to use BringIntoViewRequester.
CoreTextField needs to ensure the cursor is in the visible bounds of all
scrollable parents, including the one in the text field itself.
Originally, it tried doing this by going through some of the text
service abstractions and ultimately calling
`View.requestRectangleOnScreen`. However, composable parents also need
to be aware of the request, so the correct way to do this is to use the
relatively recent `BringIntoViewRequester`. I'm not sure why all the
indirection through text services was done, it isn't necessary and
obscures the code, so I just made `CoreTextField` directly call
`BringIntoViewRequester.bringIntoView()`. This helps with
but doesn't completely fix it, due to
Bug:
Fixes:
Test: Tested manually.
Test: Refactored TextFieldDelegate unit tests to use the new code path:
./gradlew :compose:f:f:test
Relnote: "`notifyFocusedRect` methods in `TextInputSession` and
`TextInputService` are now deprecated and won't be called. Use
`BringIntoViewRequester` instead."
Change-Id: Ia4302c5f6ee79eec30a9f42c149da8775e1ed57e
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Focusable.kt
M compose/ui/ui-text/api/restricted_current.txt
M compose/foundation/foundation/benchmark/src/androidTest/java/androidx/compose/foundation/benchmark/text/TextFieldToggleTextTestCase.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/TextInputServiceAndroid.android.kt
A compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text/TextFieldBringIntoViewTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/input/TextInputService.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
M compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text/TextFieldDelegateTest.kt
M compose/ui/ui-text/api/public_plus_experimental_current.txt
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/TextInputServiceTest.kt
M compose/ui/ui-text/api/current.txt
ap...@google.com <ap...@google.com> #21
Branch: androidx-main
commit b47ac54b27a3e77b40f672cbcd5a713f464a4d27
Author: Zach Klippenstein <klippenstein@google.com>
Date: Thu Feb 03 12:09:04 2022
Revert removing implementations of notifyFocusedRect.
The notifyFocusedRect methods on TextInputService and TextInputSession
were deprecated and had their implementations replaced by no-ops in the
change aosp/1959647. This was probably too aggressive, so this change
adds the old implementations back in but leaves them deprecated, in case
any third-party code was calling them. The implementations were actually
broken before, and this change doesn't try to fix them, it just restores
the previous broken behavior.
Discussion thread about revert:
Bug:
Bug:
Test: Old tests restored.
Change-Id: I385749b629fd35b72bd148122ab1ec0f6d4ffa96
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/input/TextInputService.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/TextInputServiceAndroid.android.kt
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/TextInputServiceTest.kt
da...@gmail.com <da...@gmail.com> #22
Is there something that has to be done from the developer perspective for the textfield to scroll into view when the keyboard comes up to cover them?
Description
What the function does is:
- calls requestRectangle on View.
Therefore it is something that we can bubble up from current node to parents and then the View system until the provided area is visible on screen.
Not sure how compose scrollers would react to this and if it is possible.
Related tickets