DialogSheet

Additional

Language
Java
Version
2.0.5 (Apr 21, 2019)
Created
Dec 2, 2017
Updated
Apr 21, 2019
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

Commercial

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)
    .setTitle(R.string.app_name)
    .setMessage(R.string.lorem)
    .setColoredNavigationBar(true)
    .setCancelable(false)
    .setPositiveButton(android.R.string.ok) {
        // Your action
    }
    .setNegativeButton(android.R.string.cancel) {
        // Your action
    }
    .setRoundedCorners(false) // Default value is true
    .setBackgroundColor(Color.BLACK) // Your custom background color
    .setButtonsColorRes(R.color.colorPrimary)  // Default color is accent
    .show()

Colorize buttons (necessary)

Add this atribute to your main app theme

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

Customize corner radius

Simply override this dimen with your desired size

<dimen name="dialog_sheet_corner_radius">16dp</dimen>

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.