Skip to content

Helpers to create and handle Android alert dialogs in an RxJava workflow.

Notifications You must be signed in to change notification settings

xavierlepretre/rx-alert-dialog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rx-alert-dialog

Helpers to create and handle Android alert dialogs in an RxJava workflow.

Usage

To use the regular Android dialog from your Activity, call:

new RxAlertDialog.Builder(this)
	.title("Title")
	.message("Some action is required")
	.positiveButton("OK")
	.negativeButton("NO")
	.neutralButton("LATER")
	.show()
	.subscribe(new Observer(){
	...
	})

To use the Support dialog from your Activity, call:

new RxAlertDialogSupport.Builder(this)
	.title("Title")
	.message("Some action is required")
	.positiveButton("OK")
	.negativeButton("NO")
	.neutralButton("LATER")
	.show()
	.subscribe(new Observer(){
	...
	})

You can also call .create(), but you have to call .show() on the dialog, when it comes with the first event.

Events

  1. When you call create() or show(), you get:
    • For regular Android dialog: one AlertDialogDialogEvent where getAlertDialog() gives you the created dialog.
    • For Support dialog: one AlertDialogSupportDialogEvent where getAlertDialog() gives you the created dialog.
  2. When you click a button on the dialog, you get:
    • one AlertDialogButtonEvent where .getWhich() tells you which button was pressed.
    • the onCompleted() signal right away.
  3. When you .dismiss() the dialog, you get:
    • the onCompleted() signal right away.
  4. If you .unsubscribe() the Observable, then the dialog will be dismissed.

About

Helpers to create and handle Android alert dialogs in an RxJava workflow.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages