public class

CommonToast

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.utils.CommonToast

Class Overview

Toast decorator allowing for easy cancellation of notifications. Use this class if you want subsequent Toast notifications to overwrite current ones.

By default, a current CommonToast notification will be cancelled by a subsequent notification. This default behaviour can be changed by calling certain methods like show(boolean).

Summary

Nested Classes
class CommonToast.CommonToastHandler  
interface CommonToast.CommonToastListener  
Public Methods
void cancel()
Close the view if it's showing, or don't show it if it isn't showing yet.
void show()
Show the view for the specified duration.
void show(boolean cancelCurrent)
Show the view for the specified duration.
static void showText(Context context, CharSequence text, int duration)
Show a standard CommonToast that just contains a text view.
static void showText(Context context, CharSequence text, int duration, int gravity, int xOffset, int yOffset)
static void showText(Context context, int resId)
Show a standard CommonToast that just contains a text view with the text from a resource.
static void showText(Context context, CharSequence text)
Show a standard CommonToast that just contains a text view.
static void showText(Context context, int resId, int duration, int gravity, int xOffset, int yOffset)
static void showText(Context context, int resId, int duration)
Show a standard CommonToast that just contains a text view with the text from a resource.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public void cancel ()

Close the view if it's showing, or don't show it if it isn't showing yet. You do not normally have to call this. Normally view will disappear on its own after the appropriate duration.

public void show ()

Show the view for the specified duration. By default, this method cancels any current notification to immediately display the new one. For conventional Toast.show() queueing behaviour, use method show(boolean).

See Also

public void show (boolean cancelCurrent)

Show the view for the specified duration. This method can be used to cancel the current notification, or to queue up notifications.

Parameters
cancelCurrent true to cancel any current notification and replace it with this new one
See Also

public static void showText (Context context, CharSequence text, int duration)

Show a standard CommonToast that just contains a text view.

public static void showText (Context context, CharSequence text, int duration, int gravity, int xOffset, int yOffset)

public static void showText (Context context, int resId)

Show a standard CommonToast that just contains a text view with the text from a resource. Duration defaults to Toast.LENGTH_SHORT.

Throws
if the resource can't be found.
Resources.NotFoundException

public static void showText (Context context, CharSequence text)

Show a standard CommonToast that just contains a text view. Duration defaults to Toast.LENGTH_SHORT.

public static void showText (Context context, int resId, int duration, int gravity, int xOffset, int yOffset)

Throws
Resources.NotFoundException

public static void showText (Context context, int resId, int duration)

Show a standard CommonToast that just contains a text view with the text from a resource.

Throws
if the resource can't be found.
Resources.NotFoundException