This is the bottom sheet selection dialog for material design.
Add below codes to your root build.gradle
file (not your module build.gradle file).
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
dependencies {
implementation 'com.github.KennethSS:android-material-bottom-sheet:1.1.1'
}
MaterialBottomSheet(this, R.style.BottomSheetThemeLight)
.title("Open in") // Optional
.items(items) // List of 'BottomSheetItem'
.setRippleEffect(true) // Default is true
.type(BottomSheetType.LIST) // LIST, GRID
.config(bottomSheetConfig) // Cofing Color(Optional)
.select { index, item ->
when(index) {
0 -> {
// Something else
}
}
}
.show()
val config = BottomSheetConfig(
itemIconTintColor = Color.RED,
titleColor = Color.BLUE
)