Package com.iizix.gyro
Interface IToaster
- All Known Subinterfaces:
IAppSessionGyro
,IClientSessionGyro
- All Known Implementing Classes:
AppSessionGyro
,ClientSessionGyro
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
The toast API is available for both IClientSessionGyro (the device) and IAppSessionGyro (the session). It basically exposes one toast method that, when called with proper arguments, instantly displays a small, unobstructive and ephemeral message to the user.
- Author:
- Thomas Schreiber
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Definition of the direction for the show animation.static enum
Definition of the available position where to display the toast.static enum
Type of message style: message, warning, error of fatal.Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
Method Summary
Modifier and TypeMethodDescriptiondefault void
Displays a simple, unobstructive and ephemeral text message to the user.default void
toast
(KString message, IToaster.Position position, IToaster.Direction direction, IToaster.Type type) Displays a simple, unobstructive and ephemeral text message to the user.void
toast
(KString message, IToaster.Position position, IToaster.Direction direction, IToaster.Type type, int duration) Displays a simple, unobstructive and ephemeral text message to the user.default void
toast
(KString message, IToaster.Type type) Displays a simple, unobstructive and ephemeral text message to the user.default void
Displays a simple, unobstructive and ephemeral text message to the user.default void
toast
(String message, IToaster.Position position, IToaster.Direction direction, IToaster.Type type) Displays a simple, unobstructive and ephemeral text message to the user.default void
toast
(String message, IToaster.Position position, IToaster.Direction direction, IToaster.Type type, int duration) Displays a simple, unobstructive and ephemeral text message to the user.default void
toast
(String message, IToaster.Type type) Displays a simple, unobstructive and ephemeral text message to the user.
Field Details
TOASTER_DEFAULT_DURATION
static final int TOASTER_DEFAULT_DURATION- See Also:
TOASTER_MAX_DURATION
static final int TOASTER_MAX_DURATION- See Also:
TOASTER_MIN_DURATION
static final int TOASTER_MIN_DURATION- See Also:
Method Details
toast
Displays a simple, unobstructive and ephemeral text message to the user.The toast is displayed to at Position.BOTTOM_CENTER, with an animation Direction.UP and Type.MESSAGE.
- Parameters:
message
- The message to display.
toast
Displays a simple, unobstructive and ephemeral text message to the user.The toast is displayed to at Position.BOTTOM_CENTER, with an animation Direction.UP and Type.MESSAGE.
- Parameters:
message
- The message to display.
toast
Displays a simple, unobstructive and ephemeral text message to the user.The toast is displayed to at Position.BOTTOM_CENTER, with an animation Direction.UP.
- Parameters:
message
- The message to display.type
- Type of message style: MESSAGE, WARNING, ERROR or FATAL, default is MESSAGE if type is null.
toast
Displays a simple, unobstructive and ephemeral text message to the user.The toast is displayed to at Position.BOTTOM_CENTER, with an animation Direction.UP.
- Parameters:
message
- The message to display.type
- Type of message style: MESSAGE, WARNING, ERROR or FATAL, default is MESSAGE if type is null.
toast
default void toast(String message, IToaster.Position position, IToaster.Direction direction, IToaster.Type type) Displays a simple, unobstructive and ephemeral text message to the user.- Parameters:
message
- The message to display.position
- Position of toast, default value is Position.BOTTOM_CENTER if position is null.direction
- Direction of the toast animation, default Direction.UP if direction is null.type
- Type of message style: MESSAGE, WARNING, ERROR or FATAL, default is MESSAGE if type is null.
toast
default void toast(KString message, IToaster.Position position, IToaster.Direction direction, IToaster.Type type) Displays a simple, unobstructive and ephemeral text message to the user.- Parameters:
message
- The message to display.position
- Position of toast, default value is Position.BOTTOM_CENTER if position is null.direction
- Direction of the toast animation, default Direction.UP if direction is null.type
- Type of message style: MESSAGE, WARNING, ERROR or FATAL, default is MESSAGE if type is null.
toast
default void toast(String message, IToaster.Position position, IToaster.Direction direction, IToaster.Type type, int duration) Displays a simple, unobstructive and ephemeral text message to the user.- Parameters:
message
- The message to display.position
- Position of toast, default value is Position.BOTTOM_CENTER if position is null.direction
- Direction of the toast animation, default Direction.UP if direction is null.type
- Type of message style: MESSAGE, WARNING, ERROR or FATAL, default is MESSAGE if type is null.duration
- Duration of the toast message being shown in ms. Valid values are in the interval [0, 10000], 0 for a sticky toast.
toast
void toast(KString message, IToaster.Position position, IToaster.Direction direction, IToaster.Type type, int duration) Displays a simple, unobstructive and ephemeral text message to the user.- Parameters:
message
- The message to display.position
- Position of toast, default value is Position.BOTTOM_CENTER if position is null.direction
- Direction of the toast animation, default Direction.UP if direction is null.type
- Type of message style: MESSAGE, WARNING, ERROR or FATAL, default is MESSAGE if type is null.duration
- Duration of the toast message being shown in ms. Valid values are in the interval [0, 10000], 0 for a sticky toast.