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

MD3 AlertDialog not found in jb-compose 1.5.0-dev1114 #3395

Closed
mahramane opened this issue Jul 22, 2023 · 4 comments
Closed

MD3 AlertDialog not found in jb-compose 1.5.0-dev1114 #3395

mahramane opened this issue Jul 22, 2023 · 4 comments
Labels
duplicate This issue or pull request already exists material3

Comments

@mahramane
Copy link

in M3 1.1.0-alpha04 there is an AlertDialog composable function with a slot for content but it not found in jb-compose 1.5.0-dev1114

@mahramane mahramane added enhancement New feature or request submitted labels Jul 22, 2023
@Atlands
Copy link

Atlands commented Jul 22, 2023

Due to the use of native Android code in Dialog, multiplatforms should not be able to use it.
You can try using Popup

@Composable
fun Dialog(
    barrierColor: Color = Color.Black.copy(alpha = 0.5f),
    onDismissRequest: (() -> Unit),
    content: @Composable () -> Unit
) {
    MyBackHandler {
        onDismissRequest()
    }
    Popup(onDismissRequest = onDismissRequest) {
        Box(
            modifier = Modifier
                .clickable(
                    onClick = { onDismissRequest() },
                    indication = null,
                    interactionSource = remember { MutableInteractionSource() }
                )
                .background(barrierColor).fillMaxSize(),
            contentAlignment = Alignment.Center
        ) {
            content()
        }
    }
}

@MatkovIvan
Copy link
Member

Making it available is a separate thing, but it's in our plan on Q3.

Closing as duplicate of #762

@MatkovIvan MatkovIvan added duplicate This issue or pull request already exists material3 and removed enhancement New feature or request submitted labels Jul 24, 2023
@MatkovIvan
Copy link
Member

#2037

@okushnikov
Copy link
Collaborator

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists material3
Projects
None yet
Development

No branches or pull requests

4 participants