Status Update
Comments
pe...@abc.net.au <pe...@abc.net.au> #2
removed the dup; this is possibly about how android spans work on empty strings.
- the calculation in the composable level seemed correct but the layout was not
- it happens for a new line as well
- one problem with both includeFontPadding true/false is that the cursor height is possibly can be visually improved to match the text ascent/descent rather than line top/bottom (might be challenging)
al...@google.com <al...@google.com>
ca...@google.com <ca...@google.com> #3
I do not fully understand your points, though I was wondering if a similar "trick" to measure "HHHHHHHHHHH" cannot be used here, because if I'm not mistaken the cursor gets drawn by text layout measuring on empty string.
pe...@abc.net.au <pe...@abc.net.au> #4
StaticLayout does not call LineHeightSpan's for empty sstring (or the empty final line at the end of the string - a string that ends with "\n")
[Deleted User] <[Deleted User]> #5
Branch: androidx-main
commit b7a67dc25a34b254adbaffd02495b5c6d26ee18c
Author: siyamed <siyamed@google.com>
Date: Thu Jul 28 08:06:35 2022
Fix TextField empty line lineHeight (2)
When a line is empty (including empty text) StaticLayout
does not apply the LineHeightSpans.
This causes the line height to be different for an empty
line compared to a non empty line. The issue becomes more
visible within TextField .
This CL stores adjustment values to report the height and the
last line metrics correctly.
For the other solution option please see aosp/2170504
Performance
There are no performance differences for cases where text
is not empty or does not end with "\n"
The below numbers are for the cases where text is empty or ends with "\n"
+--------+-----------+-----------+------+
| | Before | After | Diff |
+--------+-----------+-----------+------+
| length | ns | ns | ns |
| 0 | 115,835 | 180,161 | 56% |
| 16 | 395,679 | 484,748 | 23% |
| 32 | 513,235 | 590,783 | 15% |
| 64 | 807,133 | 901,896 | 12% |
| 128 | 1,330,733 | 1,421,371 | 7% |
| 256 | 2,338,534 | 2,464,810 | 5% |
+--------+-----------+-----------+------+
Test: Added test
Test: ./gradlew text:text:test
Test: ./gradlew text:text:cAT
Test: ./gradlew compose:ui:ui-text:test
Test: ./gradlew compose:ui:ui-text:cAT
Test: Treehugger
Bug: 236615813
Change-Id: I57f8b6632f569ad06e547cf6ec83df1bc42845c9
M compose/ui/ui-text/lint-baseline.xml
M compose/ui/ui-text/benchmark/src/androidTest/java/androidx/compose/ui/text/benchmark/input/EditProcessorBenchmark.kt
M compose/ui/ui-text/benchmark/src/androidTest/java/androidx/compose/ui/text/benchmark/ParagraphBenchmark.kt
M compose/ui/ui-text/benchmark/src/main/java/androidx/compose/ui/text/benchmark/TextBenchmarkHelper.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/ParagraphIntegrationLineHeightStyleTest.kt
M text/text/src/main/java/androidx/compose/ui/text/android/style/LineHeightStyleSpan.kt
A compose/ui/ui-text/benchmark/src/androidTest/java/androidx/compose/ui/text/benchmark/ParagraphWithLineHeightBenchmark.kt
M text/text/src/main/java/androidx/compose/ui/text/android/TextLayout.kt
M compose/ui/ui-text/benchmark/src/androidTest/java/androidx/compose/ui/text/benchmark/TextMeasurerBenchmark.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/extensions/SpannableExtensions.android.kt
wb...@gmail.com <wb...@gmail.com> #6
Thank you for fixing this. Will be this cherry-picked to 1.2.x release?
fr...@gmail.com <fr...@gmail.com> #7
da...@gmail.com <da...@gmail.com> #8
pa...@outlook.com <pa...@outlook.com> #9
Another incredibly "smart" decision to encourage developers to drop this new API completely dead on the floor and keep using their custom made splash screens. Nowhere in the documentation is this even explained, nor is there any reason presented that justifies such unexpected difference across APIs, and no valid explanation why this should be an intended behavior in API 31+ when we are clearly expecting to see the splash screen icon when the app starts cold, regardless of the launching method.
Good thing I managed to come across this aberration before we integrated it further in our apps, as of now this new API will be completely dropped and we will definitely continue using our own Splash Screen implementation.
It's so disappointing to continue watching you guys continue doing absolutely unreasonably terrible decisions every single time something new is out. And it's not for the lack of feedback, which is what you guys ask us for, it's because once you have it, like in this case, you completely ignore it for what I can only assume to be attributed to pure laziness.
Such a disappointment once again.
pa...@outlook.com <pa...@outlook.com> #10
It's a general consensus
And it does not help that you keep hiding issues that others have opened to help us know what the progress is on those, they are all being set to private.
pa...@outlook.com <pa...@outlook.com> #11
FYI for anyone trying to get rid of the default splash screen that is completely forced in API 31+, you can set the style attributes to transparent and your splash screen theme as post theme, and force it to skip it entirely by triggering a UI draw.
Again we have to use hacks because Google devs thought that on top of making splash screen easier for us, they should also prevent us from opting out for no good reason whatsoever.
It is very sad to see Android app development being forced to become just web apps basically. Generic splash screen, limited functionalities, and so on.. Might just as well turn our apps into web apps and abandon this field of software development.
aq...@gmail.com <aq...@gmail.com> #12
as...@gmail.com <as...@gmail.com> #13
es...@gmail.com <es...@gmail.com> #14
sh...@spirehubs.com <sh...@spirehubs.com> #15
rm...@touchtunes.com <rm...@touchtunes.com> #16
<item name="android:windowSplashScreenBehavior" tools:targetApi="33">icon_preferred</item>
ja...@gmail.com <ja...@gmail.com> #17
sh...@gmail.com <sh...@gmail.com> #18
"For someone who had issues, I solved it by doing:
<item name="android:windowSplashScreenBehavior" tools:targetApi="33">icon_preferred</item>
Worked for 33 (Thanks) but not sure if how fix this issue versions below.
Description
Version used: 1.0.0-alpha01
Devices/Android versions reproduced on: Android 12
When launching the app from the launcher without the task being in memory the splash displays with the correct icon shown. When launching from the launcher or a notification intent with the app still in memory no splash displays which is desired. However, when launching from a notification intent when there is no existing app task in memory, the splash screen displays but the icon doesn't. This is similar to the behaviour described in
In my case the notification intent has no flags set and the activity the intent directs to also has no flags set, specifies the splash screen theme, and handles the splash screen installation.