Status Update
Comments
jo...@google.com <jo...@google.com>
ha...@google.com <ha...@google.com> #2
Thanks for reporting this!
The intention here was for parentWidth
to be hidden and it will be fixed soon. I see the potential convenience of exposing parentWidth
and parentHeight
, but in general it leads to a not very clean data flow: it would mean that after telling the layout system my size I receive the size back although my initial calculation is still in scope. I am afraid this would bring more confusion than convenience longer term.
Just as a background, the reason we have parentWidth
and not parentHeight
is that it is needed to calculate horizontally mirrored positioning of children for layout direction RTL when placeRelative
is used.
ma...@gmail.com <ma...@gmail.com> #3
Branch: androidx-master-dev
commit 36b705d1dd148fc57e8089a94d485e0bfcd05d0f
Author: Mihai Popa <popam@google.com>
Date: Mon Sep 14 11:59:30 2020
Hide parentWidth and parentLD in PlacementScope
When writing a custom layout, parentWidth and parentLayoutDirection
should not be read from the placement block as they are available or
calculated in the measure block. This CL is making them protected in
PlacementScope. The CL also merges the PlacementScope implementations
used for modifiers and layout nodes, which is now possible after the
modules' merging.
Relnote: PlacementScope#parentWidth and PlacementScope#parentLayoutDirection can no longer be read from the placement block of a custom layout.
Fixes: 168295623
Test: tests in foundation-layout
Change-Id: Icc1ae00d774147c5fa7006c4bb408c99c7731690
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/src/commonMain/kotlin/androidx/compose/ui/MeasureScope.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/Placeable.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/LayoutNode.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/OuterMeasurablePlaceable.kt
to...@gmail.com <to...@gmail.com> #4
I actually found a reason for exposing both parentWidth
and parentHeight
in PlacementScope
and that is modifiers. I wanted to write a modifier that places a composable using a percent which requires access to the parent's size. This currently does not seem possible using modifiers.
ap...@google.com <ap...@google.com> #5
Note that parentWidth
was referring to the size of the current modifier (the same one returned when calling layout
), not to the size of the parent.
In general there would be a way to extend the layout system to provide the info you are looking for (the size of our parent when placing our children). However, I do not think this would be a good idea because modifiers relying on the parent size would not be nicely composable. I can write a modifier that positions children at a percentage of the parent but what if before me there is a modifier that offsets me? The percentage will not work anymore for my content.
ha...@google.com <ha...@google.com> #6
Hmm. I see that as completely valid though. You might want to place it in the center but offset X a number of DP.
But I understand there might be other complexities. I was just surprised there was no way to write such a modifier today.
ke...@mercari.com <ke...@mercari.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.
ha...@google.com <ha...@google.com> #8
Yes, this fix is planned to be included in a future 1.7.x
release.
ka...@mercari.com <ka...@mercari.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.
Description
Environment:
Issue Summary:
In Jetpack Compose 1.7, when using the POBox IME on Xperia devices, certain Japanese characters such as small characters (e.g., "っ", "ゃ", "ゅ", "ょ") and diacritic marks (dakuten, handakuten) cannot be input into a
TextField
. Additionally, toggle input (e.g., pressing 'あ' multiple times to switch to 'い', 'う', etc.) does not work as expected.Steps to Reproduce or Code Sample to Reproduce:
TextField
.For a detailed demonstration of the issue, please refer to the attached reproduction video.
Actual Results:
Expected Results:
Reproduction Rate:
100%
This issue occurs every time under the described conditions.
Environment:
TextField
is used.Additional Information:
According to our investigation, POBox is pre-installed on Xperia devices up to the Xperia 1, released in 2019 (https://www.sony.jp/xperia/xperia/xperia1/?srsltid=AfmBOoox1BTdp0e7TprBv0hcGsft9wxrpNf_-KepPYoCqf6QgXX6axE1 ). As a result, this issue could affect a significant number of Android users in Japan.
While we suspect the issue may be related to the combination of Xperia devices and POBox, we would greatly appreciate your investigation into a potential solution or workaround within Jetpack Compose.
Workaround Attempted:
As a workaround for this issue, we attempted to directly use
EditText
withinAndroidView
by utilizingViewBinding
in the Compose environment. However, we encountered another issue in our project that prevented us from using this workaround effectively.It would be greatly appreciated if you could also prioritize investigating and addressing this issue. Here is the link to the related issue:
https://partnerissuetracker.corp.google.com/issues/369354336#comment4
Sample App to Reproduce:
https://github.com/yurihondo/screentransitionsample
You can reproduce the issue using this app:
Please especially check the implementation at the following location:
https://github.com/yurihondo/screentransitionsample/blob/c71e4d6f41c76cdeb8a359e3cc6938a5250ac5da/feature/applepie/src/main/java/com/yurihondo/screentransitionsample/applepie/EditRoute.kt#L76