Class DynamicHint
- java.lang.Object
-
- com.pranavpandey.android.dynamic.toasts.DynamicHint
-
public class DynamicHint extends java.lang.ObjectHelper class to display themed cheat sheets with icon and text by usingToast.If no color is supplied, it will display default hint based on the Android support library.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDynamicHint.ConfigConfiguration class to customise theDynamicHintattributes.
-
Constructor Summary
Constructors Constructor Description DynamicHint()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static android.widget.Toastmake(android.content.Context context, java.lang.CharSequence text)Make a standard toast that just contains a text view.static android.widget.Toastmake(android.content.Context context, java.lang.CharSequence text, int duration)Make a standard toast that just contains a text view.static android.widget.Toastmake(android.content.Context context, java.lang.CharSequence text, android.graphics.drawable.Drawable icon)Make a error toast with icon and the text.static android.widget.Toastmake(android.content.Context context, java.lang.CharSequence text, android.graphics.drawable.Drawable icon, int duration)Make a themed toast with icon and the text.static android.widget.Toastmake(android.content.Context context, java.lang.CharSequence text, android.graphics.drawable.Drawable icon, java.lang.Integer tintColor, java.lang.Integer backgroundColor)Make a themed toast with text, icon, background and the tint color.static android.widget.Toastmake(android.content.Context context, java.lang.CharSequence text, android.graphics.drawable.Drawable icon, java.lang.Integer tintColor, java.lang.Integer backgroundColor, int duration)Make a themed toast with text, icon, background and the tint color.static android.widget.Toastmake(android.content.Context context, java.lang.CharSequence text, java.lang.Integer tintColor, java.lang.Integer backgroundColor)Make a themed toast with icon and the text.static android.widget.Toastmake(android.content.Context context, java.lang.CharSequence text, java.lang.Integer tintColor, java.lang.Integer backgroundColor, int duration)Make a themed toast with text, background and the tint color.static android.widget.ToastmakeError(android.content.Context context, java.lang.CharSequence text)Make a error toast with icon and the text.static android.widget.ToastmakeError(android.content.Context context, java.lang.CharSequence text, int duration)Make a error toast with icon and the text.static android.widget.ToastmakeSuccess(android.content.Context context, java.lang.CharSequence text)Make a success toast with icon and the text.static android.widget.ToastmakeSuccess(android.content.Context context, java.lang.CharSequence text, int duration)Make a success toast with icon and the text.static android.widget.ToastmakeWarning(android.content.Context context, java.lang.CharSequence text)Make a warning toast with icon and the text.static android.widget.ToastmakeWarning(android.content.Context context, java.lang.CharSequence text, int duration)Make a warning toast with icon and the text.static voidshow(android.view.View anchor, android.widget.Toast toast)Show toast above or below according to the anchor view position.static voidshow(android.view.View anchor, android.widget.Toast toast, int offset)Show toast above or below according to the anchor view position.
-
-
-
Method Detail
-
make
@NonNull public static android.widget.Toast make(@NonNull android.content.Context context, @Nullable java.lang.CharSequence text)Make a standard toast that just contains a text view.The toast duration will be
Toast.LENGTH_SHORT.- Parameters:
context- The context to use.text- The text to show. Can be formatted text.- Returns:
- The toast with the supplied parameters.
Use
Toast.show()to display the toast.
-
make
@NonNull public static android.widget.Toast make(@NonNull android.content.Context context, @Nullable java.lang.CharSequence text, int duration)Make a standard toast that just contains a text view.- Parameters:
context- The context to use.text- The text to show. Can be formatted text.duration- The duration for the toast, eitherToast.LENGTH_SHORTorToast.LENGTH_LONG.- Returns:
- The toast with the supplied parameters.
Use
Toast.show()to display the toast.
-
makeError
@NonNull public static android.widget.Toast makeError(@NonNull android.content.Context context, @Nullable java.lang.CharSequence text)Make a error toast with icon and the text.The toast duration will be
Toast.LENGTH_SHORT.- Parameters:
context- The context to use.text- The text to show. Can be formatted text.- Returns:
- The toast with the supplied parameters.
Use
Toast.show()to display the toast.
-
makeError
@NonNull public static android.widget.Toast makeError(@NonNull android.content.Context context, @Nullable java.lang.CharSequence text, int duration)Make a error toast with icon and the text.- Parameters:
context- The context to use.text- The text to show. Can be formatted text.duration- The duration for the toast, eitherToast.LENGTH_SHORTorToast.LENGTH_LONG.- Returns:
- The toast with the supplied parameters.
Use
Toast.show()to display the toast.
-
makeSuccess
@NonNull public static android.widget.Toast makeSuccess(@NonNull android.content.Context context, @Nullable java.lang.CharSequence text)Make a success toast with icon and the text.The toast duration will be
Toast.LENGTH_SHORT.- Parameters:
context- The context to use.text- The text to show. Can be formatted text.- Returns:
- The toast with the supplied parameters.
Use
Toast.show()to display the toast.
-
makeSuccess
@NonNull public static android.widget.Toast makeSuccess(@NonNull android.content.Context context, @Nullable java.lang.CharSequence text, int duration)Make a success toast with icon and the text.- Parameters:
context- The context to use.text- The text to show. Can be formatted text.duration- The duration for the toast, eitherToast.LENGTH_SHORTorToast.LENGTH_LONG.- Returns:
- The toast with the supplied parameters.
Use
Toast.show()to display the toast.
-
makeWarning
@NonNull public static android.widget.Toast makeWarning(@NonNull android.content.Context context, @Nullable java.lang.CharSequence text)Make a warning toast with icon and the text.The toast duration will be
Toast.LENGTH_SHORT.- Parameters:
context- The context to use.text- The text to show. Can be formatted text.- Returns:
- The toast with the supplied parameters.
Use
Toast.show()to display the toast.
-
makeWarning
@NonNull public static android.widget.Toast makeWarning(@NonNull android.content.Context context, @Nullable java.lang.CharSequence text, int duration)Make a warning toast with icon and the text.- Parameters:
context- The context to use.text- The text to show. Can be formatted text.duration- The duration for the toast, eitherToast.LENGTH_SHORTorToast.LENGTH_LONG.- Returns:
- The toast with the supplied parameters.
Use
Toast.show()to display the toast.
-
make
@NonNull public static android.widget.Toast make(@NonNull android.content.Context context, @Nullable java.lang.CharSequence text, @Nullable android.graphics.drawable.Drawable icon)Make a error toast with icon and the text.The toast duration will be
Toast.LENGTH_SHORT.- Parameters:
context- The context to use.text- The text to show. Can be formatted text.icon- The toast icon to show.- Returns:
- The toast with the supplied parameters.
Use
Toast.show()to display the toast.
-
make
@NonNull public static android.widget.Toast make(@NonNull android.content.Context context, @Nullable java.lang.CharSequence text, @Nullable android.graphics.drawable.Drawable icon, int duration)Make a themed toast with icon and the text.- Parameters:
context- The context to use.text- The text to show. Can be formatted text.icon- The toast icon to show.duration- The duration for the toast, eitherToast.LENGTH_SHORTorToast.LENGTH_LONG.- Returns:
- The toast with the supplied parameters.
Use
Toast.show()to display the toast.
-
make
@NonNull public static android.widget.Toast make(@NonNull android.content.Context context, @Nullable java.lang.CharSequence text, @Nullable @ColorInt java.lang.Integer tintColor, @Nullable @ColorInt java.lang.Integer backgroundColor)Make a themed toast with icon and the text.The toast duration will be
Toast.LENGTH_SHORT.- Parameters:
context- The context to use.text- The text to show. Can be formatted text.tintColor- The toast tint color based on the toast background.It will automatically check for the contrast to provide best visibility.
backgroundColor- The toast background color.- Returns:
- The toast with the supplied parameters.
Use
Toast.show()to display the toast.
-
make
@NonNull public static android.widget.Toast make(@NonNull android.content.Context context, @Nullable java.lang.CharSequence text, @Nullable @ColorInt java.lang.Integer tintColor, @Nullable @ColorInt java.lang.Integer backgroundColor, int duration)Make a themed toast with text, background and the tint color.The toast duration will be
Toast.LENGTH_SHORT.- Parameters:
context- The context to use.text- The text to show. Can be formatted text.tintColor- The toast tint color based on the toast background.It will automatically check for the contrast to provide best visibility.
backgroundColor- The toast background color.duration- The duration for the toast, eitherToast.LENGTH_SHORTorToast.LENGTH_LONG.- Returns:
- The toast with the supplied parameters.
Use
Toast.show()to display the toast.
-
make
@NonNull public static android.widget.Toast make(@NonNull android.content.Context context, @Nullable java.lang.CharSequence text, @Nullable android.graphics.drawable.Drawable icon, @Nullable @ColorInt java.lang.Integer tintColor, @Nullable @ColorInt java.lang.Integer backgroundColor)Make a themed toast with text, icon, background and the tint color.The toast duration will be
Toast.LENGTH_SHORT.- Parameters:
context- The context to use.text- The text to show. Can be formatted text.icon- The toast icon to show.tintColor- The toast tint color based on the toast background.It will automatically check for the contrast to provide best visibility.
backgroundColor- The toast background color.- Returns:
- The toast with the supplied parameters.
Use
Toast.show()to display the toast.
-
make
@NonNull public static android.widget.Toast make(@NonNull android.content.Context context, @Nullable java.lang.CharSequence text, @Nullable android.graphics.drawable.Drawable icon, @Nullable @ColorInt java.lang.Integer tintColor, @Nullable @ColorInt java.lang.Integer backgroundColor, int duration)Make a themed toast with text, icon, background and the tint color.- Parameters:
context- The context to use.text- The text to show. Can be formatted text.icon- The toast icon to show.tintColor- The toast tint color based on the toast background.It will automatically check for the contrast to provide best visibility.
backgroundColor- The toast background color.duration- The duration for the toast, eitherToast.LENGTH_SHORTorToast.LENGTH_LONG.- Returns:
- The toast with the supplied parameters.
Use
Toast.show()to display the toast.
-
show
public static void show(@NonNull android.view.View anchor, @NonNull android.widget.Toast toast)Show toast above or below according to the anchor view position.- Parameters:
anchor- The anchor view to show the toast.toast- The toast to be displayed.
-
show
public static void show(@NonNull android.view.View anchor, @NonNull android.widget.Toast toast, int offset)Show toast above or below according to the anchor view position.- Parameters:
anchor- The anchor view to show the toast.toast- The toast to be displayed.offset- The toast vertical offset in dips.
-
-