Status Update
Comments
si...@google.com <si...@google.com> #2
Agree
si...@google.com <si...@google.com>
p....@arammeem.com <p....@arammeem.com> #3
Also it causes slider to be unusable while onValuChangeFinished != null
si...@google.com <si...@google.com>
ho...@fulfillmenttools.com <ho...@fulfillmenttools.com> #4
my...@gmail.com <my...@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]
si...@google.com <si...@google.com> #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
)
cf...@gmail.com <cf...@gmail.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!
de...@edistera.com <de...@edistera.com> #10
Yup, taking a look. Thanks Connie!
be...@gmail.com <be...@gmail.com> #11
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
al...@gmail.com <al...@gmail.com> #12
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
ub...@gmail.com <ub...@gmail.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
[Deleted User] <[Deleted User]> #14
I don't think I've seen this mentioned yet, but another workaround is to use an AndroidView
.
For example:
AndroidView(
factory = { context ->
TextView(context, null, R.style.Body).apply {
text = "Some text"
setLines(2)
}
}
)
be...@gmail.com <be...@gmail.com> #15
Is that not the point? getting away from XML -> Compose?
ma...@ext.carrefour.com <ma...@ext.carrefour.com> #16
I agree with #15. The goal is to be independent of XML layouts. Android Views may work for a while, but not in the long term.
so...@google.com <so...@google.com>
si...@google.com <si...@google.com> #17
I understand the need for a simpler API.
Is a line equal to lineHeight + fontSize, or max(lineHeight, fontSize), or something else?
- A line is lineHeight.toPx() * 1, x lines is lineHeight.toPx() * x
- if lineHeight is not defined, it is fontSize.toPx() * x
It is necessarily very accurate and might require an if.
This could be in the form of adding a minLines parameter to TextField
a new TextStyle method that returns the height of a line based on this TextStyle's font size and line height
Both are good suggestions. I would love to have a Modifier.minLines(X) or Modifier.minLines(X, textStyle) rather than parameters if it was possible.
si...@google.com <si...@google.com>
le...@google.com <le...@google.com>
be...@gmail.com <be...@gmail.com> #18
It seen this project is just been sent from one desk stack to another desk stack, are you afraid to implement it?
ap...@google.com <ap...@google.com> #19
Branch: androidx-main
commit dfc6b04ca597d18af510e2a374635417cfa9cb01
Author: Andrei Ancuta <andreiancuta@google.com>
Date: Thu Sep 29 16:50:52 2022
Change MaxLinesHeightModifier to also handle minLines
Rename MaxLinesHeightModifier to HeightInLinesModifier and add a minLines parameter.
Rename MaxLinesHeightModifierTest to HeightInLinesModifierTest and add tests for the minLines functionality.
Bug: 122476634
Test: HeightInLinesModifierTest.kt
Test: ./gradlew :compose:ui:ui-text:cAT
Relnote: N/A
Change-Id: I7433ede0096f950a89c494084e194157a4bbaaab
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/HeightInLinesModifier.kt
M compose/foundation/foundation/api/public_plus_experimental_current.txt
M compose/foundation/foundation/api/restricted_current.txt
M compose/foundation/foundation/api/current.txt
A compose/foundation/foundation/api/restricted_current.ignore
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/HeightInLinesModifierTest.kt
A compose/foundation/foundation/api/current.ignore
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldScrollTest.kt
si...@google.com <si...@google.com> #20
Assigned for the open CL at aosp/2237754
da...@gmail.com <da...@gmail.com> #21
Are there plans to make this modifier public so that we can use it from our own apps? Or are there intentions to expose the minLines behavior via another mechanism that internally uses this Modifier?
so...@google.com <so...@google.com>
ap...@google.com <ap...@google.com> #22
Branch: androidx-main
commit e74bce3b62ac62a8115f7707bf5b58adc8d2c340
Author: Andrei Ancuta <andreiancuta@google.com>
Date: Thu Sep 29 21:30:43 2022
Add minLines parameter to BasicText and BasicTextField
Bug: 122476634
Test: ./gradlew compose:foundation:foundation:test
Relnote: "Added minLines parameter to the BasicText and BasicTextField.
It allows to set the minimum height of these composables in terms of
number of lines"
Change-Id: I2429479960eef317f467fa054b979c12fd73689d
M compose/compiler/compiler-hosted/integration-tests/build.gradle
M compose/compiler/compiler-hosted/integration-tests/src/test/java/androidx/compose/compiler/plugins/kotlin/TargetAnnotationsTransformTests.kt
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/public_plus_experimental_current.txt
M compose/foundation/foundation/api/restricted_current.txt
A compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/BasicTextMinMaxLinesDemo.kt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/ComposeInputFieldMinMaxLines.kt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/TextDemos.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/BasicText.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/BasicTextField.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreText.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/HeightInLinesModifier.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextDelegate.kt
M compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text/TextControllerTest.kt
M compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text/TextDelegateTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Text.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Text.kt
M wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/Text.kt
na...@google.com <na...@google.com> #23
The following release(s) address this bug:
androidx.compose.foundation:foundation:1.4.0-alpha01
al...@gmail.com <al...@gmail.com> #24
Are you certain this landed in 1.4.0-alpha01? I was not able to find this API in the new release. Android Studio doesn't show me a minLines: Int
argument when I update to 1.4.0-alpha01
.
so...@google.com <so...@google.com> #25
Alex is right, the API change haven't landed in 1.4.0-alpha
. We cut the build just before the API change in BasicText(Field)
landed so the build only contains the implementation.
so...@google.com <so...@google.com>
be...@yescapa.com <be...@yescapa.com> #26
minLines is not used in the basicText implementation so it's not working :
line 212 of BasicText :
val controller = remember {
TextController(
TextState(
TextDelegate(
text = text,
style = style,
density = density,
softWrap = softWrap,
fontFamilyResolver = fontFamilyResolver,
overflow = overflow,
maxLines = maxLines,
placeholders = placeholders
),
selectableId
)
)
}
minLines = minLines
is missing in the TextDelegate constructor
Edit: I'm on 1.4.0-alpha02
so...@google.com <so...@google.com> #27
Good catch! We missed that during code review, on it.
Please note that String override should be fine, it wasn't propagated to AnnotatedString override only.
ap...@google.com <ap...@google.com> #28
Branch: androidx-main
commit 8068bf450819393cf10b8f37d73533cf3b8e6cec
Author: Anastasia Soboleva <soboleva@google.com>
Date: Thu Nov 10 16:34:40 2022
Pass minLines to AnnotatedString override of BasicText
Relnote: "Fix `minLines` of the AnnotatedString override of Text and
BasicText - before this change applying minLines did nothing"
Test: added more tests to cover minLines in BasicText and
BasicTextField
Test: updated HeightInLinesModifierTest some tests of which were false
negatives
Bug: 122476634
Change-Id: I2a7f20069ac2f0da053940f8eadb72656bbb592c
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/BasicTextMinLinesTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/HeightInLinesModifierTest.kt
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldMinMaxLinesTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/BasicText.kt
si...@google.com <si...@google.com>
ap...@google.com <ap...@google.com> #29
Branch: androidx-main
commit 1ea832da88dda876c4b4d283012f7231eadfcf83
Author: Aurimas Liutikas <aurimas@google.com>
Date: Mon Nov 14 16:48:33 2022
Revert "Pass minLines to AnnotatedString override of BasicText"
This reverts commit 8068bf450819393cf10b8f37d73533cf3b8e6cec.
Reason for revert: Added tests 100% fails on API 33
Bug: 122476634
Change-Id: Ibba3f2354b4ff7c6e5e47f3e8d1ccb1f11da4ea9
D compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/BasicTextMinLinesTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/HeightInLinesModifierTest.kt
D compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldMinMaxLinesTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/BasicText.kt
si...@google.com <si...@google.com> #30
The reverted commit was rever-reverted via
This ticket should be fixed. Looks like there is something about the Density's that are being used on device that need some attention. They do not set the font scale therefore they are impacted by the font scale on the device.
si...@google.com <si...@google.com> #31
Based onthe comment on the other ticket
The following release(s) address this bug.It is possible this bug has only been partially addressed:
- androidx.compose.foundation:foundation:1.4.0-alpha04
Description