How to open Bottom Sheet in Android Kotlin

Sudish Kumar
Dec 18, 2020

--

Bottom Sheets are surface components that hold supplementary screen content. it looks likes as a dialog . we can show UI what ever we want we can also handle click events.

we need a fragment for showing Bottom Sheet .

like this,

class BottomSheetFragment :BottomSheetDialogFragment() {// setup add your xml in the fragment
}

You can use this code for open your Bottom Sheet

val bottomSheetFragment = BottomSheetFragment()
bottomSheetFragment.show(supportFragmentManager, "bottom sheet")

You can use multiple UI components (TextView, ImageView , Buttom,……) and also you can add lists and handle click events

you can see my Bottom Sheet project on GitLab

https://gitlab.com/sudishkumar/buttomsheet-app

Thank you Friends, Have a good day and night.

--

--

Sudish Kumar
Sudish Kumar

Written by Sudish Kumar

Flutter | Android | Node | Dart | Kotlin | Java | JavaScript | TypeScript | PHP | Short Story Teller | Tech Lead