Android Material BottomSheet
This is the bottom sheet selection dialog for material design.
Dependency Gradle
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'
}
Usage
Basic Example
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()
Config Color
val config = BottomSheetConfig(
itemIconTintColor = Color.RED,
titleColor = Color.BLUE
)