Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 0d2a344b8b47cd39343dd3ca0e495ac5494367b9
Author: Igor Demin <igor.demin@jetbrains.com>
Date: Thu Dec 01 10:38:07 2022
PlatformTextInputService. Undeprecate notifyFocusedRect
Fixeshttps://github.com/JetBrains/compose-jb/issues/2040
Fixeshttps://github.com/JetBrains/compose-jb/issues/2493
notifyFocusedRect was deprecated inhttps://android-review.googlesource.com/c/platform/frameworks/support/+/1959647
On Android, before deprecation this method was used to scroll to the focused text input.
This functionality was extracted to the text field itself, but we had another functionality on the other platforms.
On Desktop we show text input popup near text input (for some languages):
https://github.com/JetBrains/compose-jb/issues/2040#issuecomment-1333429514
I think that this method is the right choice to implement this functionality, but I am not completely sure. Here my thoughts about alternatives:
1. Use BringIntoViewRequester. Not sure that it is possible, because its purpose - to show the view to the user, not use the passed information to determine the text popup position
2. Get information about focused area from another source that is not related to text input. For example, we can inject FocusManager, and retrieve the focused rect from it. Probably not a good idea, because the rect of arbitrary focused node isn't the same thing as the rect of focused input area.
Bug: b/262648050
Change-Id: I23a0425b573a644fcc114a2b60d7bbbdaf5b04ed
Test: manual on Windows (./gradlew run1 -Pandroidx.compose.multiplatformEnabled=true), with Chinese keyboard layout
Relnote: `notifyFocusedRect` methods in `TextInputSession` and `TextInputService` are not deprecated again.
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/CoreTextFieldInputServiceIntegrationTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.kt
M compose/ui/ui-text/api/current.txt
M compose/ui/ui-text/api/public_plus_experimental_current.txt
M compose/ui/ui-text/api/restricted_current.txt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/input/TextInputService.kt
https://android-review.googlesource.com/2319924
Branch: androidx-main
commit 0d2a344b8b47cd39343dd3ca0e495ac5494367b9
Author: Igor Demin <igor.demin@jetbrains.com>
Date: Thu Dec 01 10:38:07 2022
PlatformTextInputService. Undeprecate notifyFocusedRect
Fixes
Fixes
notifyFocusedRect was deprecated in
On Android, before deprecation this method was used to scroll to the focused text input.
This functionality was extracted to the text field itself, but we had another functionality on the other platforms.
On Desktop we show text input popup near text input (for some languages):
I think that this method is the right choice to implement this functionality, but I am not completely sure. Here my thoughts about alternatives:
1. Use BringIntoViewRequester. Not sure that it is possible, because its purpose - to show the view to the user, not use the passed information to determine the text popup position
2. Get information about focused area from another source that is not related to text input. For example, we can inject FocusManager, and retrieve the focused rect from it. Probably not a good idea, because the rect of arbitrary focused node isn't the same thing as the rect of focused input area.
Bug:
Change-Id: I23a0425b573a644fcc114a2b60d7bbbdaf5b04ed
Test: manual on Windows (./gradlew run1 -Pandroidx.compose.multiplatformEnabled=true), with Chinese keyboard layout
Relnote: `notifyFocusedRect` methods in `TextInputSession` and `TextInputService` are not deprecated again.
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/CoreTextFieldInputServiceIntegrationTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.kt
M compose/ui/ui-text/api/current.txt
M compose/ui/ui-text/api/public_plus_experimental_current.txt
M compose/ui/ui-text/api/restricted_current.txt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/input/TextInputService.kt
Description
Components used:
Versions used:
Devices/Android versions reproduced on: Pixel 2
Setup:
The setup can be demonstrated with the following code.
Issue:
Settings
Go to about
Settings
)Result: We need to click back as many times as we visited the
About
screen.Expected result: Only 2 back clicks are needed to close the app:
Landing
Screen recording: There is an attached demo of the behaviour.