Status Update
Comments
ra...@gmail.com <ra...@gmail.com> #2
ChromiumPerf/android-pixel6-perf/system_health.memory_mobile/memory:chrome:all_processes:reported_by_chrome:malloc:max_committed_size_avg/browse_news
Verification workflow id: projects/62121018386/locations/us-central1/workflows/sandwich-verification-workflow-prod/executions/f430dab5-4642-48dd-a3d6-a50904c1d68e
sg...@google.com <sg...@google.com>
ma...@google.com <ma...@google.com> #3
did NOT reproduce the regression with statistic: {'control_median': 135405568, 'lower': -2.0340368398504394, 'p_value': 0.42795460671186447, 'treatment_median': 135325696, 'upper': 1.0165479548803757}.
Issue closed.
ra...@gmail.com <ra...@gmail.com> #4
yes, i am using Modifier.weight for Slider, i don't know why it crash on OnePlus phone
ra...@gmail.com <ra...@gmail.com> #5
Here is a example code of my slider controller
Row(Modifier.fillMaxWidth()) {
// Some icon buttons here
Slider(
modifier = Modifier.weight(1f)
//...
}
// Other icon buttons here
}
When exiting the horizontal screen state or entering the picture-in-picture mode, the above exception will be caused, and it only happens on OnePlus phone
ma...@google.com <ma...@google.com> #6
Thanks I'll add a fix for parents with width 0.dp maybe it something that only happens briefly and then it measures something reasonable. Can you share the exact model/OS?
ra...@gmail.com <ra...@gmail.com> #7
OnePlus 7/OnePlus 8
I don't have any specific phone to test,it's the feedback from my users. After the simulator test, I guess it's the change of density?
At present, I use BoxWithConstraints to wrap the Slider. And check the maximum width of the constraint, and it will only be displayed when the maximum width is above 40dp, which temporarily fixes the exception.
ap...@google.com <ap...@google.com> #8
Branch: androidx-main
commit 76f24353f136570d95e80840a44d6faf67383971
Author: Mariano Martin <marianomartin@google.com>
Date: Tue May 10 16:01:23 2022
Allow slider parent to have 0 width
Fix: 231707291
Test: added slider_zero_width
Change-Id: Idb144788fd8e45dd651d211c8093fc53be39a0d1
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Slider.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Slider.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/SliderTest.kt
Description
Jetpack Compose version: 1.2.0-alpha07 Jetpack Compose component used: material3
Use Slider with zero width constrants, then change the density, the Slider might causes app crash:
Here is a simple code to reproduce that:
Just drag the slider, it will crash very soon