Status Update
Comments
si...@google.com <si...@google.com>
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>
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.
no...@google.com <no...@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>
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.
si...@google.com <si...@google.com>
si...@google.com <si...@google.com>
si...@google.com <si...@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.
si...@google.com <si...@google.com>
si...@google.com <si...@google.com>
si...@google.com <si...@google.com>
si...@google.com <si...@google.com>
ub...@gmail.com <ub...@gmail.com> #8
Yes, this fix is planned to be included in a future 1.7.x
release.
[Deleted User] <[Deleted User]> #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.
ub...@gmail.com <ub...@gmail.com> #10
Related issue regarding styled string resources:
In particular, internationalization concerns described in
gr...@google.com <gr...@google.com> #11
If this ever does get implemented, note that it would be nice to have the cursor icon change when hovering over a link.
aa...@marinosoftware.com <aa...@marinosoftware.com> #12
@#8 They said it's due to be finished in June. What year is anyone's guess.
si...@google.com <si...@google.com>
so...@google.com <so...@google.com>
so...@google.com <so...@google.com>
so...@google.com <so...@google.com>
ap...@google.com <ap...@google.com> #13
Branch: androidx-main
commit f87f07f58309f38933b32309e93a944420a185be
Author: Anastasia Soboleva <soboleva@google.com>
Date: Thu Mar 28 15:06:28 2024
Implement links interactiom listeners and styling through annotation only
LinkInteractionListener is set on LinkAnnotation. Currently only has a click function but is a fun interface. In the future can be extended to support onHover or other interactions that are needed. Note that Clickable should ideally have it non-null but this wouldn't work as we need to restore it.
LinkAnnotation now takes the style, focusStyle and hoverStyle.
Test: ui:ui-text:test, ui:ui-text:cC, f:f:cC in text folder
Relnote: "LinkAnnotation now takes the state-based styling arguments and a LinkInteractionListener. Add this annotation to the AnnotatedString to get a hyperlink. By passing focusedState and/or hoveredState you can define the visual conficuration for links when they are focused and/or hovered."
Bug: 139312671
Change-Id: I81ce4350b8a1e37881000fd82f081b7afb8e0f42
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/Hyperlinks.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/BasicTextLinkTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/BasicTextSemanticsTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/BasicText.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextLinkScope.kt
M compose/ui/ui-text/api/api_lint.ignore
M compose/ui/ui-text/api/current.txt
M compose/ui/ui-text/api/restricted_current.txt
M compose/ui/ui-text/samples/src/main/java/androidx/compose/ui/text/samples/AnnotatedStringBuilderSamples.kt
M compose/ui/ui-text/src/androidInstrumentedTest/kotlin/androidx/compose/ui/text/AnnotatedStringFromHtmlTest.kt
M compose/ui/ui-text/src/androidInstrumentedTest/kotlin/androidx/compose/ui/text/platform/AndroidAccessibilitySpannableStringTest.kt
M compose/ui/ui-text/src/androidUnitTest/kotlin/androidx/compose/ui/text/AnnotatedStringBuilderTest.kt
M compose/ui/ui-text/src/androidUnitTest/kotlin/androidx/compose/ui/text/SaversTest.kt
M compose/ui/ui-text/src/androidUnitTest/kotlin/androidx/compose/ui/text/input/TextFieldValueTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/AnnotatedString.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/LinkAnnotation.kt
A compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/LinkInteractionListener.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/Savers.kt
ap...@google.com <ap...@google.com> #14
Branch: androidx-main
commit efd00b74fb310a1dc2ec3881c1539fb9a447eaef
Author: Anastasia Soboleva <soboleva@google.com>
Date: Wed Apr 03 18:16:26 2024
Add TextDefaults object to material and material3
It provides methods to construct AnnotatedString from the html string and LinkAnnotation where links will get their styling according to the Material theme
TextDefaults.Url() and TextDefaults.Clickable() composable functions that don't return Unit should normally start with lower case letter. But these are factory methods, they are upper-cased to imitate the LinkAnnotation.Url constructor.
Test: TextTest
Test: demo
Bug: 139312671
Relnote: "Added a TextDefaults object that contains methods to construct a LinkAnnotation and parse HTML-tagged string which apply MaterialTheme to the links"
Change-Id: I98532f3512d1930416f66dd195746eeeba884497
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/Hyperlinks.kt
M compose/material/material/api/api_lint.ignore
M compose/material/material/api/current.txt
M compose/material/material/api/restricted_current.txt
M compose/material/material/build.gradle
M compose/material/material/lint-baseline.xml
A compose/material/material/samples/src/main/java/androidx/compose/material/samples/TextSamples.kt
M compose/material/material/src/androidInstrumentedTest/kotlin/androidx/compose/material/TextTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Text.kt
M compose/material3/material3/api/api_lint.ignore
M compose/material3/material3/api/current.txt
M compose/material3/material3/api/restricted_current.txt
M compose/material3/material3/lint-baseline.xml
A compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/TextSamples.kt
M compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/TextTest.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Text.kt
ap...@google.com <ap...@google.com> #15
Branch: androidx-main
commit c70a4c6be82ef1bcc338b20d663b55545caebdf9
Author: Anastasia Soboleva <soboleva@google.com>
Date: Thu Apr 04 14:47:32 2024
Update LinkAnnotation savers to save/restore styles
Added demo that creates a custom listener. We should eventually add some edit/replace methods to the AnnotatedString
to make things like this easier to implement.
Bug: 139312671
Test: SaversTest
Test: demo
Change-Id: I3613a30733ba87321e4cb72a3414c0f9522ad529
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/Hyperlinks.kt
M compose/ui/ui-text/src/androidUnitTest/kotlin/androidx/compose/ui/text/SaversTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/AnnotatedString.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/Savers.kt
ap...@google.com <ap...@google.com> #16
Branch: androidx-main
commit 703f585278dc1f9343659fd2ffa1b415e4366ba7
Author: Anastasia Soboleva <soboleva@google.com>
Date: Fri Apr 05 15:45:22 2024
Update a11y support for links in text
Fixes: 139312671
Test: demo with Talkback on
Test: AndroidAccessibilitySpannableStringTest
Change-Id: I11ef6b96dc1f791dd266e6cb5100f265ac6c2456
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/Hyperlinks.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/BasicTextSemanticsTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextLinkScope.kt
M compose/ui/ui-text/src/androidInstrumentedTest/kotlin/androidx/compose/ui/text/platform/AndroidAccessibilitySpannableStringTest.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidAccessibilitySpannableString.android.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/URLSpanCache.android.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt
ap...@google.com <ap...@google.com> #17
Branch: androidx-main
commit 9b67b3756698b4bfa17b9060908daa5da950d250
Author: Anastasia Soboleva <soboleva@google.com>
Date: Wed Apr 10 12:20:08 2024
Add pressed styling to the link
We now basically support similar styling options as web. We don't have "visited"
which is to be handled by developers if needed. This CL adds missing pressed styling option which corresponds to "active" in css.
Test: compose:f:f:cC, compose:ui:ui-text:cC
Test: demo
Bug: 139312671
Relnote: "Text links got pressed state styling option in addition to normal styling, hovered and focused"
Change-Id: I5f864b3fd1b1af6ff39dee03e1aa65ede7e16d32
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/Hyperlinks.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/BasicTextLinkTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextLinkScope.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Text.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Text.kt
M compose/ui/ui-text/api/api_lint.ignore
M compose/ui/ui-text/api/current.txt
M compose/ui/ui-text/api/restricted_current.txt
M compose/ui/ui-text/src/androidInstrumentedTest/kotlin/androidx/compose/ui/text/AnnotatedStringFromHtmlTest.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/Html.android.kt
M compose/ui/ui-text/src/androidUnitTest/kotlin/androidx/compose/ui/text/SaversTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/Html.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/LinkAnnotation.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/Savers.kt
M compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/Html.skiko.kt
ap...@google.com <ap...@google.com> #18
Branch: androidx-main
commit 04ffaa7cede823e9e17ceb68dce1e4583c84ccb3
Author: Anastasia Soboleva <soboleva@google.com>
Date: Wed Apr 10 12:34:58 2024
Add pressed styling for links in material/material3
Test: TextTest
Bug: 139312671
Relnote: "Text links got pressed state styling option in addition to normal styling, hovered and focused. TextDefaults methods each got a pressedStyle argument to support that."
Change-Id: Ic473f81fd32d95ad84d6bc452c8dcbf6de7ba4ba
M compose/material/material/api/api_lint.ignore
M compose/material/material/api/current.txt
M compose/material/material/api/restricted_current.txt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Text.kt
M compose/material3/material3/api/current.txt
M compose/material3/material3/api/restricted_current.txt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Text.kt
na...@google.com <na...@google.com> #19
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.7.0-alpha07
androidx.compose.foundation:foundation-android:1.7.0-alpha07
androidx.compose.foundation:foundation-desktop:1.7.0-alpha07
androidx.compose.material:material:1.7.0-alpha07
androidx.compose.material:material-android:1.7.0-alpha07
androidx.compose.material:material-desktop:1.7.0-alpha07
androidx.compose.material3:material3:1.3.0-alpha05
androidx.compose.material3:material3-android:1.3.0-alpha05
androidx.compose.material3:material3-desktop:1.3.0-alpha05
androidx.compose.ui:ui:1.7.0-alpha07
androidx.compose.ui:ui-android:1.7.0-alpha07
androidx.compose.ui:ui-desktop:1.7.0-alpha07
androidx.compose.ui:ui-text:1.7.0-alpha07
androidx.compose.ui:ui-text-android:1.7.0-alpha07
androidx.compose.ui:ui-text-desktop:1.7.0-alpha07
Description
We have the Linkify and LinkifyCompat classes. Moreover, URLSpan on android handles the visual aspects of the links and also touch handling.
However, the current system suffers a lot from a few behaviors:
- linkify using patterns make text processing slow
- the developer had no control over the creation of URLSpans which caused them not to be able to have custom logic on click.
On android hyperlinks can be styled at the widget level.
This ticket is for the first step of hyperlink support which enables the display of hyperlinks.
related document: