Fixed
Status Update
Comments
gr...@google.com <gr...@google.com>
so...@google.com <so...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
Author: Anastasia Soboleva <
Link:
Include minLines in the calculation of the intrinsics height
Expand for full commit details
Include minLines in the calculation of the intrinsics height
maxLines is included in the intrinsics height calculation because on measure we pass the maxLines to the platform. minLines can't be pass as an argument to the platform's measure object.
So instead we coerce the platform's measured intrinsics height so it's at least as small as the height required to satisfy the minLines.
Fixes: 388299762
Relnote: "Text's minimum intrinsics height now takes `minLines` parameter into account. It means that minimum intrinsics height reported won't be smaller than the height required to satisfy the `minLines` parameter"
Test: new test minIntrinsicsHeight_respectsMinLines + demo
Change-Id: I225f910dcbff2292d045ffac0750544d4601eeba
Files:
- M
compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/modifiers/MultiParagraphLayoutCacheTest.kt
- M
compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/modifiers/ParagraphLayoutCacheTest.kt
- M
compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/modifiers/MultiParagraphLayoutCache.kt
- M
compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/modifiers/ParagraphLayoutCache.kt
Hash: 051a947e5a472d659422bb72ed7c58ab5c420c4b
Date: Thu Jan 09 16:03:25 2025
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
Author: Anastasia Soboleva <
Link:
Fix MinLinesConstrainer caching issue
Expand for full commit details
Fix MinLinesConstrainer caching issue
We cache a previously computed MinLinesConstrainer. When we check if the params changed so we can return the cached value, we compare style with which the "from" is called with the styles that the cached constrainer is created with. The only issue is that when we create a constrainer, we resolve the defaults in ctor. So we end up in a situation where we always compare raw style with resolved defaults style resulting into cache miss even when the style that the `MinLinesConstrainer.from` is called is identical.
Bug: 388299762
Test: new MinLinesConstrainerTest
Change-Id: Ie5237548a60b154b6e927406cc108ee7bc7432c6
Files:
- A
compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/modifiers/MinLinesConstrainerTest.kt
- M
compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/modifiers/MinLinesConstrainer.kt
Hash: 419e42e3a92aefef5ed93d05b46ef0c6215f1854
Date: Tue Jan 21 16:12:00 2025
na...@google.com <na...@google.com> #4
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
Description
Steps to Reproduce or Code Sample to Reproduce:
The code below should produce a text component 2 lines tall. However it is only 1 line tall. Removing the modifier makes it correctly 2 lines tall.
Repro code:
This issue makes it that if any parent container applies this modifier, the text is measured incorrectly, breaking the UI.
Jetpack Compose version:
2024.12.01
BOMJetpack Compose component(s) used:
BasicText
/Text
andModifier.height(IntrinsicSize)
Android Studio Build: Build #AI-242.23339.11.2421.12700392, built on November 22, 2024
Kotlin version:
2.0.21