This repository has been archived by the owner on Aug 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 48
Home
Michael Bel edited this page Mar 15, 2018
·
5 revisions
1. Add a dependency to your build.gradle
file:
dependencies {
implementation 'org.michaelbel:bottomsheet:1.2.2'
}
2. Create and show dialog:
private void showDialog() {
int[] items = new int[] {
R.string.share,
R.string.upload,
R.string.copy,
R.string.print
};
int[] icons = new int[] {
R.drawable.ic_share,
R.drawable.ic_upload,
R.drawable.ic_copy,
R.drawable.ic_print
};
BottomSheet.Builder builder = new BottomSheet.Builder(context);
builder.setTitle(R.string.dialog_title);
builder.setItems(items, icons, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// your code...
}
});
builder.show();
}