Common dialog fragments

Overview

MaterialDialogFragments Release

Common dialog fragments based on https://github.com/afollestad/material-dialogs

Features

  • handles fragments save/restore states for you automatically
  • includes mechanism to handle dialog events (even after screen restoration) inside activity and/or fragments
  • includes some special dialogs (extracted in own modules) like e.g. a custom color dialog, text and number dialogs, multi text and number dialogs, a fast adapter recycler view dialog, an ads dialog - maybe even more to come
  • also supports to show dialogs as dialog or bottom sheet
  • easily extendable - create you own dialogs, simply check out the extension modules

Screenshots

Dialog Simple info dialog Dialog Info dialog with Timeout + Warning Dialog Info dialog with HTML content
Dialog Simple list dialog Dialog Multi select list dialog with images Dialog Multi select list dialog with custom check marks
Dialog Multi click list dialog Dialog Custom parcelable data list dialog Dialog Color picker dialog
Dialog Datetime dialog Dialog EditText dialog Dialog Multi EditText dialog
Dialog Number dialog Dialog Custom number dialog Dialog Multi number dialog
Dialog Progress dialog Dialog Frequency dialog Dialog Debug settings dialog

Gradle (via JitPack.io)

  1. add jitpack to your project's build.gradle:
repositories {
    maven { url "https://jitpack.io" }
}
  1. add the implementation statement(s) to your module's build.gradle:
" // -------- // optional // -------- // input - DialogInput, DialogNumber, DialogNumberPicker implementation "com.github.MFlisar.MaterialDialogFragments:dialogs-input:" // specials implementation "com.github.MFlisar.MaterialDialogFragments:dialogs-datetime:" implementation "com.github.MFlisar.MaterialDialogFragments:dialogs-fastadapter:" implementation "com.github.MFlisar.MaterialDialogFragments:dialogs-color:" implementation "com.github.MFlisar.MaterialDialogFragments:dialogs-frequency:" implementation "com.github.MFlisar.MaterialDialogFragments:dialogs-ads:" // -------- // alternatively, to include ALL modules at once // -------- // implementation 'com.github.MFlisar:MaterialDialogFragments:' } ">
dependencies {

	// --------
	// core - DialogInfo, DialogList, DialogProgress
	// --------
	
	implementation "com.github.MFlisar.MaterialDialogFragments:dialogs:"
	
	// --------
	// optional
	// --------
	
	// input - DialogInput, DialogNumber, DialogNumberPicker
	implementation "com.github.MFlisar.MaterialDialogFragments:dialogs-input:"
	
	// specials	
	implementation "com.github.MFlisar.MaterialDialogFragments:dialogs-datetime:"
	implementation "com.github.MFlisar.MaterialDialogFragments:dialogs-fastadapter:"	
	implementation "com.github.MFlisar.MaterialDialogFragments:dialogs-color:"
	implementation "com.github.MFlisar.MaterialDialogFragments:dialogs-frequency:"
	implementation "com.github.MFlisar.MaterialDialogFragments:dialogs-ads:"

	// --------
	// alternatively, to include ALL modules at once
	// --------
	
	// implementation 'com.github.MFlisar:MaterialDialogFragments:'
}

Usage

Usage is very simply, you only need to do following:

  • Activities or Fragments using the dialog fragments must implement the simple DialogFragmentCallback interface:

      interface DialogFragmentCallback {
      	fun onDialogResultAvailable(event: BaseDialogEvent): Boolean
      }
    
  • you create a dialog with the corresponding setup class like e.g.:

      DialogInfo(
      	1, // ID - this allows you to identify dialog events in the callback
      	"Info Title".asText(),
      	"Some info label".asText()
      )
      		.create()
      		.show(this)
    
  • in the DialogFragmentCallback you can handle the result now like following:

      override fun onDialogResultAvailable(event: BaseDialogEvent): Boolean {
          return when (event) {
      		is DialogInfoEvent -> {
      			Toast.makeText(this, "Info dialog closed - ID = ${event.id}", Toast.LENGTH_SHORT).show()
      			true
      		} else false
      	}
      }
    

That's all. Optionally you can set up some global settings like following, preferably in your application class once only:

DialogSetup.SEND_CANCEL_EVENT_BY_DEFAULT = true

The DialogSetup offers some other settings as well.

Check the demo app for more informations.

You might also like...
Android library that allows applications to add dialog-based slider widgets to their settings
Android library that allows applications to add dialog-based slider widgets to their settings

Android Slider Preference Library Overview Slider represents a float between 0.0 and 1.0 Access with SliderPreference.getValue() or SharedPreferences.

An Android library for displaying a dialog where it presents new features in the app.
An Android library for displaying a dialog where it presents new features in the app.

WhatIsNewDialog What is new dialog for Android is used for presenting new features in the the app. It can be used in the activity starts, from menu or

Android library to show
Android library to show "Rate this app" dialog

Android-RateThisApp Android-RateThisApp is an library to show "Rate this app" dialog. The library monitors the following status How many times is the

An easy to use, yet very customizable search dialog
An easy to use, yet very customizable search dialog

search-dialog An awesome and customizable search dialog with built-in search options. Usage First add jitpack to your projects build.gradle file allpr

Custom Dialog
Custom Dialog

Custom Dialog use Lottie Dialog How To Use? If yow want specific lottie file you must put your assets to under app → src → main → assets folder Add li

Extremely useful library to validate EditText inputs whether by using just the validator for your custom view or using library's extremely resizable & customisable dialog
Extremely useful library to validate EditText inputs whether by using just the validator for your custom view or using library's extremely resizable & customisable dialog

Extremely useful library for validating EditText inputs whether by using just the validator (OtpinVerification) for your custom view or using library's extremely resizable & customisable dialog (OtpinDialogCreator)

A simple library to show custom dialog with animation in android
A simple library to show custom dialog with animation in android

SmartDialog A simple library to show custom dialog in android Step 1. Add the JitPack repository to your build file allprojects { repositories {

AlertDialog for Android, a beautiful and material alert dialog to use in your android app.
AlertDialog for Android, a beautiful and material alert dialog to use in your android app.

AlertDialog for Android, a beautiful and material alert dialog to use in your android app. Older verion of this library has been removed

Awesome Dialog built with Jetpack Compose
Awesome Dialog built with Jetpack Compose

Compose Awesome Dialog Library untuk Android Native yang menggunakan Jetpack Compose untuk toolkit UI nya. Compose Awesome Dialog ini menampilkan Dial

Releases(0.90)
Owner
null
Android has a built in microphone through which you can capture audio and store it , or play it in your phone. There are many ways to do that but with this dialog you can do all thats with only one dialog.

# Media Recorder Dialog ![](https://img.shields.io/badge/Platform-Android-brightgreen.svg) ![](https://img.shields.io/badge/Android-CustomView-blue.sv

Abdullah Alhazmy 73 Nov 29, 2022
ionalert 1.3 1.6 Java Sweetalert, Dialog, Alert Dialog

ionalert - Android Alert Dialog A beautiful design Android Alert Dialog, alternative of Sweet Alert Dialog based on KAlertDialog using MaterialCompone

Excel Dwi Oktavianto 23 Sep 17, 2022
Alert Dialog - You can use this extension instead of creating a separate Alert Dialog for each Activity or Fragment.

We show a warning message (Alert Dialog) to the user in many parts of our applications. You can use this extension instead of creating a separate Alert Dialog for each Activity or Fragment. Thanks to this extension, you can create a Dialog and call it in the Activity or Fragment you want and customize the component you want.

Gökmen Bayram 0 Jan 9, 2022
Advanced dialog solution for android

DialogPlus Simple and advanced dialog solution. Uses normal view as dialog Provides expandable option Multiple positioning Built-in options for easy i

Orhan Obut 5k Dec 29, 2022
SweetAlert for Android, a beautiful and clever alert dialog

Sweet Alert Dialog SweetAlert for Android, a beautiful and clever alert dialog 中文版 Inspired by JavaScript SweetAlert Demo Download ScreenShot Setup Th

书呆子 7.3k Dec 30, 2022
An Android Dialog Lib simplify customization.

FlycoDialog-Master 中文版 An Android Dialog Lib simplify customization. Supprot 2.2+. Features [Built-in Dialog, convenient to use](#Built-in Dialog) [Ab

Flyco 2.3k Dec 8, 2022
[Deprecated] This project can make it easy to theme and custom Android's dialog. Also provides Holo and Material themes for old devices.

Deprecated Please use android.support.v7.app.AlertDialog of support-v7. AlertDialogPro Why AlertDialogPro? Theming Android's AlertDialog is not an eas

Feng Dai 468 Nov 10, 2022
Android library to show "Rate this app" dialog

Android-RateThisApp Android-RateThisApp is an library to show "Rate this app" dialog. The library monitors the following status How many times is the

Keisuke Kobayashi 553 Nov 23, 2022
A simple file/ directory picker dialog for android

FileListerDialog FileListerDialog helps you to list and pick file/directory. Library is built for Android Getting Started Installing To use this libra

Yogesh S 446 Jan 7, 2023
a quick custom android dialog project

QustomDialog Qustom helps you make quick custom dialogs for Android. All this is, for the time being, is a way to make it easy to achieve the Holo loo

Daniel Smith 183 Nov 20, 2022