The Android Aroma BottomSheet package provides a customisable BottomSheet. This README describes how to implement the BottomSheet into an app.
This GitHub repository is a mirror, the official repository is hosted privately by Coffee IT.
Created by Coffee IT.
This component requires minimum SDK 21.
Add the dependency to build.gradle
.
Groovy:
dependencies {
implementation "nl.coffeeit.aroma:bottomsheet:1.0.3"
}
KTS:
dependencies {
implementation("nl.coffeeit.aroma:bottomsheet:1.0.3")
}
To use the BottomSheet in a project, simply add it to your code like this:
BottomSheetWithContent(
activityContentScope = { state, scope ->
Button(onClick = {
scope.launch {
state.show()
}
}) {
Text("This goes behind the sheet")
}
},
sheetContent = {
Text(text = "This goes inside the sheet")
}
)
Two parameters are required:
activityContentScope
holds the content that should be displayed initially, when the bottom sheet is hidden. It offers a state
to toggle the visibility of the bottom sheet and a coroutine scope
sheetContent
represents a Composable that is the the content of the actual sheet. XML can also be used here, since it can be inflated in a Composable.
BottomSheetWithContent
accepts the following optional parameters:
backgroundColor
AColor
object to set the background of the bottom sheetscrimColor
AColor
object to set the color of the area behind the sheetwidth
The width of the bottom sheet (default is fill screen width)bottomMargin
Margin for the bottom of the sheet, to make a floating variant (default 0)cornerShape
ARoundedCornerShape
object to give the sheet rounded edgesaccessory
Decides the accessory of the BottomSheet, can be: --NONE
--GRABBER
--CLOSE_BUTTON
The changelog can be found here.
Look at our other repositories on our GitHub account.
Do you have questions, ideas or need help? Send us an email at [email protected].
The Android Aroma BottomSheet package is licensed under the terms of the MIT Open Source license, combined with the Commons Clause licence.