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

Dialog displays an error after attachBaseContext() #22

Open
iMeePwni opened this issue Mar 4, 2024 · 0 comments
Open

Dialog displays an error after attachBaseContext() #22

iMeePwni opened this issue Mar 4, 2024 · 0 comments

Comments

@iMeePwni
Copy link

iMeePwni commented Mar 4, 2024

After override the context configuration to prevent font scaling and density scaling, the full screen dialog displays an error.

    override fun attachBaseContext(newBase: Context) {
        val resources = newBase.resources
        val overrideConfiguration = Configuration(resources.configuration)
            .apply {
                fontScale = 1.0f
                densityDpi = resources.displayMetrics.xdpi.toInt()
            }

        super.attachBaseContext(
            newBase.createConfigurationContext(overrideConfiguration)
        )
    }

Screenshot_20240304_185817

After set defaultPlayerView background to GRAY.

    DisposableEffect(
        AndroidView(
            modifier = modifier,
            factory = {
                defaultPlayerView.apply {
                    useController = usePlayerController
                    resizeMode = surfaceResizeMode.toPlayerViewResizeMode()
                    setBackgroundColor(Color.GRAY)
                }
            },
        ),
    ) {

Screenshot_20240304_190028

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant