BottomSheets
BottomSheets will help you make your application more appealing to your end users with its sleek stutter-free implementation of the Material Bottom Sheets.
- Screenshots




Getting Started
- Make sure that you've added the
jcenter()
repository to your top-levelbuild.gradle
file.
- Add the library dependency to your module-level
build.gradle
file.
- Enable the jetifier and androidX support in the top-level
gradle.properties
file.
- Update your
compileSdkVersion
in the module-levelbuild.gradle
file to 28+.
- Update your
com.android.support.appcompat.*
dependency to the newandroidx.appcompat.*
alternative.
- Proceed with the implementation.
Structure
The library is comprised of 3 modules, namely:
bottomsheets-core
- core functionality (Required)bottomsheets-sheets
- concrete implementations of the common bottom sheet types (Optional)bottomsheets-ktx
- common extensions and utils (Optional)
The first module - bottomsheets-core
- is a base module the other modules depend on, it is the starting point for all of your custom bottom sheet implementations and is a required module. This module provides you with the base classes required for the bottom sheet implementation, such as the BaseBottomSheet.java
which should be extended by your custom implementations of the bottom sheet and BottomSheet.java
contract which exposes its supported public APIs, here you will also find the Config.java
class which will help you customize the bottom sheet.
The second module - bottomsheets-sheets
- is an optional module which includes the implementations of the most common bottom sheet types. Here you will find the ActionPickerBottomSheet.java
, CustomActionPickerBottomSheet.java
, as well as the coresponding configuration class - Config.java
. This module depends on the bottomsheets-core
and the Adapster
library.
The third and last module - bottomsheets-ktx
- is a collection of the extensions and general utils. Here you'll be able to find the BottomSheetsExtensions.kt
which will simplify the creation of the common bottom sheet types in your Activities and Fragments. This module depends on the bottomsheets-core
, bottomsheets-sheets
and the Adapster
library.
Basic Custom Implementation
IMPORTANT: In order to prevent the visual inconsistencies which might be caused by certain UI elements of the Application Theme, it is recommended that you specify the Application/Activity Theme without the Action Bar (any variant of the Theme.NoActionBar
will suffice). You might also want to make your Status Bar translucent for more immersive experience.
In order to implement a basic custom bottom sheet you need to follow three simple steps:
- Create a new class and extend it from the
BaseBottomSheet.java
. - Provide the custom content view for your bottom sheet in the
onCreateSheetContentView(...)
. - Use the created bottom sheet in your Activity/Fragment.
So, let's create a custom bottom sheet class - SimpleCustomBottomSheet
and provide our own content view:
Kotlin (click to expand)
Java (click to expand)
And now let's use the created SimpleCustomBottomSheet
in our Activity:
Kotlin (click to expand)
Java (click to expand)
Action Picker Implementation
The implementation of the Action Picker Bottom Sheet becomes a trivial task with ActionPickerBottomSheet.java
, as all you need to do here is simply provide a list of options and a bottom sheet configuration.
Let's use the ActionPickerBottomSheet.java
in our Activity:
- With
bottomsheets-ktx
Kotlin (click to expand)
Java (click to expand)
- Without
bottomsheets-ktx
Kotlin (click to expand)
Java (click to expand)