Bottom Sheet Dialog in Andriod application .

Bottom Sheet Dialog box :  Bottom Sheet Dialog is a component that slides up from the bottom of the screen. There are two types of bottom sheets Persistant Bottom Sheet and Modal Bottom Sheet.

Persistant Bottom Sheet : This bottom sheet shows in-application content. It will be shown at the base of the screen with a portion of its part noticeable , it shows full substance in the wake of growing it.

Modal Bottom Sheet : This bottom sheet functions as a menu or discourse with choices, it implies this replaces menu or exchange. It has a higher height than the determined base sheet. For the most part, they are utilized for incorporating profound connecting picker activities.

 How to implement bottom sheet dialog box in Android  app ?

Bottom Sheet Dialogs are very commonly used in a lot of applications today.

Here we will be imitating a bottom sheet dialog like the  Whatsapp App that enables us to set the profile name of our profile.

Like this one …


Let’s get started…

First we will design the basic profile layout. The design of this doesn’t matter much as this blog is focused more on the bottom sheet dialog. So to create the base profile layout paste the following code in your activity_main.xml file 

text_background.xml

After that we need to create a fragment that will be our bottom sheet dialog fragment. In the bottom_sheet,xml file paste in the following code.


Now to handle the functionality of the bottom sheet dialog box, paste the following code in BottomSheet.java file 


And finally, in the MainActivity.java file add this code...

Output :


 Happy Coding !!

Comments

Popular posts from this blog

How to play Audio on Button Click in app | Android App Development | Java

Custom SeekBar in Android Studio .

How to implement simple Pie Chart in app | Android Studio | Java | Android App Development