Assigned
Status Update
Comments
an...@google.com <an...@google.com> #2
For Compose Multiplatform issues, please use
ac...@gmail.com <ac...@gmail.com> #3
Hello!
I want to make people with poor vision to use the application.
In android there are two parameters responsible for the size - DP (Density-endopendent pixel) and SP (Scale-endependent pixel). In the settings of the Android, two different parameters are responsible for this.
If the user sees poorly, then he will increase text - the SP parameter.
In my design, the DP parameter is responsible for the size of the card and text simultaneous, so the text and size of the card increases evenly so that there is no distortion.
But I want to transfer from DP to SP so that in the Android settings the user changes the size of the text, which affects the size of the card.
Above the post I showed what approach I wanted to use.
This approach does not work with the .Size () method, but in other methods I use this approach - it works!
I ask you to fix this bug with the Modifier.size () method, this will help me a lot.
Thank you.
I want to make people with poor vision to use the application.
In android there are two parameters responsible for the size - DP (Density-endopendent pixel) and SP (Scale-endependent pixel). In the settings of the Android, two different parameters are responsible for this.
If the user sees poorly, then he will increase text - the SP parameter.
In my design, the DP parameter is responsible for the size of the card and text simultaneous, so the text and size of the card increases evenly so that there is no distortion.
But I want to transfer from DP to SP so that in the Android settings the user changes the size of the text, which affects the size of the card.
Above the post I showed what approach I wanted to use.
This approach does not work with the .Size () method, but in other methods I use this approach - it works!
I ask you to fix this bug with the Modifier.size () method, this will help me a lot.
Thank you.
an...@google.com <an...@google.com> #4
I am trying to understand what exactly doesn't work here. Converting from dp to sp should work just fine. So we should have a correct number. But then you pass this number into Modifier.size() and visually it doesn't look like the size is applied, is it correct? If yes, then it is important to understand on what exact layout do you try to apply this modifier, as it might have its own fixed size and not supporting resizing like that. That why I ask for a complete code sample which is reproducing the issue
ac...@gmail.com <ac...@gmail.com> #5
"visually it doesn't look like the size is applied, is it correct?"
Yes, nothing changing, but if I set this approach in any another method than it works.
I use LazyVerticalGrid, which contains SampleItemRecord.
You can try it by yourself at PreviewFontScale, i have add it to Test.
Yes, nothing changing, but if I set this approach in any another method than it works.
I use LazyVerticalGrid, which contains SampleItemRecord.
You can try it by yourself at PreviewFontScale, i have add it to Test.
Description
implementation("androidx.compose.material3:material3-android:1.3.1")
implementation("androidx.compose.ui:ui-tooling-preview:1.7.8")
implementation("androidx.activity:activity-compose:1.10.1")
implementation(platform("androidx.compose:compose-bom:2025.03.00"))
implementation("androidx.compose.ui:ui:1.7.8")
implementation("androidx.compose.ui:ui-graphics-android:1.7.8")
Android Studio Build:
Android Studio Meerkat | 2024.3.1
Build #AI-243.22562.218.2431.13114758, built on February 25, 2025
Runtime version: 21.0.5+-12932927-b750.29 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 10.0
Kotlin plugin: K2 mode
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 2548M
Cores: 16
Registry:
ide.instant.shutdown=false
ide.experimental.ui=true
i18n.locale=
Non-Bundled Plugins:
com.intellij.marketplace (243.22562.238)
name.kropp.intellij.makefile (243.21565.122)
com.mallowigi (101.2.0)
cn.yiiguxing.plugin.translate (3.7.1)
Kotlin version:
id("
Steps to Reproduce or Code Sample to Reproduce:
1. I'm trying to change the card size depending on the user font size:
@Composable
fun SpSizeExample() {
val density = LocalDensity.current
val sizeInSp = 16.sp
val sizeInDp = with(density) {
sizeInSp.toDp()
}
Box(
modifier = Modifier
.size(sizeInDp)
)
}
2. This approach does not work
3. At the screenshot I have added: the cards on the bottom sheet have a limited size in height, and the cards at composable fragment can be stretched, but unfortunately they do not respond.