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 TypeMethodDescriptionbooleanonHover(View v, MotionEvent event) booleanonLongClick(View v) voidvoidstatic voidset(View view, int backgroundColor, int tintColor, Drawable icon, CharSequence text) Set the tooltip for the view.static voidset(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, waitMethods 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:
onLongClickin interfaceView.OnLongClickListener
-
onHover
- Specified by:
onHoverin interfaceView.OnHoverListener
-
onViewAttachedToWindow
- Specified by:
onViewAttachedToWindowin interfaceView.OnAttachStateChangeListener
-
onViewDetachedFromWindow
- Specified by:
onViewDetachedFromWindowin interfaceView.OnAttachStateChangeListener
-