DialogSheet

Additional

Language
Java
Version
2.0.0 (Oct 26, 2018)
Created
Dec 2, 2017
Updated
Oct 26, 2018
Owner
Marcos Calvo García (marcoscgdev)
Contributors
Marcos Calvo García (marcoscgdev)
jobindcruz
Andrea Cioccarelli (AndreaCioccarelli)
3
Activity
Badge
Generate
Download
Source code
APK file

Advertisement

DialogSheet

An Android library to create fully material designed bottom dialogs similar to the Android Pay app.


    

Creating the dialog with Kotlin

Here is a complete snippet of it usage:

val dialogSheet:DialogSheet = DialogSheet(this@MainActivity)
dialogSheet.setCancelable(false)
    .setTitle(R.string.app_name)
    .setMessage(R.string.lorem)
    .setCancelable(false)
    .setPositiveButton(android.R.string.ok) {
        // Your action
    }
    .setNegativeButton(android.R.string.cancel) {
        // Your action
    }
    .setBackgroundColor(Color.BLACK) // Your custom background color
    .setButtonsColorRes(R.color.colorPrimary)  // Default color is accent
    .show()

Colorize buttons

Add this atribute to your main app theme

<item name="dialogSheetAccent">@color/colorAccent</item>

(TIP) Adding a custom view:

  • Via inflated view:
View view = View.inflate(context, R.layout.custom_dialog_view, null);
dialogSheet.setView(view);
  • Via layout resource:
dialogSheet.setView(R.layout.custom_dialog_view);

// Access dialog custom inflated view
View inflatedView = dialogSheet.getInflatedView();
Button button = (Button) inflatedView.findViewById(R.id.customButton);
...

See the


sample project to clarify any queries you may have.