Balloon

class Balloon(context: Context, builder: Balloon.Builder) : LifecycleObserver

Balloon implements a customizable tooltips popup with and arrow and animations.

See also

com.skydoves.balloon.Balloon

(https://github.com/skydoves/balloon)

Parameters

context

A context for creating and accessing internal resources.

builder

A Balloon.Builder for creating an instance of the Balloon.

Constructors

Balloon
Link copied to clipboard
fun Balloon(context: Context, builder: Balloon.Builder)
A context for creating and accessing internal resources.

Types

Builder
Link copied to clipboard
class Builder(context: Context)
Builder class for creating Balloon.
Factory
Link copied to clipboard
abstract class Factory
An abstract factory class for creating Balloon instance.

Functions

clearAllPreferences
Link copied to clipboard
fun clearAllPreferences()
clears all persisted preferences.
dismiss
Link copied to clipboard
fun dismiss()
dismiss the popup menu.
dismissWithDelay
Link copied to clipboard
fun dismissWithDelay(delay: Long): Boolean
dismiss the popup menu with milliseconds delay.
getBalloonArrowView
Link copied to clipboard
fun getBalloonArrowView(): View
gets a arrow view of the balloon popup window.
getContentView
Link copied to clipboard
fun getContentView(): ViewGroup
gets a content view of the balloon popup window.
getMeasuredHeight
Link copied to clipboard
fun getMeasuredHeight(): Int
gets measured height size of the balloon popup.
getMeasuredWidth
Link copied to clipboard
fun getMeasuredWidth(): Int
gets measured width size of the balloon popup.
onDestroy
Link copied to clipboard
fun onDestroy()
dismiss automatically when lifecycle owner is destroyed.
onPause
Link copied to clipboard
fun onPause()
dismiss when the LifecycleOwner be on paused.
relayShow
Link copied to clipboard
fun relayShow(balloon: Balloon, anchor: View, xOff: Int = 0, yOff: Int = 0): Balloon
Shows the balloon on the center of an anchor view and shows the next balloon sequentially.
relayShowAlignBottom
Link copied to clipboard
fun relayShowAlignBottom(balloon: Balloon, anchor: View, xOff: Int = 0, yOff: Int = 0): Balloon
Shows the balloon on an anchor view as the bottom alignment with x-off and y-off and shows the next balloon sequentially.
relayShowAlignLeft
Link copied to clipboard
fun relayShowAlignLeft(balloon: Balloon, anchor: View, xOff: Int = 0, yOff: Int = 0): Balloon
Shows the balloon on an anchor view as the left alignment with x-off and y-off and shows the next balloon sequentially.
relayShowAlignRight
Link copied to clipboard
fun relayShowAlignRight(balloon: Balloon, anchor: View, xOff: Int = 0, yOff: Int = 0): Balloon
Shows the balloon on an anchor view as the right alignment with x-off and y-off and shows the next balloon sequentially.
relayShowAlignTop
Link copied to clipboard
fun relayShowAlignTop(balloon: Balloon, anchor: View, xOff: Int = 0, yOff: Int = 0): Balloon
Shows the balloon on an anchor view as the top alignment with x-off and y-off and shows the next balloon sequentially.
relayShowAsDropDown
Link copied to clipboard
fun relayShowAsDropDown(balloon: Balloon, anchor: View, xOff: Int = 0, yOff: Int = 0): Balloon
Shows the balloon on an anchor view as drop down with x-off and y-off and shows the next balloon sequentially.
relayShowAtCenter
Link copied to clipboard
fun relayShowAtCenter(balloon: Balloon, anchor: View, xOff: Int = 0, yOff: Int = 0, centerAlign: BalloonCenterAlign = BalloonCenterAlign.TOP): Balloon
Shows the balloon on an anchor view as the center alignment with x-off and y-off and shows the next balloon sequentially.
setIsAttachedInDecor
Link copied to clipboard
fun setIsAttachedInDecor(value: Boolean): Balloon
sets whether the popup window will be attached in the decor frame of its parent window.
setOnBalloonClickListener
Link copied to clipboard
fun setOnBalloonClickListener(onBalloonClickListener: OnBalloonClickListener?)
sets a OnBalloonClickListener to the popup.
fun setOnBalloonClickListener(block: (View) -> Unit)
sets a OnBalloonClickListener to the popup using lambda.
setOnBalloonDismissListener
Link copied to clipboard
fun setOnBalloonDismissListener(onBalloonDismissListener: OnBalloonDismissListener?)
sets a OnBalloonDismissListener to the popup.
fun setOnBalloonDismissListener(block: () -> Unit)
sets a OnBalloonDismissListener to the popup using lambda.
setOnBalloonInitializedListener
Link copied to clipboard
fun setOnBalloonInitializedListener(onBalloonInitializedListener: OnBalloonInitializedListener?)
sets a OnBalloonInitializedListener to the popup.
fun setOnBalloonInitializedListener(block: (View) -> Unit)
sets a OnBalloonInitializedListener to the popup using a lambda.
setOnBalloonOutsideTouchListener
Link copied to clipboard
fun setOnBalloonOutsideTouchListener(onBalloonOutsideTouchListener: OnBalloonOutsideTouchListener?)
sets a OnBalloonOutsideTouchListener to the popup.
fun setOnBalloonOutsideTouchListener(block: (View, MotionEvent) -> Unit)
sets a OnBalloonOutsideTouchListener to the popup using lambda.
setOnBalloonOverlayClickListener
Link copied to clipboard
fun setOnBalloonOverlayClickListener(onBalloonOverlayClickListener: OnBalloonOverlayClickListener?)
sets a OnBalloonOverlayClickListener to the overlay popup.
fun setOnBalloonOverlayClickListener(block: () -> Unit)
sets a OnBalloonOverlayClickListener to the overlay popup using lambda.
setOnBalloonOverlayTouchListener
Link copied to clipboard
fun setOnBalloonOverlayTouchListener(onTouchListener: View.OnTouchListener?)
sets a View.OnTouchListener to the overlay popup
fun setOnBalloonOverlayTouchListener(block: (View, MotionEvent) -> Boolean)
sets a View.OnTouchListener to the overlay popup using lambda.
setOnBalloonTouchListener
Link copied to clipboard
fun setOnBalloonTouchListener(onTouchListener: View.OnTouchListener?)
sets a View.OnTouchListener to the popup.
shouldShowUp
Link copied to clipboard
fun shouldShowUp(): Boolean
Checks if the balloon should show up.
show
Link copied to clipboard
fun show(anchor: View)
Shows the balloon on the center of an anchor view.
fun show(anchor: View, xOff: Int, yOff: Int)
Shows the balloon on the center of an anchor view.
showAlignBottom
Link copied to clipboard
fun showAlignBottom(anchor: View, xOff: Int = 0, yOff: Int = 0)
Shows the balloon on an anchor view as the bottom alignment with x-off and y-off.
showAlignLeft
Link copied to clipboard
fun showAlignLeft(anchor: View, xOff: Int = 0, yOff: Int = 0)
Shows the balloon on an anchor view as the left alignment with x-off and y-off.
showAlignRight
Link copied to clipboard
fun showAlignRight(anchor: View, xOff: Int = 0, yOff: Int = 0)
Shows the balloon on an anchor view as the right alignment with x-off and y-off.
showAlignTop
Link copied to clipboard
fun showAlignTop(anchor: View, xOff: Int = 0, yOff: Int = 0)
Shows the balloon on an anchor view as the top alignment with x-off and y-off.
showAsDropDown
Link copied to clipboard
fun showAsDropDown(anchor: View, xOff: Int = 0, yOff: Int = 0)
Shows the balloon on an anchor view as drop down with x-off and y-off.
showAtCenter
Link copied to clipboard
fun showAtCenter(anchor: View, xOff: Int = 0, yOff: Int = 0, centerAlign: BalloonCenterAlign = BalloonCenterAlign.TOP)
Shows the balloon over the anchor view (overlap) as the center aligns.
update
Link copied to clipboard
fun update(anchor: View, xOff: Int = 0, yOff: Int = 0)
updates popup and arrow position of the popup based on a new target anchor view with additional x-off and y-off.

Properties

bodyWindow
Link copied to clipboard
val bodyWindow: PopupWindow
A main content window of the popup.
isShowing
Link copied to clipboard
var isShowing: Boolean = false
Denotes the popup is showing or not.
onBalloonInitializedListener
Link copied to clipboard
Interface definition for a callback to be invoked when a balloon view is initialized.
overlayWindow
Link copied to clipboard
val overlayWindow: PopupWindow
An overlay window of the background popup.