Class Notify
- java.lang.Object
-
- com.cheetahdigital.corekit.helpers.Notify
-
public final class Notify extends java.lang.ObjectHelper class for showing soft notifications to the user viaToast,Snackbar, andAlertDialog
-
-
Constructor Summary
Constructors Constructor Description Notify()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidalertOk(android.app.Activity activity, int title, int message)Show the message via aAlertDialogobject.static voidalertOk(android.app.Activity activity, int title, int message, int okButtonTitle, android.content.DialogInterface.OnClickListener okListener)Show the message via aAlertDialogobject.static voidalertOk(android.app.Activity activity, java.lang.String title, java.lang.String message)Show the message via aAlertDialogobject.static voidalertOk(android.app.Activity activity, java.lang.String title, java.lang.String message, java.lang.String okButtonTitle, android.content.DialogInterface.OnClickListener okListener)Show the message via aAlertDialogobject.static voidalertOk(android.app.Activity activity, java.lang.String title, java.lang.String message, java.lang.String okButtonTitle, android.content.DialogInterface.OnClickListener okListener, boolean cancellable)Show the message via aAlertDialogobject.static voidalertOkCancel(android.app.Activity activity, int title, int message, int okButtonTitle, int cancelButtonTitle, android.content.DialogInterface.OnClickListener okListener, android.content.DialogInterface.OnClickListener cancelListener)Show the message via aAlertDialogobject.static voidalertOkCancel(android.app.Activity activity, int title, int message, int okButtonTitle, int cancelButtonTitle, android.content.DialogInterface.OnClickListener okListener, android.content.DialogInterface.OnClickListener cancelListener, android.content.DialogInterface.OnDismissListener onDismissListener)Show the message via aAlertDialogobject.static voidalertOkCancel(android.app.Activity activity, java.lang.String title, java.lang.String message, java.lang.String okButtonTitle, java.lang.String cancelButtonTitle, android.content.DialogInterface.OnClickListener okListener, android.content.DialogInterface.OnClickListener cancelListener)Show the message via aAlertDialogobject.static voidalertOkCancel(android.app.Activity activity, java.lang.String title, java.lang.String message, java.lang.String okButtonTitle, java.lang.String cancelButtonTitle, android.content.DialogInterface.OnClickListener okListener, android.content.DialogInterface.OnClickListener cancelListener, boolean cancellable)static voidalertOkCancelNeutral(android.app.Activity activity, java.lang.String title, java.lang.String message, java.lang.String okButtonTitle, java.lang.String cancelButtonTitle, java.lang.String neutralButtonTitle, android.content.DialogInterface.OnClickListener okListener, android.content.DialogInterface.OnClickListener cancelListener, android.content.DialogInterface.OnClickListener neutralListener, android.content.DialogInterface.OnDismissListener onDismissListener)Show the message via aAlertDialogobject.static voidalertOkCancelWithLinks(android.app.Activity activity, java.lang.String title, java.lang.String message, java.lang.String okButtonTitle, android.content.DialogInterface.OnClickListener okListener, boolean cancellable)static voidalertOkCancelWithLinks(android.app.Activity activity, java.lang.String title, java.lang.String message, java.lang.String okButtonTitle, java.lang.String cancelButtonTitle, android.content.DialogInterface.OnClickListener okListener, android.content.DialogInterface.OnClickListener cancelListener, boolean cancellable)static voidcreateNotification(android.content.Context context, int id, int color, java.lang.String type, java.lang.String message, boolean autoCancel, android.app.PendingIntent pendingIntent)static voidsnack(android.view.View view, java.lang.String message)Show the message via aSnackbarobject.static voidsnack(android.view.View view, java.lang.String message, int duration)Show the message via aSnackbarobject.static voidsnack(android.view.View view, java.lang.String message, java.lang.String actionText, android.view.View.OnClickListener listener, int duration)Show the message via aSnackbarobject.static voidtoast(android.content.Context context, int message)Show the message via aToastobject.static voidtoast(android.content.Context context, int message, int duration)Show the message via aToastobject.static voidtoast(android.content.Context context, java.lang.String message)Show the message via aToastobject.static voidtoast(android.content.Context context, java.lang.String message, int duration)Show the message via aToastobject.
-
-
-
Method Detail
-
toast
@UiThread public static void toast(android.content.Context context, java.lang.String message)Show the message via aToastobject. NOTE: Default duration isToast.LENGTH_LONG- Parameters:
context- the current AndroidContextmessage- the message to be shown to the user
-
toast
public static void toast(android.content.Context context, @StringRes int message)Show the message via aToastobject. NOTE: Default duration isToast.LENGTH_LONG- Parameters:
context- the current AndroidContextmessage- the message to be shown to the user
-
toast
@UiThread public static void toast(android.content.Context context, java.lang.String message, int duration)Show the message via aToastobject.- Parameters:
context- the current AndroidContextmessage- the message to be shown to the userduration- theToastduration
-
toast
@UiThread public static void toast(android.content.Context context, @StringRes int message, int duration)Show the message via aToastobject.- Parameters:
context- the current AndroidContextmessage- the message to be shown to the userduration- theToastduration
-
snack
@UiThread public static void snack(android.view.View view, java.lang.String message)Show the message via aSnackbarobject. NOTE: Default duration isBaseTransientBottomBar.LENGTH_LONG- Parameters:
view- the view to anchor theSnackbartomessage- the message to be shown to the user
-
snack
@UiThread public static void snack(android.view.View view, java.lang.String message, int duration)Show the message via aSnackbarobject.- Parameters:
view- the view to anchor theSnackbartomessage- the message to be shown to the userduration- theSnackbarduration
-
snack
@UiThread public static void snack(android.view.View view, java.lang.String message, java.lang.String actionText, android.view.View.OnClickListener listener, int duration)Show the message via aSnackbarobject. NOTE: Default duration isBaseTransientBottomBar.LENGTH_LONG- Parameters:
view- the view to anchor theSnackbartomessage- the message to be shown to the useractionText- the text for the action buttonlistener- the listener for clicking the action buttonduration- theSnackbarduration
-
createNotification
public static void createNotification(android.content.Context context, int id, int color, java.lang.String type, java.lang.String message, boolean autoCancel, android.app.PendingIntent pendingIntent)
-
alertOk
public static void alertOk(android.app.Activity activity, java.lang.String title, java.lang.String message)Show the message via aAlertDialogobject. NOTE: Default title is "Ok"- Parameters:
activity- the AndroidActivitytitle- the title for theAlertDialogmessage- the message to be shown to the user
-
alertOk
public static void alertOk(android.app.Activity activity, @StringRes int title, @StringRes int message)Show the message via aAlertDialogobject. NOTE: Default title is "Ok"- Parameters:
activity- the AndroidActivitytitle- the title for theAlertDialogmessage- the message to be shown to the user
-
alertOk
public static void alertOk(android.app.Activity activity, java.lang.String title, java.lang.String message, java.lang.String okButtonTitle, android.content.DialogInterface.OnClickListener okListener)Show the message via aAlertDialogobject.- Parameters:
activity- the AndroidActivitytitle- the title for theAlertDialogmessage- the message to be shown to the userokButtonTitle- the positive button titleokListener- the positive button listener
-
alertOk
public static void alertOk(android.app.Activity activity, java.lang.String title, java.lang.String message, java.lang.String okButtonTitle, android.content.DialogInterface.OnClickListener okListener, boolean cancellable)Show the message via aAlertDialogobject.- Parameters:
activity- the AndroidActivitytitle- the title for theAlertDialogmessage- the message to be shown to the userokButtonTitle- the positive button titleokListener- the positive button listenercancellable- true to make dialog cancellable, else false
-
alertOk
public static void alertOk(android.app.Activity activity, @StringRes int title, @StringRes int message, @StringRes int okButtonTitle, android.content.DialogInterface.OnClickListener okListener)Show the message via aAlertDialogobject.- Parameters:
activity- the AndroidActivitytitle- the title for theAlertDialogmessage- the message to be shown to the userokButtonTitle- the positive button titleokListener- the positive button listener
-
alertOkCancel
public static void alertOkCancel(android.app.Activity activity, java.lang.String title, java.lang.String message, java.lang.String okButtonTitle, java.lang.String cancelButtonTitle, android.content.DialogInterface.OnClickListener okListener, android.content.DialogInterface.OnClickListener cancelListener)Show the message via aAlertDialogobject.- Parameters:
activity- the AndroidActivitytitle- the title for theAlertDialogmessage- the message to be shown to the userokButtonTitle- the positive button titleokListener- the positive button listenercancelButtonTitle- the negative button titlecancelListener- the negative button listener
-
alertOkCancel
public static void alertOkCancel(android.app.Activity activity, java.lang.String title, java.lang.String message, java.lang.String okButtonTitle, java.lang.String cancelButtonTitle, android.content.DialogInterface.OnClickListener okListener, android.content.DialogInterface.OnClickListener cancelListener, boolean cancellable)
-
alertOkCancelWithLinks
public static void alertOkCancelWithLinks(android.app.Activity activity, java.lang.String title, java.lang.String message, java.lang.String okButtonTitle, android.content.DialogInterface.OnClickListener okListener, boolean cancellable)
-
alertOkCancelWithLinks
public static void alertOkCancelWithLinks(android.app.Activity activity, java.lang.String title, java.lang.String message, java.lang.String okButtonTitle, java.lang.String cancelButtonTitle, android.content.DialogInterface.OnClickListener okListener, android.content.DialogInterface.OnClickListener cancelListener, boolean cancellable)
-
alertOkCancel
public static void alertOkCancel(android.app.Activity activity, @StringRes int title, @StringRes int message, @StringRes int okButtonTitle, @StringRes int cancelButtonTitle, android.content.DialogInterface.OnClickListener okListener, android.content.DialogInterface.OnClickListener cancelListener)Show the message via aAlertDialogobject.- Parameters:
activity- the AndroidActivitytitle- the title for theAlertDialogmessage- the message to be shown to the userokButtonTitle- the positive button titleokListener- the positive button listenercancelButtonTitle- the negative button titlecancelListener- the negative button listener
-
alertOkCancel
public static void alertOkCancel(android.app.Activity activity, @StringRes int title, @StringRes int message, @StringRes int okButtonTitle, @StringRes int cancelButtonTitle, android.content.DialogInterface.OnClickListener okListener, android.content.DialogInterface.OnClickListener cancelListener, android.content.DialogInterface.OnDismissListener onDismissListener)Show the message via aAlertDialogobject.- Parameters:
activity- the AndroidActivitytitle- the title for theAlertDialogmessage- the message to be shown to the userokButtonTitle- the positive button titleokListener- the positive button listenercancelButtonTitle- the negative button titlecancelListener- the negative button listeneronDismissListener- callback after dismiss dialog
-
alertOkCancelNeutral
public static void alertOkCancelNeutral(android.app.Activity activity, java.lang.String title, java.lang.String message, java.lang.String okButtonTitle, java.lang.String cancelButtonTitle, java.lang.String neutralButtonTitle, android.content.DialogInterface.OnClickListener okListener, android.content.DialogInterface.OnClickListener cancelListener, android.content.DialogInterface.OnClickListener neutralListener, android.content.DialogInterface.OnDismissListener onDismissListener)Show the message via aAlertDialogobject.- Parameters:
activity- the AndroidActivitytitle- the title for theAlertDialogmessage- the message to be shown to the userokButtonTitle- the positive button titleokListener- the positive button listenercancelButtonTitle- the negative button titlecancelListener- the negative button listenerneutralButtonTitle- the neutral button titleneutralListener- the neutral button listeneronDismissListener- callback after dismiss dialog
-
-