Class DynamicTooltip
java.lang.Object
com.pranavpandey.android.dynamic.support.widget.tooltip.DynamicTooltip
- All Implemented Interfaces:
View.OnAttachStateChangeListener
,View.OnHoverListener
,View.OnLongClickListener
@RestrictTo(LIBRARY_GROUP_PREFIX)
public class DynamicTooltip
extends Object
implements View.OnLongClickListener, View.OnHoverListener, View.OnAttachStateChangeListener
Event handler used to emulate the behavior of
View.setTooltipText(CharSequence)
with icon and custom colors.-
Method Summary
Modifier and TypeMethodDescriptionboolean
onHover
(View v, MotionEvent event) boolean
onLongClick
(View v) void
void
static void
set
(View view, int backgroundColor, int tintColor, Drawable icon, CharSequence text) Set the tooltip for the view.static void
set
(View view, int backgroundColor, int tintColor, CharSequence text) Set the tooltip for the view.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface android.view.View.OnLongClickListener
onLongClickUseDefaultHapticFeedback
-
Method Details
-
set
public static void set(@Nullable View view, @ColorInt int backgroundColor, @ColorInt int tintColor, @Nullable Drawable icon, @Nullable CharSequence text) Set the tooltip for the view.- Parameters:
view
- The view to set the tooltip on.backgroundColor
- The background color for the tooltip.tintColor
- The tint color for the tooltip.icon
- The icon drawable for the tooltip.text
- The text for the tooltip.
-
set
public static void set(@Nullable View view, @ColorInt int backgroundColor, @ColorInt int tintColor, @Nullable CharSequence text) Set the tooltip for the view.- Parameters:
view
- The view to set the tooltip on.backgroundColor
- The background color for the tooltip.tintColor
- The tint color for the tooltip.text
- The text for the tooltip.
-
onLongClick
- Specified by:
onLongClick
in interfaceView.OnLongClickListener
-
onHover
- Specified by:
onHover
in interfaceView.OnHoverListener
-
onViewAttachedToWindow
- Specified by:
onViewAttachedToWindow
in interfaceView.OnAttachStateChangeListener
-
onViewDetachedFromWindow
- Specified by:
onViewDetachedFromWindow
in interfaceView.OnAttachStateChangeListener
-