Status Update
Comments
gr...@google.com <gr...@google.com>
gr...@google.com <gr...@google.com> #2
I cannot repro this exactly do you need?
var isRefreshing by rememberSaveable { mutableStateOf(false) }
I think my latest change helps with these kind of issues too
But It hasn't been released yet.
Any chance you can upload the full sample on github, so I can double check?
gr...@google.com <gr...@google.com> #3
gr...@google.com <gr...@google.com> #5
Thanks I think I was able to identify the issue and a potential fix
gr...@google.com <gr...@google.com> #6
Branch: androidx-main
commit f1515ea14143b5754df3dcbcb47537eee49c30f2
Author: Mariano Martin <ymarian@google.com>
Date: Thu Sep 05 13:12:04 2024
[PullToRefresh] Fix issue where graphics layer doesnt invalidate
Test: tested manually that now graphics layer invalidates, in some edge cases
where pullToRefresh is used in fragments
Bug: 356039090
Change-Id: Ib80663f6dcf2f7f05bda4189b0931ee697230698
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/pulltorefresh/PullToRefresh.kt
pa...@partners.mbank.pl <pa...@partners.mbank.pl> #7
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material3:material3:1.4.0-alpha01
androidx.compose.material3:material3-android:1.4.0-alpha01
pa...@partners.mbank.pl <pa...@partners.mbank.pl> #8
Project: platform/frameworks/support
Branch: androidx-main
Author: Mariano Martin <
Link:
[WideNavigationRail] API Feedback
Expand for full commit details
[WideNavigationRail] API Feedback
Update State classes to use booleans, and current/target value.
Change expect/actual properties constructor.
Test: existing tests
Relnote: Change WideNavigationRailState to have current/target value, remove enums in favor of boolean.
Bug: 356039090
Change-Id: Idfa29aad7efd1d0e943bf175f5bcb1fc347fdf0e
Files:
- M
compose/material3/benchmark/src/androidTest/java/androidx/compose/material3/benchmark/NavigationRailBenchmark.kt
- M
compose/material3/material3/api/current.txt
- M
compose/material3/material3/api/restricted_current.txt
- M
compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/NavigationRailSamples.kt
- M
compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ModalWideNavigationRailScreenshotTest.kt
- M
compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ModalWideNavigationRailTest.kt
- M
compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/WideNavigationRailScreenshotTest.kt
- M
compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/WideNavigationRailTest.kt
- M
compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/WideNavigationRail.android.kt
- M
compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/WideNavigationRail.kt
- M
compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/WideNavigationRailState.kt
- M
compose/material3/material3/src/commonStubsMain/kotlin/androidx/compose/material3/WideNavigationRail.commonStubs.kt
Hash: 724c3f7eb85d05c92ce724d5c529f579d771edd4
Date: Mon Nov 18 13:19:35 2024
gr...@google.com <gr...@google.com> #9
I don't recommend this, but if you really need a workaround right now, here it is. This is probably quite brittle, slow, and I have not tested it other than checking that it does fix the bug. Use at your own risk. The actual fix for this is expected in 1.8.0-beta02
.
A very hacky workaround would be adding this modifier to the end of your Text
's modifier chain:
/** Intercept pre-layout to manually recycle `StaticLayout.Builder.useBoundsForWidth`. */
private fun Modifier.unexpectedTextWrappingWorkaround(): Modifier =
layout { measurable, constraints ->
if (Build.VERSION.SDK_INT >= 35) {
Api35Helper.resetStaticLayoutBuilderUseBoundsForWidth()
}
val placeable = measurable.measure(constraints)
layout(placeable.width, placeable.height) { placeable.place(0, 0) }
}
@RequiresApi(35)
private object Api35Helper {
@JvmStatic
fun resetStaticLayoutBuilderUseBoundsForWidth() {
StaticLayout.Builder.obtain("a", 0, 1, TextPaint(), 1024)
.setUseBoundsForWidth(false)
.build() // recycles the StaticLayout.
}
}
ap...@google.com <ap...@google.com> #10
Project: platform/frameworks/support
Branch: androidx-main
Author: Seigo Nonaka <
Link:
Fix unexpected enabling of useBoundsForWidth
Expand for full commit details
Fix unexpected enabling of useBoundsForWidth
This fixes a bug where a text may wrap to a second line where it is unnecessary.
Bug: 391378120
Test: Manual tests to ensure the unexpected wrapping stops after the fix is applied
Test: StaticLayoutFactoryTest#create_useBoundsForWidth_disabled
Test: BasicTextUnexpectedWrappingRegressionTest
Change-Id: I1b40c5816f2b4c1e787de05d5332db6fc0efad14
Files:
- A
compose/foundation/foundation/src/androidInstrumentedTest/assets/font/overshoot_test.ttx
- A
compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/BasicTextUnexpectedWrappingRegressionTest.kt
- A
compose/foundation/foundation/src/androidInstrumentedTest/res/font/overshoot_test.ttf
- M
compose/ui/ui-text/src/androidInstrumentedTest/kotlin/androidx/compose/ui/text/android/StaticLayoutFactoryTest.kt
- M
compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/android/StaticLayoutFactory.android.kt
Hash: 7d19be04e9c2af237f0605a148605bf52f607497
Date: Thu Jan 23 17:40:54 2025
pa...@partners.mbank.pl <pa...@partners.mbank.pl> #11
gr...@google.com <gr...@google.com> #12
This will be targeting 1.8
, likely landing in beta02
.
1.7.*
targets android API 34, and this fix requires API 35. Upgrading 1.7
to android api 35 is too large of a change for a 1.7.x
version.
gr...@google.com <gr...@google.com> #13
Separate note, an upstream fix in the android platform is expected in api level 36, so this issue should only occur when API level is 35 and compose version is below 1.8.
er...@gmail.com <er...@gmail.com> #14
Saw that beta02
is out but there is no mention of this issue being fixed in the release notes. Were you able to land the fix in beta02 or it got pushed to a future version?
er...@gmail.com <er...@gmail.com> #16
Do you have some kind of ETA when 1.8 will reach stable?
We're currently debating on switching our prod app on the compose-bom-beta:2025.02.00
artifact otherwise which points to 1.8.0-beta02
versions at the moment.
gp...@squareup.com <gp...@squareup.com> #17
The team just release 1.8.0-rc01 compose-bom-beta:2025.03.00
and I am still seeing the issue happen inconsistently.
Description
Jetpack Compose version: BOM 2024.12.01
Jetpack Compose component(s) used: Text in Material3
Android Studio Build: Meerkat Canary 9
Kotlin version: 2.1.0
Problem:
Since bumping target SDK to 35 we notice that some strings on some devices receive unintended line breaks even when the Text Composable is allowed to be as wide as it wants. Trying to force single line does not work either as setting
maxLines=1
clip the string rather than join to one line.Examples of problematic strings:
Steps to Reproduce or Code Sample to Reproduce:
Code: Attached minimal reproduction repo including our custom font
Device: Reproduced on Pixel 9 Pro XL real device and emulator using the font/display settings in attached screenshot. Also reported on but not verified: Pixel 8 Pro, Pixel Tablet
Summary of the reprod sample: Activity with the following XML:
...and the following sample code:
This will produce the result in attached screenshots.
Some findings from debugging the issue: