com.github.ignition.core.dialogs
Class IgnitedDialogs

java.lang.Object
  extended by com.github.ignition.core.dialogs.IgnitedDialogs

public class IgnitedDialogs
extends Object


Constructor Summary
IgnitedDialogs()
           
 
Method Summary
static android.app.AlertDialog.Builder newErrorDialog(android.app.Activity activity, int titleId, Exception error)
           
static android.app.AlertDialog.Builder newErrorDialog(android.app.Activity activity, String title, Exception error)
           
static android.app.AlertDialog.Builder newErrorHandlerDialog(android.app.Activity activity, int titleId, String emailAddress, Exception error)
           
static android.app.AlertDialog.Builder newErrorHandlerDialog(android.app.Activity activity, String title, String emailAddress, Exception error)
          Displays a error dialog with an exception's message as its body.
static
<T> android.app.AlertDialog.Builder
newListDialog(android.app.Activity context, String title, List<T> elements, DialogClickListener<T> listener, boolean closeOnSelect)
          Creates a AlertDialog that shows a list of elements.
static
<T> android.app.AlertDialog.Builder
newListDialog(android.app.Activity context, String title, List<T> elements, DialogClickListener<T> listener, boolean closeOnSelect, int selectedItem)
           
static android.app.AlertDialog.Builder newMessageDialog(android.content.Context context, int titleId, int messageId, int iconId)
           
static android.app.AlertDialog.Builder newMessageDialog(android.content.Context context, String title, String message, int iconId)
          Builds a new AlertDialog to display a simple message
static android.app.ProgressDialog newProgressDialog(android.app.Activity activity)
          Creates a new ProgressDialog with the default dialog title and message.
static android.app.ProgressDialog newProgressDialog(android.app.Activity activity, int progressDialogTitleId, int progressDialogMsgId)
          Creates a new ProgressDialog
static android.app.AlertDialog.Builder newYesNoDialog(android.content.Context context, int titleId, int messageId, int iconId, android.content.DialogInterface.OnClickListener listener)
           
static android.app.AlertDialog.Builder newYesNoDialog(android.content.Context context, String title, String message, int iconId, android.content.DialogInterface.OnClickListener listener)
          Builds a new Yes/No AlertDialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IgnitedDialogs

public IgnitedDialogs()
Method Detail

newProgressDialog

public static android.app.ProgressDialog newProgressDialog(android.app.Activity activity,
                                                           int progressDialogTitleId,
                                                           int progressDialogMsgId)
Creates a new ProgressDialog

Parameters:
activity -
progressDialogTitleId - The resource id for the title. If this is less than or equal to 0, a default title is used.
progressDialogMsgId - The resource id for the message. If this is less than or equal to 0, a default message is used.
Returns:
The new dialog

newProgressDialog

public static android.app.ProgressDialog newProgressDialog(android.app.Activity activity)
Creates a new ProgressDialog with the default dialog title and message.

Parameters:
activity -
Returns:

newYesNoDialog

public static android.app.AlertDialog.Builder newYesNoDialog(android.content.Context context,
                                                             String title,
                                                             String message,
                                                             int iconId,
                                                             android.content.DialogInterface.OnClickListener listener)
Builds a new Yes/No AlertDialog

Parameters:
context -
title -
message -
iconId -
listener -
Returns:

newYesNoDialog

public static android.app.AlertDialog.Builder newYesNoDialog(android.content.Context context,
                                                             int titleId,
                                                             int messageId,
                                                             int iconId,
                                                             android.content.DialogInterface.OnClickListener listener)

newMessageDialog

public static android.app.AlertDialog.Builder newMessageDialog(android.content.Context context,
                                                               String title,
                                                               String message,
                                                               int iconId)
Builds a new AlertDialog to display a simple message

Parameters:
context -
title -
message -
iconId -
Returns:

newMessageDialog

public static android.app.AlertDialog.Builder newMessageDialog(android.content.Context context,
                                                               int titleId,
                                                               int messageId,
                                                               int iconId)

newErrorDialog

public static android.app.AlertDialog.Builder newErrorDialog(android.app.Activity activity,
                                                             String title,
                                                             Exception error)

newErrorDialog

public static android.app.AlertDialog.Builder newErrorDialog(android.app.Activity activity,
                                                             int titleId,
                                                             Exception error)

newErrorHandlerDialog

public static android.app.AlertDialog.Builder newErrorHandlerDialog(android.app.Activity activity,
                                                                    String title,
                                                                    String emailAddress,
                                                                    Exception error)
Displays a error dialog with an exception's message as its body. Also displays a Send Email button to send the exception to the developer, if an appropriate Intent handler is available (otherwise it will behave exactly like newErrorDialog(Activity, String, Exception).

Email subject and button label will have default values, but you can override them by defining the following strings resources:

Parameters:
activity -
title -
error -
Returns:

newErrorHandlerDialog

public static android.app.AlertDialog.Builder newErrorHandlerDialog(android.app.Activity activity,
                                                                    int titleId,
                                                                    String emailAddress,
                                                                    Exception error)

newListDialog

public static <T> android.app.AlertDialog.Builder newListDialog(android.app.Activity context,
                                                                String title,
                                                                List<T> elements,
                                                                DialogClickListener<T> listener,
                                                                boolean closeOnSelect)
Creates a AlertDialog that shows a list of elements. The listener's onClick method gets called when the user taps a list item.

Type Parameters:
T - The type of each element
Parameters:
context -
title - the title or null to disable the title
elements - List of elements to be displayed. Each elements toString() method will be called.
listener - The listener to handle the onClick events.
closeOnSelect - If true the dialog closes as soon as one list item is selected, otherwise multiple onClick events may be sent.
Returns:
The new dialog.

newListDialog

public static <T> android.app.AlertDialog.Builder newListDialog(android.app.Activity context,
                                                                String title,
                                                                List<T> elements,
                                                                DialogClickListener<T> listener,
                                                                boolean closeOnSelect,
                                                                int selectedItem)


Copyright © 2012. All Rights Reserved.