Fixed
Status Update
Comments
jo...@google.com <jo...@google.com>
xb...@google.com <xb...@google.com> #2
Thanks for the excellent bug report!
jo...@google.com <jo...@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
)
}
}
}
xb...@google.com <xb...@google.com> #5
This is the minimal TextStyle to repro
jo...@google.com <jo...@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
),
)
na...@google.com <na...@google.com> #7
Fix coming. Will see if I can get it into 1.8-beta01.
Description
- Jetpack Compose component used: BasicText
- Android Studio Build: Ladybug | 2024.2.1 Patch 2
- Kotlin version: 2.0.0
I tested out `androidx.compose.foundation:foundation:1.8.0-alpha05` and noticed that `BasicText` with an `autoSize` argument just cuts off the text with `maxLines` set to 1.
On Android Views, when using `android:autoSizeTextType="uniform"` and `android:maxLines="1"`, the `TextView` properly sizes down until the min text size is reached.
```
<LinearLayout
android:layout_width="15dp"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoSizeTextType="uniform"
android:autoSizeMinTextSize="2sp"
android:autoSizeMaxTextSize="14sp"
android:maxLines="1"
android:text="Test" />
</LinearLayout>
```
```
Box(Modifier.width(15.dp)) {
BasicText("Test", autoSize = AutoSize.StepBased(2.sp, 14.sp), maxLines = 1)
}
```