public class

ConfirmDialog

extends Dialog
java.lang.Object
   ↳ com.neomades.ui.dialog.Dialog
     ↳ com.neomades.ui.dialog.ConfirmDialog

Class Overview

A confirm dialog has a title, a message and can have 2 or 3 buttons :

  • a button 1 to have a positive response (eg. "Yes")
  • a button 2 to have a negative response (eg. "No")
  • a button 3 to have another type of response like "Cancel" (eg: cancel to exit application)

The text of these 3 buttons is customizable.

To enable the button 3, just set its text (see setButton3Text(int), setButton3Text(String)). This dialog will be automatically closed when the user clicks on one of the buttons.

Summary

Public Constructors
ConfirmDialog()
Constructs a confirm dialog, with 2 buttons with no text.
Public Methods
void setButton1Text(int resId)
Sets the text of the button 1
void setButton1Text(String text)
Sets the text of the button 1
void setButton2Text(String text)
Sets the text of the button 2
void setButton2Text(int resId)
Sets the text of the button 2
void setButton3Text(int resId)
Sets the text of the button 3.
void setButton3Text(String text)
Sets the text of the button 3.
void setDialogClickListener(DialogClickListener listener)
Sets the click listener to this dialog button.
void setMessage(String message)
Sets the message that will be displayed by this dialog
void setMessage(int resId)
Sets the message that will be displayed by this dialog
[Expand]
Inherited Methods
From class com.neomades.ui.dialog.Dialog
From class java.lang.Object

Public Constructors

public ConfirmDialog ()

Constructs a confirm dialog, with 2 buttons with no text.

Public Methods

public void setButton1Text (int resId)

Sets the text of the button 1

Parameters
resId the id ot the text of the button 1

public void setButton1Text (String text)

Sets the text of the button 1

Parameters
text the text of the button 1

public void setButton2Text (String text)

Sets the text of the button 2

Parameters
text the text of the button 2

public void setButton2Text (int resId)

Sets the text of the button 2

Parameters
resId the id of the text of the button 2

public void setButton3Text (int resId)

Sets the text of the button 3.

(Optional)

Parameters
resId the id of the text of the button 3

public void setButton3Text (String text)

Sets the text of the button 3.

(Optional)

Setting null to the text will remove the button from the dialog.

Parameters
text the text of the button 3

public void setDialogClickListener (DialogClickListener listener)

Sets the click listener to this dialog button.

The method onDialogClick(Dialog, int) of the listener will be called when the button is clicked (null could be passed in parameter of this method)

Parameters
listener the listener

public void setMessage (String message)

Sets the message that will be displayed by this dialog

Parameters
message the message

public void setMessage (int resId)

Sets the message that will be displayed by this dialog

Parameters
resId the id of the message