Android Bottom Sheet

MaterialDialogBottomSheet

 

Bottom sheets:

A bottom sheet is a sheet of material that slides up from the bottom edge of the screen and presents a set of clear and simple actions.

Bottom sheets are primarily a mobile component.

Usage:

Bottom sheets are best suited to displaying three or more actions that do not require a description. If there are fewer than three actions, or a detailed description is required, consider using a menu or dialog instead.

You can use bottom sheets to show actions related to other apps, or to allow entry points to other apps (via the app icon).

Bottom sheets can be list-style or grid-style. Grid layouts are easier to scan.

MaterialDialogBottomSheet:

MaterialDialogBottomSheet is a custom dialog implementation to use BottomSheet MaterialView feature in pre Lollipop versions.

It can be used with an ease by simply enabling dialog as a BottomSheet without using any library integration.

Now let us see how to make your own custom dialog as follows,

STEP 1:  Create an Activity or fragment with Dialog instance and assign bottom sheet custom layout in yoursetContentView of dialog.

 MainActivity.java

 

 activity_main.xml

 bottom_sheet.xml

STEP 2:  Assign Dialog style attributes in styles.xml and create an xml animation file in anim folder for BottomSheet(i.e.,Bottom to Top Animation).

styles.xml

popup_show.xml

popup_hide.xml

STEP 3:  To know further about designing icon and principles for BottomSheet, Please visit the official page of Google.

 

Download complete code

posted @ 2016-03-02 03:35  crazy_machine  阅读(575)  评论(0)    收藏  举报