Fixed
Status Update
Comments
ma...@gmail.com <ma...@gmail.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 5b70a786cc5b328f69b2fb9c2dc017998a4e9782
Author: Halil Ozercan <halilibo@google.com>
Date: Fri Apr 21 04:37:07 2023
Stabilize Experimental Text APIs
We have been adding experimental attributes to TextStyle, SpanStyle, and ParagraphStyle to flesh out the Text styling options we provide in Compose. It's now time to stabilize these relatively long standing APIs.
This CL includes stabilization of
- Brush
- DrawStyle
- TextMotion
- DrawScope.drawText
- Paragraph.paint (brush, drawStyle, blendMode)
- MultiParagraph.paint (brush, drawStyle, blendMode)
Alongside these changes, previous constructors and copy functions are being deprecated at HIDDEN level to point developers towards newly stabilized APIs that encompass the previous alternatives.
Relnote: "Stabilized many Text APIs that include `Brush`, `DrawStyle`, `TextMotion`, `DrawScope.drawText`, `Paragraph.paint(Brush)`, `MultiParagraph.paint(Brush)`."
Test: N/A
Fix: b/261581564
Fix: b/261581931
Fix: b/261561245
Change-Id: I2f7409cb64ade53b1ebc3385293456b126314b14
M compose/ui/ui-text/api/current.ignore
M compose/ui/ui-text/api/current.txt
M compose/ui/ui-text/api/public_plus_experimental_current.txt
M compose/ui/ui-text/api/restricted_current.ignore
M compose/ui/ui-text/api/restricted_current.txt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/AndroidParagraph.android.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/Paragraph.android.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/style/TextMotion.android.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/MultiParagraph.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/Paragraph.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/ParagraphStyle.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/SpanStyle.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/TextPainter.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/TextStyle.kt
M compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/Paragraph.skiko.kt
M compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/style/TextMotion.skiko.kt
https://android-review.googlesource.com/2550856
Branch: androidx-main
commit 5b70a786cc5b328f69b2fb9c2dc017998a4e9782
Author: Halil Ozercan <halilibo@google.com>
Date: Fri Apr 21 04:37:07 2023
Stabilize Experimental Text APIs
We have been adding experimental attributes to TextStyle, SpanStyle, and ParagraphStyle to flesh out the Text styling options we provide in Compose. It's now time to stabilize these relatively long standing APIs.
This CL includes stabilization of
- Brush
- DrawStyle
- TextMotion
- DrawScope.drawText
- Paragraph.paint (brush, drawStyle, blendMode)
- MultiParagraph.paint (brush, drawStyle, blendMode)
Alongside these changes, previous constructors and copy functions are being deprecated at HIDDEN level to point developers towards newly stabilized APIs that encompass the previous alternatives.
Relnote: "Stabilized many Text APIs that include `Brush`, `DrawStyle`, `TextMotion`, `DrawScope.drawText`, `Paragraph.paint(Brush)`, `MultiParagraph.paint(Brush)`."
Test: N/A
Fix:
Fix:
Fix:
Change-Id: I2f7409cb64ade53b1ebc3385293456b126314b14
M compose/ui/ui-text/api/current.ignore
M compose/ui/ui-text/api/current.txt
M compose/ui/ui-text/api/public_plus_experimental_current.txt
M compose/ui/ui-text/api/restricted_current.ignore
M compose/ui/ui-text/api/restricted_current.txt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/AndroidParagraph.android.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/Paragraph.android.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/style/TextMotion.android.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/MultiParagraph.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/Paragraph.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/ParagraphStyle.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/SpanStyle.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/TextPainter.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/TextStyle.kt
M compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/Paragraph.skiko.kt
M compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/style/TextMotion.skiko.kt
ma...@gmail.com <ma...@gmail.com> #3
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.ui:ui-text:1.5.0-alpha04
ma...@google.com <ma...@google.com>
ke...@google.com <ke...@google.com>
ki...@gmail.com <ki...@gmail.com> #4
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.ui:ui-text-android:1.5.0-beta01
co...@google.com <co...@google.com>
ki...@gmail.com <ki...@gmail.com> #7
[versions]
agp = "8.2.2"
coil-compose = "2.5.0"
compose-shimmer = "1.2.0"
sealedx-processor = "1.0.2"
sealedx-core = "1.0.2"
vico = "2.0.0-alpha.6"
github-core = "1.9.62"
github-glassmorphic-composables = "0.0.7"
github-sandwich = "2.0.5"
gson = "2.10.1"
haze-jetpack-compose = "0.4.5"
hilt-android = "2.46"
hilt-navigation-compose = "1.1.0"
kotlin = "1.9.22"
core-ktx = "1.12.0"
junit = "4.13.2"
androidx-test-ext-junit = "1.1.5"
espresso-core = "3.5.1"
ksp = "1.9.62"
lifecycle-runtime-ktx = "2.7.0"
activity-compose = "1.8.2"
compose-bom = "2023.10.01"
moshi = "1.15.0"
moshi-kotlin-codegen = "1.15.0"
retrofit = "2.9.0"
room-runtime = "2.6.1"
stories = "1.0.2"
[libraries]
androidx-hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "hilt-navigation-compose" }
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "room-runtime" }
androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "room-runtime" }
coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil-compose" }
compose-shimmer = { module = "com.valentinilk.shimmer:compose-shimmer", version.ref = "compose-shimmer" }
converter-moshi = { module = "com.squareup.retrofit2:converter-moshi", version.ref = "retrofit" }
destinationCore = { module = "io.github.raamcosta.compose-destinations:core", version.ref = "github-core" }
core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "core-ktx" }
haze-jetpack-compose = { module = "dev.chrisbanes.haze:haze-jetpack-compose", version.ref = "haze-jetpack-compose" }
hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt-android" }
hilt-android-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt-android" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
androidx-test-ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-ext-junit" }
espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso-core" }
destinationKsp = { module = "io.github.raamcosta.compose-destinations:ksp", version.ref = "ksp" }
lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle-runtime-ktx" }
activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activity-compose" }
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose-bom" }
moshi = { module = "com.squareup.moshi:moshi", version.ref = "moshi" }
moshi-kotlin = { module = "com.squareup.moshi:moshi-kotlin", version.ref = "moshi" }
moshi-kotlin-codegen = { module = "com.squareup.moshi:moshi-kotlin-codegen", version.ref = "moshi-kotlin-codegen" }
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
sandwich-retrofit = { module = "com.github.skydoves:sandwich-retrofit", version.ref = "github-sandwich" }
sealedx-processor = { module = "com.github.skydoves:sealedx-processor", version.ref = "sealedx-processor" }
sealedx-core = { module = "com.github.skydoves:sealedx-core", version.ref = "sealedx-core" }
skydoves-sandwich = { module = "com.github.skydoves:sandwich", version.ref = "github-sandwich" }
stories = { module = "com.github.raipankaj:Stories", version.ref = "stories" }
ui = { group = "androidx.compose.ui", name = "ui" }
ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
material3 = { group = "androidx.compose.material3", name = "material3", version = "1.2.0-rc01" }
vico-compose-m3 = { module = "com.patrykandpatryk.vico:compose-m3", version.ref = "vico" }
[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
kotlinAndroid = { id = "
[bundles]
ev...@tatarka.me <ev...@tatarka.me> #8
Ran into the same issue, the onValuChangeFinished lambda is being passed as a remember key so recreates the state if that lambda reference changes (as seen in
val context = LocalContext.current
var sliderPosition by remember { mutableStateOf(0f) }
val onValueChangeFinished: () -> Unit = remember {
{ Toast.makeText(context, sliderPosition.toString(), Toast.LENGTH_SHORT).show() }
}
Text(text = sliderPosition.toString())
Slider(
value = sliderPosition,
onValueChange = { sliderPosition = it },
onValueChangeFinished = onValueChangeFinished
)
ke...@google.com <ke...@google.com>
co...@google.com <co...@google.com> #9
Feb 19 is a U.S. holiday, there are 12+ impacted so far, Kevin, could you please take a look on tues once you are back at work? ty!
ke...@google.com <ke...@google.com> #10
Yup, taking a look. Thanks Connie!
ke...@google.com <ke...@google.com>
ap...@google.com <ap...@google.com> #11
Project: platform/frameworks/support
Branch: androidx-main
commit dde2e9109164e8cf8e8bad4a28954d35cad19d76
Author: Kevin Truong <kevinctruong@google.com>
Date: Fri Jan 26 13:24:33 2024
[Slider] Fix for using Toast or Snackbar in onValueChangeFinished
Remove onValueChangeFinished as a key to remember for Slider and RangeSlider.
Set the value of state.onValueChangeFinished to onValueChangeFinished in stateless APIs, so any new version of onValueChangeFinished is still
propagated to the state. Removing @Stable from the states since state.onValueChangeFinished is now a var.
Bug: 322269951
Test: Adding test for Slider and RangeSlider that triggers a snackbar in onValueChangeFinished. Testing that both Slider and RangeSlider drag to the correct position without the snackbar causing ths slider to stop drag.
Relnote: Removing @Stable from the states of Slider since we're changing state.onValueCHangeFinished to a var.
Change-Id: Ied34a92fed040ceeb5d676d6f75767ee33762cfb
M compose/material3/material3/api/current.txt
M compose/material3/material3/api/restricted_current.txt
M compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/SliderTest.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Slider.kt
https://android-review.googlesource.com/2930335
Branch: androidx-main
commit dde2e9109164e8cf8e8bad4a28954d35cad19d76
Author: Kevin Truong <kevinctruong@google.com>
Date: Fri Jan 26 13:24:33 2024
[Slider] Fix for using Toast or Snackbar in onValueChangeFinished
Remove onValueChangeFinished as a key to remember for Slider and RangeSlider.
Set the value of state.onValueChangeFinished to onValueChangeFinished in stateless APIs, so any new version of onValueChangeFinished is still
propagated to the state. Removing @Stable from the states since state.onValueChangeFinished is now a var.
Bug: 322269951
Test: Adding test for Slider and RangeSlider that triggers a snackbar in onValueChangeFinished. Testing that both Slider and RangeSlider drag to the correct position without the snackbar causing ths slider to stop drag.
Relnote: Removing @Stable from the states of Slider since we're changing state.onValueCHangeFinished to a var.
Change-Id: Ied34a92fed040ceeb5d676d6f75767ee33762cfb
M compose/material3/material3/api/current.txt
M compose/material3/material3/api/restricted_current.txt
M compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/SliderTest.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Slider.kt
ap...@google.com <ap...@google.com> #12
Project: platform/frameworks/support
Branch: androidx-main
commit 74979312fabd3061fcb2cf34714c3afc1ffe2088
Author: Kevin Truong <kevinctruong@google.com>
Date: Tue Feb 27 12:38:49 2024
[Slider] Making States Stable
Making the states stable again, making State.onValueChangeFinished a val again, and wrapping onValueChangeFinished with a rememberUpdatedState.
Bug: 322269951
Test: N/A
Relnote: Making the states stable again. Making State.onValueChangeFinished a val again. Wrapping onValueChangeFinished in a rememberUpdatedState.
Change-Id: I82ab29f469b01077eb17a70204f43b7a154abc1d
M compose/material3/material3/api/current.txt
M compose/material3/material3/api/restricted_current.txt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Slider.kt
https://android-review.googlesource.com/2980132
Branch: androidx-main
commit 74979312fabd3061fcb2cf34714c3afc1ffe2088
Author: Kevin Truong <kevinctruong@google.com>
Date: Tue Feb 27 12:38:49 2024
[Slider] Making States Stable
Making the states stable again, making State.onValueChangeFinished a val again, and wrapping onValueChangeFinished with a rememberUpdatedState.
Bug: 322269951
Test: N/A
Relnote: Making the states stable again. Making State.onValueChangeFinished a val again. Wrapping onValueChangeFinished in a rememberUpdatedState.
Change-Id: I82ab29f469b01077eb17a70204f43b7a154abc1d
M compose/material3/material3/api/current.txt
M compose/material3/material3/api/restricted_current.txt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Slider.kt
na...@google.com <na...@google.com> #13
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material3:material3:1.2.1
androidx.compose.material3:material3-android:1.2.1
androidx.compose.material3:material3-desktop:1.2.1
androidx.compose.material3:material3:1.3.0-alpha02
androidx.compose.material3:material3-android:1.3.0-alpha02
androidx.compose.material3:material3-desktop:1.3.0-alpha02
Description
Jetpack Compose version: compose-ui = "1.6.0", compose-foundation = "1.6.0", material3-android = "1.2.0-rc01"
Jetpack Compose component used: Slider
Android Studio Build: Giraffe | 2022.3.1 Patch 3
Kotlin version: 1.8.10
Code Sample to Reproduce:
Now if you run the app and try to slide the slider, the sliding gets interrupted, and onValueChangeFinished is called continuously.
This problem occurs also in version "1.2.0-beta01" and above.