Which component do I choose to achieve custom dialog at the bottom as shown in the below image? Shall I choose alertdialog
,popupwindow
, or fragmentdialog
?
Asked
Active
Viewed 3.1k times
24

kenlukas
- 3,616
- 9
- 25
- 36

Mithun Kumar
- 595
- 1
- 9
- 18
-
you can use popup window & give in animation for bottom to show – user3040153 Feb 18 '17 at 12:30
-
2Use BottomSheetDialog with custom layout. – ak sacha Feb 18 '17 at 12:31
-
1https://mayojava.github.io/android/bottom-sheets-android/ – sivaBE35 Feb 18 '17 at 12:32
3 Answers
83
Try this
BottomSheetDialog dialog = new BottomSheetDialog(YourActivity.this);
dialog.setContentView(YourView);
dialog.show();
-
3For a great tutorial see: https://medium.com/glucosio-project/moving-from-dialogs-to-bottomsheetdialogs-on-android-15fb8d140295 – BlueBoy Sep 08 '17 at 00:16
-
3
Edit: I didn't there was a built in component in Android to do so. Good to know! Also, check this out:
I would recommend FragmentDialog
without a doubt.
It's so much easier to create a customized Dialog
regarding location & layout design.

JonZarate
- 841
- 6
- 28
0
Kotlin code for run custom ButtomSheetDialog (run inside Activity)
var CustomSelectProfilePicBottomSheetDialog = BottomSheetDialog(this)
val layoutButtomSheetView = this.layoutInflater.inflate(R.layout.ly_custom_buttom_sheet_frg_dialog, null)
CustomSelectProfilePicBottomSheetDialog.setContentView(layoutButtomSheetView)
CustomSelectProfilePicBottomSheetDialog.show()

Hamed Jaliliani
- 2,789
- 24
- 31