Status Update
Comments
gs...@gmail.com <gs...@gmail.com> #2
Hi,
I also see my text cut off when I set maxLines = 2
. Is it the same issue?
Box(
modifier =
Modifier.size(
width = 108dp,
height = 34dp,
),
contentAlignment = Alignment.Center,
) {
BasicText(
text = "text text text",
maxLines = 2,
autoSize = AutoSize.StepBased(minFontSize = 1.sp, maxFontSize = 13.sp, stepSize = 0.2.sp),
)
}
cl...@google.com <cl...@google.com>
an...@google.com <an...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
Author: Jossi Wolf <
Link:
Fix TextAutoSize bug with maxLines = 1
Expand for full commit details
Fix TextAutoSize bug with maxLines = 1
We were overcaching the paragraphIntrinsics in MultiParagraphLayoutCache when mutating the style. For `AutoSizeStepBased` instances with biased windows (more values smaller/bigger than the optimal), this could result in performing layout with outdated intrinsics, and thus an outdated style and font size, without surfacing this in the TextLayoutResult.
Test: New MultiParagraphLayoutCacheTests and manual testing
Relnote: Fixed a bug in BasicText with TextAutoSize and maxLines set to 1.
Fixes: 376834366
Change-Id: Ic0450c763c5d764492995b44ee1fe570246a9689
Files:
- M
compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/modifiers/MultiParagraphLayoutCacheTest.kt
- M
compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/modifiers/MultiParagraphLayoutCache.kt
Hash: e1b712d78cc60384ed67a56c006148291ba146a6
Date: Tue Jan 07 18:52:26 2025
gs...@gmail.com <gs...@gmail.com> #4
#2, yeah, that's the same issue.
ap...@google.com <ap...@google.com> #5
Thanks @jo...@google.com for fixing this! Do you know when the fix would be available for g3 apps?
ap...@google.com <ap...@google.com> #6
Moving the internal discussion offline. The bug is fixed and the fix available in snapshot builds. We will comment on this issue when the bug fix is included in a release.
an...@google.com <an...@google.com> #7
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.8.0-beta01
androidx.compose.foundation:foundation-android:1.8.0-beta01
androidx.compose.foundation:foundation-jvmstubs:1.8.0-beta01
androidx.compose.foundation:foundation-linuxx64stubs:1.8.0-beta01
al...@mercari.com <al...@mercari.com> #8
Thanks for your efforts improving the performance of the lazy lists! I was able to observe some improvements.
However it's still slow from my testing on alpha05. I tried removing the image loading (which I was loading with Glide) and just replaced them with Box(Modifier.background(DsToken.colors.backgroundSecondary)
and the )(slow) performance is around the same for the initial scroll.
It seems, when all items have been rendered, it starts to scroll smoothly. So I supposed there's something slow with the initial composition for each of the lazy item. Before, the scrolling was just slow throughout the whole app session.
an...@google.com <an...@google.com> #9
maybe if you can create a working repro sample app which I can check out and debug more?
Description
Version of Gradle Plugin: gradle:4.2.0-alpha09
OS: Android 9
Compose version : 1.0.0-alpha02
Kotlin compiler: 1.4.0
Problem
When I use LazyColumnFor and try to drag all the list to the end or do a fast drag between items it seems like its choppy and not smooth, if I drag till the end it will glitch on the last item
Example
@Composable
fun RecipeColumnListDemo(recipeList:List<Recipe>){
LazyColumnFor(items = recipeList) { item ->
RecipeCard(recipe = item)
}
}
where RecipeCard(recipe) loads images sincronously
@Composable
private fun RecipeCard(recipe: Recipe){
val image = imageResource(R.drawable.header)
Surface(shape = RoundedCornerShape(8.dp),elevation = 8.dp,modifier = Modifier.padding(8.dp)) {
Column(modifier = Modifier.padding(16.dp)) {
val imageModifier = Modifier.preferredHeight(150.dp).fillMaxWidth().clip(shape = RoundedCornerShape(8.dp))
Image(asset = image,modifier = imageModifier,contentScale = ContentScale.Crop)
Spacer(modifier = Modifier.preferredHeight(16.dp))
Text(text = recipe.title,style = typography.h6)
for(ingredient in recipe.ingredients){
Text(text = "* $ingredient",style = typography.body2)
}
}
}
}
I have also changed the way I load images with loadImageResource, but its also not a smooth scroll when I fast drag to the end of the list
Is this issue on my side ?
I have tried JetChat and it uses a ScrollableColumn which the scrolling is smoother than the the LazyColumnFor
Video: