Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AlertDialog not using fontScale #1768

Open
eygraber opened this issue Dec 25, 2024 · 0 comments
Open

AlertDialog not using fontScale #1768

eygraber opened this issue Dec 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@eygraber
Copy link

Description
In my snapshot I call my Compose function that shows an AlertDialog. I wrap the function call in WithDensity:

@Composable
fun WithDensity(
  density: Float = -1F,
  fontScale: Float = -1F,
  content: @Composable () -> Unit,
) {
  val current = LocalDensity.current

  CompositionLocalProvider(
    LocalDensity provides Density(
      density = when(density) {
        -1F -> current.density
        else -> density
      },
      fontScale = when(fontScale) {
        -1F -> current.fontScale
        else -> fontScale
      },
    ),
    content = content,
  )
}

paparazzi.snapshot {
  withDensity(fontScale = 2F) {
    MyComposeFunction()
  }
}

however the text in the AlertDialog is not scaled. Android Studio previews and running the app on device do scale the text.

Additional information:

  • Paparazzi Version: 1.3.5
  • OS: Ubuntu 24.04
  • Compile SDK: 35
  • Gradle Version: 8.12
  • Android Gradle Plugin Version: 8.7.3
@eygraber eygraber added the bug Something isn't working label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant