Android Programming Press on the image to return to the main documentation page.

ToastMessageShow

Written by Giuseppe Salvi

List of types:

ToastMessageShow

ToastMessageShow


Events:

DismissOnTouch
Done(Done As Boolean)
Click
LongClick
ButtonClick(Id As Int,Tag As Object)
ButtonLongClick(Id As Int,Tag As Object)

Members:


  Animation As AnimationWrapper [read only]

  Cancel

  CancelAll

  create (text As CharSequence) As ToastMessageShow

  Duration As DurationWrapper [read only]

  GradientType As GradientTypes [read only]

  Gravity As ToastGravityWrapper [read only]

  IconPosition As IconPositionWrapper [read only]

  Initialize (EventName As String)

  LoadFontFromAssets As String [write only]

  LoadFontFromFile As String [write only]

  Orientation As OrientationsWrapper [read only]

  Show

  TextSize As TextSizeWrapper [read only]

  TypeFace As ToastTypefaceWrapper [read only]

  Version As String [read only]

  withAnimation (animation As Int) As ToastMessageShow

  withBackGroundColor (color As Object) As ToastMessageShow

  withBackGroundGradient (startColor As Object, endColor As Object) As ToastMessageShow

  withBackGroundGradientArray (arrayColor() As Object) As ToastMessageShow

  withBackGroundImage (bitmap As android.graphics.Bitmap) As ToastMessageShow

  withBackGroundResources (resources As String) As ToastMessageShow

  withButton (text As CharSequence, text1 As CharSequence, text2 As CharSequence) As ToastMessageShow

  withButtonColor (color As Int) As ToastMessageShow

  withButtonStyle (resources As String) As ToastMessageShow

  withButtonTextColor (color As Object) As ToastMessageShow

  withButtonTextSize (size As Int) As ToastMessageShow

  withCornerRadius (cornerRadius As Int) As ToastMessageShow

  withDither (dither As Boolean) As ToastMessageShow

  withDividerColor (color As Object) As ToastMessageShow

  withDividerHeight (height As Int) As ToastMessageShow

  withDividerPadding (padding As Int) As ToastMessageShow

  withDividerToText (show As Boolean) As ToastMessageShow

  withDividerToTitle (show As Boolean) As ToastMessageShow

  withDuration (duration As Int) As ToastMessageShow

  withGradientCenter (centerX As Float, centerY As Float) As ToastMessageShow

  withGradientRadius (radius As Float) As ToastMessageShow

  withGradientType (type As Int) As ToastMessageShow

  withGravity (gravity As Int) As ToastMessageShow

  withIconSize (width As Int, height As Int) As ToastMessageShow

  withIconSize128x128 As ToastMessageShow

  withIconSize256x256 As ToastMessageShow

  withIconSize32x32 As ToastMessageShow

  withIconSize48x48 As ToastMessageShow

  withIconSize64x64 As ToastMessageShow

  withIconToText (bitmap As android.graphics.Bitmap, iconTextPosition As Int) As ToastMessageShow

  withImageAlpha (alpha As Int) As ToastMessageShow

  withImageBitmap (bitmap As android.graphics.Bitmap, imagePosition As Int) As ToastMessageShow

  withImageButton (bitmap As android.graphics.Bitmap, iconPosition As Int, bitmap2 As android.graphics.Bitmap, iconPosition2 As Int, bitmap3 As android.graphics.Bitmap, iconPosition3 As Int) As ToastMessageShow

  withOrientation (orientation As android.graphics.drawable.GradientDrawable.Orientation) As ToastMessageShow

  withOval (oval As Boolean) As ToastMessageShow

  withPaddingLeftRight (padding As Int) As ToastMessageShow

  withPaddingTopBottom (padding As Int) As ToastMessageShow

  withStroke (strokeWidth As Int, strokeColor As Object) As ToastMessageShow

  withTextColor (color As Object) As ToastMessageShow

  withTextGravity (gravity As Int) As ToastMessageShow

  withTextPadding (padding As Int) As ToastMessageShow

  withTextShadow (radius As Float, dx As Float, dy As Float, color As Object) As ToastMessageShow

  withTextSize (textSize As Int) As ToastMessageShow

  withTextStyle (textStyle As Int) As ToastMessageShow

  withTextTypeFace (typeFace As android.graphics.Typeface) As ToastMessageShow

  withTitle (text As CharSequence) As ToastMessageShow

  withTitleColor (color As Object) As ToastMessageShow

  withTitleGravity (gravity As Int) As ToastMessageShow

  withTitleShadow (radius As Float, dx As Float, dy As Float, color As Object) As ToastMessageShow

  withTitleSize (titleSize As Int) As ToastMessageShow

  withTitleStyle (titleStyle As Int) As ToastMessageShow

  withTitleTypeFace (typeFace As android.graphics.Typeface) As ToastMessageShow

  withXOffset (xOffset As Int) As ToastMessageShow

  withYOffset (yOffset As Int) As ToastMessageShow

Members description:

Animation As AnimationWrapper [read only]
Gets the Animation for the toast.
Cancel
Hide and remove the toast.
CancelAll
Cancels/removes all showing pending toasts.
create (text As CharSequence) As ToastMessageShow
Create toast with text.
text:
Duration As DurationWrapper [read only]
Gets the duration for the toast.
GradientType As GradientTypes [read only]
Changes the type of the gradient defined in this drawable.
Gravity As ToastGravityWrapper [read only]
Gets the gravity for the toast, text and title.
IconPosition As IconPositionWrapper [read only]
Gets the positions for icons.
Initialize (EventName As String)
Initialize the Object
LoadFontFromAssets As String [write only]
Loads a new Type face from the specified font data for text and title.
LoadFontFromFile As String [write only]
Loads a new Type face from the specified font data for text and title.
Orientation As OrientationsWrapper [read only]
Changes the orientation of the gradient defined in this drawable.
Show
Show toast which the notification should appear on the screen.
TextSize As TextSizeWrapper [read only]
Gets the size for the text,title and button text.
TypeFace As ToastTypefaceWrapper [read only]
Gets the type face and style in which the text should be displayed.
Note that not all Type face families actually have bold and italic variants,
so you may need to use TextStyle(style) to get the appearance that you actually want.
Version As String [read only]
Return Author and Version of this library.
withAnimation (animation As Int) As ToastMessageShow
Sets the animation which the notification should appear on the screen.
animation:
withBackGroundColor (color As Object) As ToastMessageShow
Create toast with background color.
color:
withBackGroundGradient (startColor As Object, endColor As Object) As ToastMessageShow
Create toast with background gradient.
startColor:
endColor:
withBackGroundGradientArray (arrayColor() As Object) As ToastMessageShow
Create toast with background gradient.
arrayColor.:
withBackGroundImage (bitmap As android.graphics.Bitmap) As ToastMessageShow
Create toast with background image.
bitmap:
withBackGroundResources (resources As String) As ToastMessageShow
Create toast with background from res as Nine-patch or Xml.
resources:
withButton (text As CharSequence, text1 As CharSequence, text2 As CharSequence) As ToastMessageShow
Create toast with 1,2 or 3 buttons.
text:
text1:
text2:
withButtonColor (color As Int) As ToastMessageShow
Set color to the buttons.
color:
withButtonStyle (resources As String) As ToastMessageShow
Sets a style for the buttons from res.
resources:
withButtonTextColor (color As Object) As ToastMessageShow
Set button text color.
color:
withButtonTextSize (size As Int) As ToastMessageShow
Set button text size.
size:
withCornerRadius (cornerRadius As Int) As ToastMessageShow
Specify radius for the corners of the backgrounds.

radius has no effect on BackGroundResources.
corner: radius
withDither (dither As Boolean) As ToastMessageShow
Set dither.

dither has no effect on BackGroundResources.
dither:
withDividerColor (color As Object) As ToastMessageShow
Sets the color of the space between the text and the buttons in this notification.
color:
withDividerHeight (height As Int) As ToastMessageShow
Set divider height.
height:
withDividerPadding (padding As Int) As ToastMessageShow
Set padding, in pixels, of the top and bottom edge.
padding:
withDividerToText (show As Boolean) As ToastMessageShow
Show or Hide the divider.
show:
withDividerToTitle (show As Boolean) As ToastMessageShow
Show or Hide the divider.
show:
withDuration (duration As Int) As ToastMessageShow
Set how long to show the view for.
duration:
withGradientCenter (centerX As Float, centerY As Float) As ToastMessageShow
Sets the center location of the gradient.
center: x
center: y
withGradientRadius (radius As Float) As ToastMessageShow
Specify radius for the corners of the gradient.
gradient: radius
withGradientType (type As Int) As ToastMessageShow
Set type of gradient used by this drawable.
type:
withGravity (gravity As Int) As ToastMessageShow
Placement of toast within the screen as per Gravity.
gravity:
withIconSize (width As Int, height As Int) As ToastMessageShow
Sets the size to the icon.
width,height:
withIconSize128x128 As ToastMessageShow
Sets the icon 128px x 128px.
withIconSize256x256 As ToastMessageShow
Sets the icon 256px x 256px.
withIconSize32x32 As ToastMessageShow
Sets the icon 32px x 32px.
withIconSize48x48 As ToastMessageShow
Sets the icon 48px x 48px.
withIconSize64x64 As ToastMessageShow
Sets the icon 64px x 64px.
withIconToText (bitmap As android.graphics.Bitmap, iconTextPosition As Int) As ToastMessageShow
Sets a bitmap to the toast with a specified position.
icon: bitmap
icon: position
withImageAlpha (alpha As Int) As ToastMessageShow
Set alpha.

ImageAlpha has no effect on BackGroundResources.
alpha:
withImageBitmap (bitmap As android.graphics.Bitmap, imagePosition As Int) As ToastMessageShow
Set image bitmap to the text ( position = left,top,right,bottom).
bitmap:
imagePosition:
withImageButton (bitmap As android.graphics.Bitmap, iconPosition As Int, bitmap2 As android.graphics.Bitmap, iconPosition2 As Int, bitmap3 As android.graphics.Bitmap, iconPosition3 As Int) As ToastMessageShow
Set image bitmap to the buttons ( position = left,top,right,bottom).
bitmap:
bitmap2:
bitmap3:
iconPosition:
iconPosition2:
iconPosition3:
withOrientation (orientation As android.graphics.drawable.GradientDrawable.Orientation) As ToastMessageShow
Changes the orientation of the gradient defined in this drawable.
orientation:
withOval (oval As Boolean) As ToastMessageShow
Create oval toast.
oval:
withPaddingLeftRight (padding As Int) As ToastMessageShow
Set padding, in pixels, of the left and right edge.
padding:
withPaddingTopBottom (padding As Int) As ToastMessageShow
Set padding, in pixels, of the top and bottom edge.
padding:
withStroke (strokeWidth As Int, strokeColor As Object) As ToastMessageShow
Set the stroke width and color for the backgrounds.

stroke has no effect on BackGroundResources.
stroke: width
stroke: color
withTextColor (color As Object) As ToastMessageShow
Set color to the text.

the color can be added as String or Int {@value 0xFFFFFF00 or Colors.Yellow or "#FFFFFF00"}.
color:
withTextGravity (gravity As Int) As ToastMessageShow
Specifies how to align the text by the view's x- and/or y-axis when the text is smaller than the view.
position:
withTextPadding (padding As Int) As ToastMessageShow
Set padding, in pixels, of the top and bottom edge.
padding:
withTextShadow (radius As Float, dx As Float, dy As Float, color As Object) As ToastMessageShow
Set shadow to the text.
radius:
dx:
dy:
color:
withTextSize (textSize As Int) As ToastMessageShow
Set size to the text.
size:
withTextStyle (textStyle As Int) As ToastMessageShow
Sets the style in which the text should be displayed.
style:
withTextTypeFace (typeFace As android.graphics.Typeface) As ToastMessageShow
Sets the type face and style in which the text should be displayed.

Note that not all Type face families actually have bold and italic variants,
so you may need to use TextStyle(style) to get the appearance that you actually want.
family:
withTitle (text As CharSequence) As ToastMessageShow
Create toast with title.
text:
withTitleColor (color As Object) As ToastMessageShow
Set color to the title.

the color can be added as String or Int {@value 0xFFFFFF00 or Colors.Yellow or "#FFFFFF00"}.
color:
withTitleGravity (gravity As Int) As ToastMessageShow
Specifies how to align the text by the view's x- and/or y-axis when the text is smaller than the view.
position:
withTitleShadow (radius As Float, dx As Float, dy As Float, color As Object) As ToastMessageShow
Set shadow to the title.
radius:
dx:
dy:
color:
withTitleSize (titleSize As Int) As ToastMessageShow
Set size to the title.
size:
withTitleStyle (titleStyle As Int) As ToastMessageShow
Sets the style in which the text should be displayed.
style:
withTitleTypeFace (typeFace As android.graphics.Typeface) As ToastMessageShow
Sets the type face and style in which the text should be displayed.

Note that not all Type face families actually have bold and italic variants,
so you may need to use TextStyle(style) to get the appearance that you actually want.
family:
withXOffset (xOffset As Int) As ToastMessageShow
Sets the axis X position for this toast.
xOffset:
withYOffset (yOffset As Int) As ToastMessageShow
Sets the axis Y position for this toast.
yOffset:
Top