Status Update
Comments
gr...@google.com <gr...@google.com>
gr...@google.com <gr...@google.com> #2
Thanks for the excellent bug report!
gr...@google.com <gr...@google.com> #3
🥰
gr...@google.com <gr...@google.com> #4
Ime is not necessary part of repro, relayout does it.
@Composable
private fun TextCrash() {
val infiniteTransition = rememberInfiniteTransition(label = "infinite transition")
val padding by infiniteTransition.animateFloat(
initialValue = 0f,
targetValue = 50f,
animationSpec = infiniteRepeatable(tween(1000), RepeatMode.Reverse),
label = "I like to move it move it"
)
Box(
modifier = Modifier
.padding(padding.toInt().dp)
.fillMaxSize(),
contentAlignment = Alignment.Center
) {
Column(verticalArrangement = Arrangement.spacedBy(12.dp)) {
Text(
text = "Hello Android!".repeat(5),
textAlign = TextAlign.Center,
letterSpacing = 1.sp,
overflow = TextOverflow.Ellipsis,
maxLines = 1
)
}
}
}
gr...@google.com <gr...@google.com> #5
This is the minimal TextStyle to repro
gr...@google.com <gr...@google.com> #6
TextStyle(
textAlign = TextAlign.Center,
letterSpacing = 1.sp,
lineHeight = 24.sp,
lineHeightStyle = LineHeightStyle(
alignment = LineHeightStyle.Alignment.Center,
trim = LineHeightStyle.Trim.None,
mode = LineHeightStyle.Mode.Fixed
),
)
pa...@partners.mbank.pl <pa...@partners.mbank.pl> #7
Fix coming. Will see if I can get it into 1.8-beta01.
pa...@partners.mbank.pl <pa...@partners.mbank.pl> #8
Amazing! That was super quick)
gr...@google.com <gr...@google.com> #9
Excellent bug report and I had some idle cycles this week :)
ap...@google.com <ap...@google.com> #10
Project: platform/frameworks/support
Branch: androidx-main
Author: Seigo Nonaka <
Link:
Fix unexpected enabling of useBoundsForWidth
Expand for full commit details
Fix unexpected enabling of useBoundsForWidth
This fixes a bug where a text may wrap to a second line where it is unnecessary.
Bug: 391378120
Test: Manual tests to ensure the unexpected wrapping stops after the fix is applied
Test: StaticLayoutFactoryTest#create_useBoundsForWidth_disabled
Test: BasicTextUnexpectedWrappingRegressionTest
Change-Id: I1b40c5816f2b4c1e787de05d5332db6fc0efad14
Files:
- A
compose/foundation/foundation/src/androidInstrumentedTest/assets/font/overshoot_test.ttx
- A
compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/BasicTextUnexpectedWrappingRegressionTest.kt
- A
compose/foundation/foundation/src/androidInstrumentedTest/res/font/overshoot_test.ttf
- M
compose/ui/ui-text/src/androidInstrumentedTest/kotlin/androidx/compose/ui/text/android/StaticLayoutFactoryTest.kt
- M
compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/android/StaticLayoutFactory.android.kt
Hash: 7d19be04e9c2af237f0605a148605bf52f607497
Date: Thu Jan 23 17:40:54 2025
pa...@partners.mbank.pl <pa...@partners.mbank.pl> #11
gr...@google.com <gr...@google.com> #12
This will be targeting 1.8
, likely landing in beta02
.
1.7.*
targets android API 34, and this fix requires API 35. Upgrading 1.7
to android api 35 is too large of a change for a 1.7.x
version.
gr...@google.com <gr...@google.com> #13
Separate note, an upstream fix in the android platform is expected in api level 36, so this issue should only occur when API level is 35 and compose version is below 1.8.
er...@gmail.com <er...@gmail.com> #14
Saw that beta02
is out but there is no mention of this issue being fixed in the release notes. Were you able to land the fix in beta02 or it got pushed to a future version?
Description
Jetpack Compose version: BOM 2024.12.01
Jetpack Compose component(s) used: Text in Material3
Android Studio Build: Meerkat Canary 9
Kotlin version: 2.1.0
Problem:
Since bumping target SDK to 35 we notice that some strings on some devices receive unintended line breaks even when the Text Composable is allowed to be as wide as it wants. Trying to force single line does not work either as setting
maxLines=1
clip the string rather than join to one line.Examples of problematic strings:
Steps to Reproduce or Code Sample to Reproduce:
Code: Attached minimal reproduction repo including our custom font
Device: Reproduced on Pixel 9 Pro XL real device and emulator using the font/display settings in attached screenshot. Also reported on but not verified: Pixel 8 Pro, Pixel Tablet
Summary of the reprod sample: Activity with the following XML:
...and the following sample code:
This will produce the result in attached screenshots.
Some findings from debugging the issue: