kotlinandroid-jetpack-composeandroid-bottomsheetdialog

How can I do bottom sheet share component in kotlin compose?


I'm trying to do a share component which is open the bottom like a modal bottom sheet in kotlin compose but I couldn't find a name and do it. How am I supposed to search to do this component in kotlin compose ? is there a any specific name for this ? can anyone help me out ?

it looks like this for example:

enter image description here


Solution

  • You may try out this code:

    val sendIntent: Intent = Intent().apply {
        action = Intent.ACTION_SEND
        putExtra(
            Intent.EXTRA_TEXT,
            "Your message that you want to send"
        )
        type = "text/plain"
    }
    val shareIntent = Intent.createChooser(sendIntent, null)
    val context = LocalContext.current
    

    And in onClick of any button, start this intent to show bottom sheet for choosing app

    Button(onClick={ context.startActivity(shareIntent) }){...}