All Projects → michael-rapp → Androidbottomsheet

michael-rapp / Androidbottomsheet

Licence: apache-2.0
Provides a bottom sheet as proposed by Android's Material design guidelines.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Androidbottomsheet

JXBottomSheetTableView
A highly packaged, easy to use custom bottom sheet UITableView.
Stars: ✭ 47 (-86.05%)
Mutual labels:  bottomsheet
material-activity-chooser
This library allows to use Material activity choosers on Jelly Bean+.
Stars: ✭ 59 (-82.49%)
Mutual labels:  bottomsheet
Ubottomsheet
iPhone Maps App bottom sheet - A Protocol Oriented Approach
Stars: ✭ 259 (-23.15%)
Mutual labels:  bottomsheet
BottomSheet
A BottomSheet component made with UIKit. Completely written in Swift 🧡
Stars: ✭ 62 (-81.6%)
Mutual labels:  bottomsheet
YYBottomSheet
Simple and Clear BottomSheet
Stars: ✭ 45 (-86.65%)
Mutual labels:  bottomsheet
PullableSheet
Pullable sheet like a default map app or bottom sheets (Android).
Stars: ✭ 65 (-80.71%)
Mutual labels:  bottomsheet
SheetSelection
An Android library for display list and be able to select the item as BottomSheet.
Stars: ✭ 85 (-74.78%)
Mutual labels:  bottomsheet
Cornersheet
Behavior to expand view from corner
Stars: ✭ 274 (-18.69%)
Mutual labels:  bottomsheet
MaterialDesignSample
Android transition元素共享动画、CoordinatorLayout、AppBarLayout、FloatingActionButton、BottomSheet、SnackBar、自定义behavior实现动画效果。
Stars: ✭ 28 (-91.69%)
Mutual labels:  bottomsheet
SlidingUpMenu
🚀 A very customizable library that allows you to present menu items (from menu resource and/or other sources) to users as a bottom sheet.
Stars: ✭ 26 (-92.28%)
Mutual labels:  bottomsheet
BottomSheetBehavior
BottomSheetBehavior is an android library extracted from the Google I/O 2018 application source code.
Stars: ✭ 12 (-96.44%)
Mutual labels:  bottomsheet
Google-Maps-BottomSheet
A BottomSheetBehavior framework mirroring Google Maps'
Stars: ✭ 75 (-77.74%)
Mutual labels:  bottomsheet
BottomSheet
BottomSheet lets you add custom bottom sheets to your SwiftUI apps.
Stars: ✭ 111 (-67.06%)
Mutual labels:  bottomsheet
AmapLike
【高仿】高德地图 包含定位、搜索、路径规划等功能 map bottomsheet
Stars: ✭ 51 (-84.87%)
Mutual labels:  bottomsheet
Bottomsheet Imagepicker
Modern image picker for Android
Stars: ✭ 267 (-20.77%)
Mutual labels:  bottomsheet
react-spring-bottom-sheet
Accessible ♿️, Delightful ✨, & Fast 🚀
Stars: ✭ 604 (+79.23%)
Mutual labels:  bottomsheet
BottomSheet
Example project showing how to implement a bottom sheet in Swift 5 using container/child view controllers, UIPanGestureRecognizer, and constraint animations.
Stars: ✭ 31 (-90.8%)
Mutual labels:  bottomsheet
Gtsheet
An easy to integrate solution for presenting UIViewControllers in a bottom sheet
Stars: ✭ 282 (-16.32%)
Mutual labels:  bottomsheet
Ratebottomsheet
To help to promote your android app by prompting users to rate your app in a BottomSheet ⭐️
Stars: ✭ 268 (-20.47%)
Mutual labels:  bottomsheet
OwlBottomSheet
Simple library to show a bottom sheet like Owl app from Material Design studies cases
Stars: ✭ 44 (-86.94%)
Mutual labels:  bottomsheet

AndroidBottomSheet - README

API-Level License Donate

"AndroidBottomSheet" is an Android-library, which provides a bottom sheet as a proposed by Android's Material design guidelines (see here for further details), which even works on pre-Lollipop devices. A bottom sheet is supposed to contain menu items, which can be clicked by the user. By default only a few items are shown, but by dragging the bottom sheet, it can be expanded to display all items. The following screenshot shows the appearance of a bottom sheet, which has been created by using the library:

The library provides the following features:

  • The library provides a builder, which allows to create bottom sheets by specifying a title, icon, items etc.
  • A bottom sheet's items can be displayed as a list, as a two-columned list or as a grid.
  • It is possible to separate a bottom sheet's items by adding dividers (with optional titles).
  • The library offers a possibility to display all applications, which are suited for handling an Intent, as a bottom sheet's items
  • The items of a bottom sheet can be enabled/disabled individually.
  • As an alternative to displaying items, a bottom sheet's items can be be replaced with a custom view.
  • The library comes with a dark theme in addition to the default light theme. Both themes can be modified by using theme attributes.

License Agreement

This project is distributed under the Apache License version 2.0. For further information about this license agreement's content please refer to its full version, which is available at http://www.apache.org/licenses/LICENSE-2.0.txt.

Prior to version 1.0.1 this library was distributed under the GNU Lesser General Public License version 3.0 (GLPLv3).

Download

The latest release of this library can be downloaded as a zip archive from the download section of the project's Github page, which is available here. Furthermore, the library's source code is available as a Git repository, which can be cloned using the URL https://github.com/michael-rapp/AndroidBottomSheet.git.

Alternatively, the library can be added to your Android app as a Gradle dependency by adding the following to the respective module's build.gradle file:

dependencies {
    compile 'com.github.michael-rapp:android-bottom-sheet:2.0.0'
}

Examples

The following examples illustrate the use of the library. In addition to these examples, a more detailed documentation is contained in the project's Wiki. Furthermore generated javadoc files are available.

The code below shows how to create and show a bottom sheet by using the library's BottomSheet.Builder. The bottom sheet contains a title as well as multiple items and dividers. The this parameter, which is passed to the builder's constructor in the example below, must be a Context, e.g. an Activity. By calling the builder's setOnItemClickListener-method, a listener can be registered to be notified, when one of the bottom sheet's items has been clicked.

BottomSheet.Builder builder = new BottomSheet.Builder(this); 
builder.setTitle(R.string.bottom_sheet_title);
builder.addItem(R.string.item1_title, R.drawable.item1_icon);
builder.addItem(R.string.item2_title, R.drawable.item2_icon);
builder.addDivider();
builder.addItem(R.string.item3_title, R.drawable.item3_icon);
builder.addItem(R.string.item4_title, R.drawable.item4_icon);
builder.addDivider(R.string.divider_title);
builder.addItem(R.string.item5_title, R.drawable.item5_icon);
builder.addItem(R.string.item6_title, R.drawable.item6_icon);
BottomSheet bottomSheet = builder.create();
bottomSheet.show();

Displaying suitable applications for handling an intent

Instead of manually specifying the items of a bottom sheet, it is also possible to display the applications, which are suited for handling a specific Intent. This is possible by using the setIntent-method as shown in the example code below. The this parameter, which is passed to the setIntent-method has to be an Activity.

BottomSheet.Builder builder = new BottomSheet.Builder(this);
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
intent.setType("text/plain");
builder.setIntent(this, intent);

The image below illustrates the appearance of bottom sheets, which show applications that are suited for handling the Intent used in the previous example.

Using the dark theme

By default the bottom sheet uses a light theme, which can be referenced by using the resource id R.style.BottomSheet_Light. If a dark theme should be used instead, the resource id R.style.BottomSheet has to be passed to the builder's constructor like shown below.

BottomSheet.Builder builder = new BottomSheet.Builder(this, R.style.BottomSheet);

Alternatively, the default theme, which is used by all bottom sheets by default, can be changed globally by using the theme attribute bottomSheetTheme. The attribute has to be included in the app's theme, which is defined in the res/values/styles.xml file, like it is shown below:

<resources>

    <style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
        <item name="colorPrimary">@color/color_primary</item>
        <item name="colorPrimaryDark">@color/color_primary_dark</item>
        <item name="colorAccent">@color/color_accent</item>
        <item name="bottomSheetTheme">@style/BottomSheet</item>
    </style>

</resources>

The following screenshot shows the appearance of a bottom sheet using the dark theme.

Contact information

For personal feedback or questions feel free to contact me via the mail address, which is mentioned on my Github profile. If you have found any bugs or want to post a feature request please use the bugtracker to report them.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].