Status Update
Comments
yi...@google.com <yi...@google.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),
)
}
so...@google.com <so...@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
cl...@google.com <cl...@google.com> #4
#2, yeah, that's the same issue.
ma...@google.com <ma...@google.com> #5
Thanks @jo...@google.com for fixing this! Do you know when the fix would be available for g3 apps?
ma...@google.com <ma...@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.
yi...@google.com <yi...@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
ap...@google.com <ap...@google.com> #8
Branch: androidx-main
commit 8dddaeb8d6af1e2c6ae4518376132d8c00d3cf97
Author: Anastasia Soboleva <soboleva@google.com>
Date: Wed Apr 07 16:17:46 2021
Add Collection(Item)Info semantics API
Any lazy list by default will report "-1" as the number of elements because we can't calculate correctly the number of elements that should be reported for a11y.
When `Modifier.selectableGroup()` is used with lazy lists, we won't report anymore only visible elements on the screen.
Test: new tests, manually with Talkback on
Bug: 180479017
Relnote: "Added CollectionInfo and CollectionItemInfo accessibility APIs that allows to mark collection and its items for accessibility services"
Change-Id: Id54ef37379e14e41ac52782b40e29de54f95eed0
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyList.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/selection/SelectableGroup.kt
M compose/material/material/integration-tests/material-demos/src/main/java/androidx/compose/material/demos/BottomNavigationDemo.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TabRow.kt
M compose/ui/ui/api/1.0.0-beta06.txt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_1.0.0-beta06.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_1.0.0-beta06.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/AndroidComposeViewAccessibilityDelegateCompatTest.kt
A compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/accessibility/CollectionInfoTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt
A compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/accessibility/CollectionInfo.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsProperties.kt
Description
We have a
selectableGroup
modifier for non-lazy lists which iterates through all the 'selectable' nodes to get the indices and number of elements (to setCollectionInfo
andCollectionItemInfo
). Obviously, this does not play well with lazy lists as it only reports the number of visible elements.We need to figure out what it the right approach/API for lazy lists.