gitmyhub

bottomsheet

Java ★ 4.5k updated 7y ago

Android component which presents a dismissible view from the bottom of the screen

BottomSheet is an Android UI component made by Flipboard that slides a panel up from the bottom edge of the screen. The panel can be dismissed by the user and can contain any content, making it a flexible alternative to pop-up dialogs and context menus. Flipboard used this component in their own app before releasing it publicly.

The library is split into two modules. The core module provides the BottomSheetLayout container, which you wrap around your existing screen layout. Once that wrapper is in place, you can show any view inside it with a single method call. The optional commons module adds three pre-built panel types ready to drop into an app.

The three commons components cover common Android patterns. IntentPickerSheetView shows a list of apps that can handle a given action, such as sharing a link, and supports filtering and sorting the list of options. MenuSheetView renders an Android menu resource inside a bottom panel, with support for list and grid layouts, separators, and section headers. ImagePickerSheetView lets users choose images from their device.

Installation uses Gradle, the standard Android build tool. You add the dependency lines to your build file, wrap your layout XML with the BottomSheetLayout tag, then reference it in your Java or Kotlin code like any other view. The README includes code samples for each of these steps.

Contributions to the repository require signing Flipboard's individual contributor license agreement before changes can be merged. API documentation and recipe examples are available in the project's wiki.