Status Update
Comments
so...@google.com <so...@google.com>
so...@google.com <so...@google.com>
pa...@google.com <pa...@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),
)
}
ae...@google.com <ae...@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
pa...@google.com <pa...@google.com> #4
#2, yeah, that's the same issue.
ae...@google.com <ae...@google.com> #5
Thanks @jo...@google.com for fixing this! Do you know when the fix would be available for g3 apps?
so...@google.com <so...@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.
ae...@google.com <ae...@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
so...@google.com <so...@google.com>
ap...@google.com <ap...@google.com> #8
Branch: androidx-main
commit e8f93a08af0f03ccb5e86b0bd157935a609737e8
Author: Filip Pavlis <pavlis@google.com>
Date: Thu Apr 29 16:31:33 2021
Use list for content description and text.
This CL changes semantics properties of contentDescrtiption and text to
be lists instead of single values. This avoids the need having to join
them via comma during merging which erases useful information.
Bug: 184825850
Test: Added
Relnote: "ContentDescription and Text semantics properties are no longer
single values but lists. This enables to merge them as they are instead
of concatenations. Also provided better testing APIs to utilize these
changes"
Change-Id: Ica6bf4236d05b97357c18fb306a6305877a349f7
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ImageTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/IconTest.kt
M compose/ui/ui-inspection/src/androidTest/java/androidx/compose/ui/inspection/ParametersTest.kt
M compose/ui/ui-inspection/src/androidTest/java/androidx/compose/ui/inspection/inspector/LayoutInspectorTreeTest.kt
M compose/ui/ui-test/api/1.0.0-beta08.txt
M compose/ui/ui-test/api/current.ignore
M compose/ui/ui-test/api/current.txt
M compose/ui/ui-test/api/public_plus_experimental_1.0.0-beta08.txt
M compose/ui/ui-test/api/public_plus_experimental_current.txt
M compose/ui/ui-test/api/restricted_1.0.0-beta08.txt
M compose/ui/ui-test/api/restricted_current.ignore
M compose/ui/ui-test/api/restricted_current.txt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/AssertsTest.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/ErrorMessagesTest.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/FindersTest.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/PrintToStringTest.kt
A compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/assertions/AssertContentDescription.kt
A compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/assertions/AssertText.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Assertions.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Filters.kt
M compose/ui/ui/api/1.0.0-beta08.txt
M compose/ui/ui/api/current.ignore
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_1.0.0-beta08.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_1.0.0-beta08.txt
M compose/ui/ui/api/restricted_current.ignore
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/AndroidAccessibilityTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/semantics/SemanticsTests.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsProperties.kt
pa...@google.com <pa...@google.com> #9
This was now fixed by using lists for content description & text. Test API's are now a bit smarter as they can use the lists.
This changes is breaking but was pre-approved in
I did several experiments locally and also waited for our CI to trigger any alerts afterwards and concluded that this change had no measurable impact on our benchmarks.
so...@google.com <so...@google.com> #10
Oops, I kept this ticket to track a11y work that we're currently doing. I'll create a new one :)
pa...@google.com <pa...@google.com> #11
Ops, sorry about that.
Description
In changed changing testing behavior. For example this test no longer passes:
beta04
semantics mergingComposable
With the changes in
beta04
theIcon
s content description is no longer merged to the parentFloatingActionButton
so it does not appear in the merged semantics tree.