Sheets
⭐ Offers a range of beautiful sheets (dialogs & bottom sheets) for quick use in your project. Includes many ways to customize sheets.
Install / Use
/learn @maxkeppeler/SheetsREADME
Sheets
<p> <img src="docs/res/ic_library.png" width="96px" height="96px" alt="Sheets Library" align="left" style="margin-right: 24px; margin-bottom: 24px"> <p>Sleek dialogs and bottom-sheets for quick use in your app. Choose one of the available sheets or build custom sheets on top of the existing functionality.
<a href="https://search.maven.org/search?q=g:%22com.maxkeppeler.sheets%22"> <img style="margin-right: 4px; margin-bottom: 8px;" alt="Version of Sheets library" src="https://img.shields.io/maven-central/v/com.maxkeppeler.sheets/core.svg?label=Maven%20Central"> </a> <a href="https://github.com/maxkeppeler/sheets"> <img style="margin-right: 4px; margin-bottom: 8px;" alt="Codacy code quality of Sheets library" src="https://img.shields.io/codacy/grade/9a3b68b152e149fd82f0873e2fed78d5?label=Code%20Quality"> </a> <a href="https://www.apache.org/licenses/LICENSE-2.0"> <img style="margin-right: 4px; margin-bottom: 8px;" alt="GitHub" src="https://img.shields.io/github/license/maxkeppeler/sheets?color=%23007EC6&label="> </a> <a href="https://github.com/maxkeppeler/sheets"> <img style="margin-right: 4px; margin-bottom: 8px" alt="Give this library a star" src="https://img.shields.io/github/stars/maxkeppeler/sheets?style=social"> </a> <a href="https://github.com/maxkeppeler/sheets/fork"> <img style="margin-right: 4px; margin-bottom: 8px" alt="Fork this library" src="https://img.shields.io/github/forks/maxkeppeler/sheets?style=social"> </a> <a href="https://github.com/maxkeppeler/sheets"> <img style="margin-right: 4px; margin-bottom: 8px" alt="Watch this library" src="https://img.shields.io/github/watchers/maxkeppeler/sheets.svg?style=social&label=Watch"> </a> <a href="https://github.com/maxkeppeler/"> <img style="margin-right: 4px; margin-bottom: 8px" alt="Follow me on GitHub" src="https://img.shields.io/github/followers/maxkeppeler?style=social&label=Follow"> </a> <a href="https://twitter.com/intent/tweet?text=Checkout%20this%20beautiful%20library!%20%23android%20%23androiddev%20%23library%20%40max_keppeler%20%0A%0Ahttps%3A%2F%2Fgithub.com%2Fmaxkeppeler%2Fsheets"> <img style="margin-right: 4px; margin-bottom: 8px" alt="Share this library on Twitter" src="https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Fmaxkeppeler%2Fsheets&label=Share"> </a> <a href="https://twitter.com/max_keppeler"> <img style="margin-right: 4px; margin-bottom: 8px" alt="Follow Maximilian Keppeler on Twitter" src="https://img.shields.io/twitter/follow/max_keppeler?label=Follow&style=social"> </a> </p> </p> <img src="docs/res/showcase.png" alt="Sheets Library">Get started
The library is available for compose as well. Check out Sheets-Compose-Dialogs.
A sheet can dynamically be displayed as either a dialog or as a bottom-sheet. Check out the sample.
You have to use the core module as it is the foundation of any sheet.
In your top-level build.gradle file:
repositories {
...
mavenCentral()
}
In your app build.gradle file:
dependencies {
...
implementation 'com.maxkeppeler.sheets:core:<latest-version>'
}
Use build to build a sheet and display it later.
val sheet = InfoSheet().build(context) {
// build sheet
}
sheet.show() // Show sheet when ready
Use show if you want to build and then immediately display it.
InfoSheet().show(context) {
// build sheet
} // Show sheet
Resources
📖 Get a better insight into the API
Sheets API Documentation
Info
The Info Sheet lets you display information or warning.
<img src="docs/res/InfoSheet Dialog.png" width="80%" alt="Sheets InfoSheet Dialog"><br/> <img src="docs/res/InfoSheet Dialog Cover TopStyle Top.png" width="80%" alt="Sheets InfoSheet Dialog"><br/> <img src="docs/res/InfoSheet Dialog Cover TopStyle Bottom.png" width="80%" alt="Sheets InfoSheet Dialog"><br/> <img src="docs/res/InfoSheet Dialog Cover TopStyle Mixed.png" width="80%" alt="Sheets InfoSheet Dialog"><br/>
</details> </br> <details> <summary>Showcase as BottomSheet</summary> <br/> <br/> <img src="docs/res/InfoSheet BottomSheet.png" width="80%" alt="Sheets InfoSheet"><br/> <img src="docs/res/InfoSheet BottomSheet Cover TopStyle Top.png" width="80%" alt="Sheets InfoSheet BottomSheet"><br/> <img src="docs/res/InfoSheet BottomSheet Cover TopStyle Bottom.png" width="80%" alt="Sheets InfoSheet BottomSheet"><br/> <img src="docs/res/InfoSheet BottomSheet Cover TopStyle Mixed.png" width="80%" alt="Sheets InfoSheet BottomSheet"><br/> </details>dependencies {
...
implementation 'com.maxkeppeler.sheets:info:<latest-version>'
}
Usage
For the default info sheet use it as following:
InfoSheet().show(context) {
title("Do you want to install Awake?")
content("Awake is a beautiful alarm app with morning challenges, advanced alarm management and more.")
onNegative("No") {
// Handle event
}
onPositive("Install") {
// Handle event
}
}
Option
The Option Sheet lets you display a grid or list of options.
<img src="docs/res/OptionsSheet Dialog List.png" width="80%" alt="Sheets OptionsSheet Dialog"><br/> <img src="docs/res/OptionsSheet Dialog Grid Small.png" width="80%" alt="Sheets OptionsSheet" Dialog><br/> <img src="docs/res/OptionsSheet Dialog Grid Large Horizontal.png" width="80%" alt="Sheets OptionsSheet" Dialog><br/>
</details> </br> <details> <br/><br/> <summary>Showcase some variants as BottomSheets</summary><img src="docs/res/OptionsSheet BottomSheet List.png" width="80%" alt="Sheets OptionsSheet BottomSheet"><br/> <img src="docs/res/OptionsSheet BottomSheet Grid Small.png" width="80%" alt="Sheets OptionsSheet" BottomSheet><br/> <img src="docs/res/OptionsSheet BottomSheet Grid Large Horizontal.png" width="80%" alt="Sheets OptionsSheet" BottomSheet><br/>
</details>dependencies {
...
implementation 'com.maxkeppeler.sheets:info:<latest-version>'
}
dependencies {
...
implementation 'com.maxkeppeler.sheets:option:<latest-version>'
}
Usage
For the default options sheet use it as following:
OptionSheet().show(context) {
title("Text message")
with(
Option(R.drawable.ic_copy, "Copy"),
Option(R.drawable.ic_translate, "Translate"),
Option(R.drawable.ic_paste, "Paste")
)
onPositive { index: Int, option: Option ->
// Handle selected option
}
}
Clock
The Clock Sheet lets you quickly pick a time.
dependencies {
...
implementation 'com.maxkeppeler.sheets:clock:<latest-version>'
}
Usage
For the default clock time sheet, in 24-hours format, use it as following:
ClockSheet().show(context) {
title("Wake-up time")
onPositive { clockTimeInMillis: Long ->
// Handle selected time
}
}
Time
The Duration Sheet lets you pick a duration time in a specific format.
dependencies {
...
implementation 'com.maxkeppeler.sheets:duration:<latest-version>'
}
Usage
For the default time sheet use it as following:
DurationSheet().show(context) {
title("Snooze time")
onPositive { durationTimeInMillis: Long ->
// Handle selected time
}
}
Input
The Input Sheet lets you display a form consisting of various inputs.
