DeweyTooltip

class DeweyTooltip(mContext: Context)

The Dewey Tooltip widget.

Example:

DeweyTooltip
.make(this, anchorView)
.setText("Some text to show in the tooltip", true)
.setCallback(...)
.setPreferredSideOfAnchor(DeweyTooltip.SideOfAnchor.BOTTOM)
.setDuration(3000)
.show()
*

Constructors

Link copied to clipboard
constructor(mContext: Context)

Types

Link copied to clipboard
annotation class ArrowGravity
Link copied to clipboard
interface Callback
Link copied to clipboard
object Companion
Link copied to clipboard
@IntRange(from = 1)
annotation class Duration
Link copied to clipboard
fun interface OnClickListener
Link copied to clipboard
annotation class SideOfAnchor

Functions

Link copied to clipboard
fun dismiss()
Link copied to clipboard
Link copied to clipboard

Set the margin distance between the tooltip and the anchor. 8dp by default.

Link copied to clipboard
fun setAnchorPaddingDp(anchorPaddingDp: Int): DeweyTooltip

Set the margin distance between the tooltip and the anchor in dp

Link copied to clipboard
fun setAnchorView(anchorView: View): DeweyTooltip

Set the view to which the tooltip will attach to. If you change the anchor view after the tooltip is shown, you need to call show again.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Set tooltip body click listener. This is optional, if not set, clicking will dismiss the tooltip.

Link copied to clipboard
fun setDuration(duration: Int): DeweyTooltip
Link copied to clipboard
fun setMargin(@Px margin: Int): DeweyTooltip
Link copied to clipboard
Link copied to clipboard

Set the primary button text and click listener

Link copied to clipboard

Set the secondary button text and click listener

Link copied to clipboard

Set the body text of this tooltip.

Link copied to clipboard
fun show()

Show the tooltip with the text passed in via setText. If LENGTH_INDEFINITE is passed as the duration, it will not dismiss automatically.

fun show(animated: Boolean)

Show the tooltip with or without animation