-
- All Implemented Interfaces:
-
androidx.lifecycle.DefaultLifecycleObserver,androidx.lifecycle.FullLifecycleObserver,androidx.lifecycle.LifecycleObserver
public final class Balloon implements DefaultLifecycleObserver
Balloon implements a customizable tooltips popup with and arrow and animations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classBalloon.BuilderBuilder class for creating Balloon.
public abstract classBalloon.FactoryAn abstract factory class for creating Balloon instance. A factory implementation class must have a default (non-argument) constructor. This class is used to initialize an instance of the Balloon lazily in Activities and Fragments.
-
Field Summary
Fields Modifier and Type Field Description private final PopupWindowbodyWindowprivate final PopupWindowoverlayWindowprivate final BooleanisShowingpublic OnBalloonInitializedListeneronBalloonInitializedListener
-
Method Summary
Modifier and Type Method Description final PopupWindowgetBodyWindow()A main content window of the popup. final PopupWindowgetOverlayWindow()An overlay window of the background popup. final BooleanisShowing()Denotes the popup is showing or not. final BooleanshouldShowUp()Checks if the balloon should show up. final UnitshowAtCenter(View anchor, Integer xOff, Integer yOff, BalloonCenterAlign centerAlign)Shows the balloon over the anchor view (overlap) as the center aligns. final UnitshowAtCenter(View anchor, Integer xOff, Integer yOff)Shows the balloon over the anchor view (overlap) as the center aligns. final UnitshowAtCenter(View anchor, Integer xOff)Shows the balloon over the anchor view (overlap) as the center aligns. final UnitshowAtCenter(View anchor)Shows the balloon over the anchor view (overlap) as the center aligns. final BalloonrelayShowAtCenter(Balloon balloon, View anchor, Integer xOff, Integer yOff, BalloonCenterAlign centerAlign)Shows the balloon on an anchor view as the center alignment with x-off and y-off and shows the next balloon sequentially. final BalloonrelayShowAtCenter(Balloon balloon, View anchor, Integer xOff, Integer yOff)Shows the balloon on an anchor view as the center alignment with x-off and y-off and shows the next balloon sequentially. final BalloonrelayShowAtCenter(Balloon balloon, View anchor, Integer xOff)Shows the balloon on an anchor view as the center alignment with x-off and y-off and shows the next balloon sequentially. final BalloonrelayShowAtCenter(Balloon balloon, View anchor)Shows the balloon on an anchor view as the center alignment with x-off and y-off and shows the next balloon sequentially. final UnitshowAsDropDown(View anchor, Integer xOff, Integer yOff)Shows the balloon on an anchor view as drop down with x-off and y-off. final UnitshowAsDropDown(View anchor, Integer xOff)Shows the balloon on an anchor view as drop down with x-off and y-off. final UnitshowAsDropDown(View anchor)Shows the balloon on an anchor view as drop down with x-off and y-off. final BalloonrelayShowAsDropDown(Balloon balloon, View anchor, Integer xOff, Integer yOff)Shows the balloon on an anchor view as drop down with x-off and y-off and shows the next balloon sequentially. final BalloonrelayShowAsDropDown(Balloon balloon, View anchor, Integer xOff)Shows the balloon on an anchor view as drop down with x-off and y-off and shows the next balloon sequentially. final BalloonrelayShowAsDropDown(Balloon balloon, View anchor)Shows the balloon on an anchor view as drop down with x-off and y-off and shows the next balloon sequentially. final UnitshowAlignTop(View anchor, Integer xOff, Integer yOff)Shows the balloon on an anchor view as the top alignment with x-off and y-off. final UnitshowAlignTop(View anchor, Integer xOff)Shows the balloon on an anchor view as the top alignment with x-off and y-off. final UnitshowAlignTop(View anchor)Shows the balloon on an anchor view as the top alignment with x-off and y-off. final BalloonrelayShowAlignTop(Balloon balloon, View anchor, Integer xOff, Integer yOff)Shows the balloon on an anchor view as the top alignment with x-off and y-off and shows the next balloon sequentially. final BalloonrelayShowAlignTop(Balloon balloon, View anchor, Integer xOff)Shows the balloon on an anchor view as the top alignment with x-off and y-off and shows the next balloon sequentially. final BalloonrelayShowAlignTop(Balloon balloon, View anchor)Shows the balloon on an anchor view as the top alignment with x-off and y-off and shows the next balloon sequentially. final UnitshowAlignBottom(View anchor, Integer xOff, Integer yOff)Shows the balloon on an anchor view as the bottom alignment with x-off and y-off. final UnitshowAlignBottom(View anchor, Integer xOff)Shows the balloon on an anchor view as the bottom alignment with x-off and y-off. final UnitshowAlignBottom(View anchor)Shows the balloon on an anchor view as the bottom alignment with x-off and y-off. final BalloonrelayShowAlignBottom(Balloon balloon, View anchor, Integer xOff, Integer yOff)Shows the balloon on an anchor view as the bottom alignment with x-off and y-off and shows the next balloon sequentially. final BalloonrelayShowAlignBottom(Balloon balloon, View anchor, Integer xOff)Shows the balloon on an anchor view as the bottom alignment with x-off and y-off and shows the next balloon sequentially. final BalloonrelayShowAlignBottom(Balloon balloon, View anchor)Shows the balloon on an anchor view as the bottom alignment with x-off and y-off and shows the next balloon sequentially. final UnitshowAlignRight(View anchor, Integer xOff, Integer yOff)Shows the balloon on an anchor view as the right alignment with x-off and y-off. final UnitshowAlignRight(View anchor, Integer xOff)Shows the balloon on an anchor view as the right alignment with x-off and y-off. final UnitshowAlignRight(View anchor)Shows the balloon on an anchor view as the right alignment with x-off and y-off. final BalloonrelayShowAlignRight(Balloon balloon, View anchor, Integer xOff, Integer yOff)Shows the balloon on an anchor view as the right alignment with x-off and y-off and shows the next balloon sequentially. final BalloonrelayShowAlignRight(Balloon balloon, View anchor, Integer xOff)Shows the balloon on an anchor view as the right alignment with x-off and y-off and shows the next balloon sequentially. final BalloonrelayShowAlignRight(Balloon balloon, View anchor)Shows the balloon on an anchor view as the right alignment with x-off and y-off and shows the next balloon sequentially. final UnitshowAlignLeft(View anchor, Integer xOff, Integer yOff)Shows the balloon on an anchor view as the left alignment with x-off and y-off. final UnitshowAlignLeft(View anchor, Integer xOff)Shows the balloon on an anchor view as the left alignment with x-off and y-off. final UnitshowAlignLeft(View anchor)Shows the balloon on an anchor view as the left alignment with x-off and y-off. final BalloonrelayShowAlignLeft(Balloon balloon, View anchor, Integer xOff, Integer yOff)Shows the balloon on an anchor view as the left alignment with x-off and y-off and shows the next balloon sequentially. final BalloonrelayShowAlignLeft(Balloon balloon, View anchor, Integer xOff)Shows the balloon on an anchor view as the left alignment with x-off and y-off and shows the next balloon sequentially. final BalloonrelayShowAlignLeft(Balloon balloon, View anchor)Shows the balloon on an anchor view as the left alignment with x-off and y-off and shows the next balloon sequentially. final UnitshowAlign(BalloonAlign align, View mainAnchor, List<View> subAnchorList, Integer xOff, Integer yOff)Shows the balloon on an anchor view depending on the align alignment with x-off and y-off. final UnitshowAlign(BalloonAlign align, View mainAnchor, List<View> subAnchorList, Integer xOff)Shows the balloon on an anchor view depending on the align alignment with x-off and y-off. final UnitshowAlign(BalloonAlign align, View mainAnchor, List<View> subAnchorList)Shows the balloon on an anchor view depending on the align alignment with x-off and y-off. final UnitshowAlign(BalloonAlign align, View mainAnchor)Shows the balloon on an anchor view depending on the align alignment with x-off and y-off. final BalloonrelayShowAlign(BalloonAlign align, Balloon balloon, View anchor, Integer xOff, Integer yOff)Shows the balloon on an anchor view depending on the align alignment with x-off and y-off and shows the next balloon sequentially. final BalloonrelayShowAlign(BalloonAlign align, Balloon balloon, View anchor, Integer xOff)Shows the balloon on an anchor view depending on the align alignment with x-off and y-off and shows the next balloon sequentially. final BalloonrelayShowAlign(BalloonAlign align, Balloon balloon, View anchor)Shows the balloon on an anchor view depending on the align alignment with x-off and y-off and shows the next balloon sequentially. final Unitupdate(View anchor, Integer xOff, Integer yOff)updates popup and arrow position of the popup based on a new target anchor view with additional x-off and y-off. final Unitupdate(View anchor, Integer xOff)updates popup and arrow position of the popup based on a new target anchor view with additional x-off and y-off. final Unitupdate(View anchor)updates popup and arrow position of the popup based on a new target anchor view with additional x-off and y-off. final Unitdismiss()dismiss the popup menu. final UnitupdateSizeOfBalloonCard(Integer width, Integer height)final BooleandismissWithDelay(Long delay)dismiss the popup menu with milliseconds delay. final UnitsetOnBalloonClickListener(OnBalloonClickListener onBalloonClickListener)sets a OnBalloonClickListener to the popup. final UnitclearAllPreferences()clears all persisted preferences. final UnitsetOnBalloonInitializedListener(OnBalloonInitializedListener onBalloonInitializedListener)sets a OnBalloonInitializedListener to the popup. final UnitsetOnBalloonDismissListener(OnBalloonDismissListener onBalloonDismissListener)sets a OnBalloonDismissListener to the popup. final UnitsetOnBalloonOutsideTouchListener(OnBalloonOutsideTouchListener onBalloonOutsideTouchListener)sets a OnBalloonOutsideTouchListener to the popup. final UnitsetOnBalloonTouchListener(View.OnTouchListener onTouchListener)sets a View.OnTouchListener to the popup. final UnitsetOnBalloonOverlayTouchListener(View.OnTouchListener onTouchListener)sets a View.OnTouchListener to the overlay popup final UnitsetOnBalloonOverlayTouchListener(Function2<View, MotionEvent, Boolean> block)sets a View.OnTouchListener to the overlay popup using lambda. final UnitsetOnBalloonOverlayClickListener(OnBalloonOverlayClickListener onBalloonOverlayClickListener)sets a OnBalloonOverlayClickListener to the overlay popup. final BalloonsetIsAttachedInDecor(Boolean value)sets whether the popup window will be attached in the decor frame of its parent window. final IntegergetMeasuredWidth()gets measured width size of the balloon popup. final IntegergetMeasuredHeight()gets measured height size of the balloon popup. final ViewGroupgetContentView()gets a content view of the balloon popup window. final ViewgetBalloonArrowView()gets a arrow view of the balloon popup window. UnitonPause(LifecycleOwner owner)dismiss when the LifecycleOwner be on paused. UnitonDestroy(LifecycleOwner owner)dismiss automatically when lifecycle owner is destroyed. -
-
Method Detail
-
getBodyWindow
final PopupWindow getBodyWindow()
A main content window of the popup.
-
getOverlayWindow
final PopupWindow getOverlayWindow()
An overlay window of the background popup.
-
shouldShowUp
final Boolean shouldShowUp()
Checks if the balloon should show up.
-
showAtCenter
final Unit showAtCenter(View anchor, Integer xOff, Integer yOff, BalloonCenterAlign centerAlign)
Shows the balloon over the anchor view (overlap) as the center aligns. Even if you use with the ArrowOrientationRules.ALIGN_ANCHOR, the alignment will not be guaranteed. So if you use the function, use with ArrowOrientationRules.ALIGN_FIXED and fixed ArrowOrientation.
- Parameters:
anchor- A target view which popup will be shown with overlap.xOff- A horizontal offset from the anchor in pixels.yOff- A vertical offset from the anchor in pixels.centerAlign- A rule for deciding the alignment of the balloon.
-
showAtCenter
final Unit showAtCenter(View anchor, Integer xOff, Integer yOff)
Shows the balloon over the anchor view (overlap) as the center aligns. Even if you use with the ArrowOrientationRules.ALIGN_ANCHOR, the alignment will not be guaranteed. So if you use the function, use with ArrowOrientationRules.ALIGN_FIXED and fixed ArrowOrientation.
- Parameters:
anchor- A target view which popup will be shown with overlap.xOff- A horizontal offset from the anchor in pixels.yOff- A vertical offset from the anchor in pixels.
-
showAtCenter
final Unit showAtCenter(View anchor, Integer xOff)
Shows the balloon over the anchor view (overlap) as the center aligns. Even if you use with the ArrowOrientationRules.ALIGN_ANCHOR, the alignment will not be guaranteed. So if you use the function, use with ArrowOrientationRules.ALIGN_FIXED and fixed ArrowOrientation.
- Parameters:
anchor- A target view which popup will be shown with overlap.xOff- A horizontal offset from the anchor in pixels.
-
showAtCenter
final Unit showAtCenter(View anchor)
Shows the balloon over the anchor view (overlap) as the center aligns. Even if you use with the ArrowOrientationRules.ALIGN_ANCHOR, the alignment will not be guaranteed. So if you use the function, use with ArrowOrientationRules.ALIGN_FIXED and fixed ArrowOrientation.
- Parameters:
anchor- A target view which popup will be shown with overlap.
-
relayShowAtCenter
final Balloon relayShowAtCenter(Balloon balloon, View anchor, Integer xOff, Integer yOff, BalloonCenterAlign centerAlign)
Shows the balloon on an anchor view as the center alignment with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.yOff- A vertical offset from the anchor in pixels.centerAlign- A rule for deciding the align of the balloon.
-
relayShowAtCenter
final Balloon relayShowAtCenter(Balloon balloon, View anchor, Integer xOff, Integer yOff)
Shows the balloon on an anchor view as the center alignment with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.yOff- A vertical offset from the anchor in pixels.
-
relayShowAtCenter
final Balloon relayShowAtCenter(Balloon balloon, View anchor, Integer xOff)
Shows the balloon on an anchor view as the center alignment with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.
-
relayShowAtCenter
final Balloon relayShowAtCenter(Balloon balloon, View anchor)
Shows the balloon on an anchor view as the center alignment with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.
-
showAsDropDown
final Unit showAsDropDown(View anchor, Integer xOff, Integer yOff)
Shows the balloon on an anchor view as drop down with x-off and y-off.
- Parameters:
anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.yOff- A vertical offset from the anchor in pixels.
-
showAsDropDown
final Unit showAsDropDown(View anchor, Integer xOff)
Shows the balloon on an anchor view as drop down with x-off and y-off.
- Parameters:
anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.
-
showAsDropDown
final Unit showAsDropDown(View anchor)
Shows the balloon on an anchor view as drop down with x-off and y-off.
- Parameters:
anchor- A target view which popup will be shown to.
-
relayShowAsDropDown
final Balloon relayShowAsDropDown(Balloon balloon, View anchor, Integer xOff, Integer yOff)
Shows the balloon on an anchor view as drop down with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.yOff- A vertical offset from the anchor in pixels.
-
relayShowAsDropDown
final Balloon relayShowAsDropDown(Balloon balloon, View anchor, Integer xOff)
Shows the balloon on an anchor view as drop down with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.
-
relayShowAsDropDown
final Balloon relayShowAsDropDown(Balloon balloon, View anchor)
Shows the balloon on an anchor view as drop down with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.
-
showAlignTop
final Unit showAlignTop(View anchor, Integer xOff, Integer yOff)
Shows the balloon on an anchor view as the top alignment with x-off and y-off.
- Parameters:
anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.yOff- A vertical offset from the anchor in pixels.
-
showAlignTop
final Unit showAlignTop(View anchor, Integer xOff)
Shows the balloon on an anchor view as the top alignment with x-off and y-off.
- Parameters:
anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.
-
showAlignTop
final Unit showAlignTop(View anchor)
Shows the balloon on an anchor view as the top alignment with x-off and y-off.
- Parameters:
anchor- A target view which popup will be shown to.
-
relayShowAlignTop
final Balloon relayShowAlignTop(Balloon balloon, View anchor, Integer xOff, Integer yOff)
Shows the balloon on an anchor view as the top alignment with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.yOff- A vertical offset from the anchor in pixels.
-
relayShowAlignTop
final Balloon relayShowAlignTop(Balloon balloon, View anchor, Integer xOff)
Shows the balloon on an anchor view as the top alignment with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.
-
relayShowAlignTop
final Balloon relayShowAlignTop(Balloon balloon, View anchor)
Shows the balloon on an anchor view as the top alignment with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.
-
showAlignBottom
final Unit showAlignBottom(View anchor, Integer xOff, Integer yOff)
Shows the balloon on an anchor view as the bottom alignment with x-off and y-off.
- Parameters:
anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.yOff- A vertical offset from the anchor in pixels.
-
showAlignBottom
final Unit showAlignBottom(View anchor, Integer xOff)
Shows the balloon on an anchor view as the bottom alignment with x-off and y-off.
- Parameters:
anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.
-
showAlignBottom
final Unit showAlignBottom(View anchor)
Shows the balloon on an anchor view as the bottom alignment with x-off and y-off.
- Parameters:
anchor- A target view which popup will be shown to.
-
relayShowAlignBottom
final Balloon relayShowAlignBottom(Balloon balloon, View anchor, Integer xOff, Integer yOff)
Shows the balloon on an anchor view as the bottom alignment with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.yOff- A vertical offset from the anchor in pixels.
-
relayShowAlignBottom
final Balloon relayShowAlignBottom(Balloon balloon, View anchor, Integer xOff)
Shows the balloon on an anchor view as the bottom alignment with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.
-
relayShowAlignBottom
final Balloon relayShowAlignBottom(Balloon balloon, View anchor)
Shows the balloon on an anchor view as the bottom alignment with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.
-
showAlignRight
final Unit showAlignRight(View anchor, Integer xOff, Integer yOff)
Shows the balloon on an anchor view as the right alignment with x-off and y-off.
- Parameters:
anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.yOff- A vertical offset from the anchor in pixels.
-
showAlignRight
final Unit showAlignRight(View anchor, Integer xOff)
Shows the balloon on an anchor view as the right alignment with x-off and y-off.
- Parameters:
anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.
-
showAlignRight
final Unit showAlignRight(View anchor)
Shows the balloon on an anchor view as the right alignment with x-off and y-off.
- Parameters:
anchor- A target view which popup will be shown to.
-
relayShowAlignRight
final Balloon relayShowAlignRight(Balloon balloon, View anchor, Integer xOff, Integer yOff)
Shows the balloon on an anchor view as the right alignment with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.yOff- A vertical offset from the anchor in pixels.
-
relayShowAlignRight
final Balloon relayShowAlignRight(Balloon balloon, View anchor, Integer xOff)
Shows the balloon on an anchor view as the right alignment with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.
-
relayShowAlignRight
final Balloon relayShowAlignRight(Balloon balloon, View anchor)
Shows the balloon on an anchor view as the right alignment with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.
-
showAlignLeft
final Unit showAlignLeft(View anchor, Integer xOff, Integer yOff)
Shows the balloon on an anchor view as the left alignment with x-off and y-off.
- Parameters:
anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.yOff- A vertical offset from the anchor in pixels.
-
showAlignLeft
final Unit showAlignLeft(View anchor, Integer xOff)
Shows the balloon on an anchor view as the left alignment with x-off and y-off.
- Parameters:
anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.
-
showAlignLeft
final Unit showAlignLeft(View anchor)
Shows the balloon on an anchor view as the left alignment with x-off and y-off.
- Parameters:
anchor- A target view which popup will be shown to.
-
relayShowAlignLeft
final Balloon relayShowAlignLeft(Balloon balloon, View anchor, Integer xOff, Integer yOff)
Shows the balloon on an anchor view as the left alignment with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.yOff- A vertical offset from the anchor in pixels.
-
relayShowAlignLeft
final Balloon relayShowAlignLeft(Balloon balloon, View anchor, Integer xOff)
Shows the balloon on an anchor view as the left alignment with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.
-
relayShowAlignLeft
final Balloon relayShowAlignLeft(Balloon balloon, View anchor)
Shows the balloon on an anchor view as the left alignment with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.
-
showAlign
final Unit showAlign(BalloonAlign align, View mainAnchor, List<View> subAnchorList, Integer xOff, Integer yOff)
Shows the balloon on an anchor view depending on the align alignment with x-off and y-off.
- Parameters:
align- Decides where the balloon should be placed.mainAnchor- A target view which popup will be displayed.subAnchorList- A list of anchors to display focuses on the overlay view.xOff- A horizontal offset from the anchor in pixels.yOff- A vertical offset from the anchor in pixels.
-
showAlign
final Unit showAlign(BalloonAlign align, View mainAnchor, List<View> subAnchorList, Integer xOff)
Shows the balloon on an anchor view depending on the align alignment with x-off and y-off.
- Parameters:
align- Decides where the balloon should be placed.mainAnchor- A target view which popup will be displayed.subAnchorList- A list of anchors to display focuses on the overlay view.xOff- A horizontal offset from the anchor in pixels.
-
showAlign
final Unit showAlign(BalloonAlign align, View mainAnchor, List<View> subAnchorList)
Shows the balloon on an anchor view depending on the align alignment with x-off and y-off.
- Parameters:
align- Decides where the balloon should be placed.mainAnchor- A target view which popup will be displayed.subAnchorList- A list of anchors to display focuses on the overlay view.
-
showAlign
final Unit showAlign(BalloonAlign align, View mainAnchor)
Shows the balloon on an anchor view depending on the align alignment with x-off and y-off.
- Parameters:
align- Decides where the balloon should be placed.mainAnchor- A target view which popup will be displayed.
-
relayShowAlign
final Balloon relayShowAlign(BalloonAlign align, Balloon balloon, View anchor, Integer xOff, Integer yOff)
Shows the balloon on an anchor view depending on the align alignment with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.yOff- A vertical offset from the anchor in pixels.
-
relayShowAlign
final Balloon relayShowAlign(BalloonAlign align, Balloon balloon, View anchor, Integer xOff)
Shows the balloon on an anchor view depending on the align alignment with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.
-
relayShowAlign
final Balloon relayShowAlign(BalloonAlign align, Balloon balloon, View anchor)
Shows the balloon on an anchor view depending on the align alignment with x-off and y-off and shows the next balloon sequentially. This function returns the next balloon.
- Parameters:
balloon- A next Balloon that will be shown sequentially after dismissing this popup.anchor- A target view which popup will be shown to.
-
update
final Unit update(View anchor, Integer xOff, Integer yOff)
updates popup and arrow position of the popup based on a new target anchor view with additional x-off and y-off.
- Parameters:
anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.yOff- A vertical offset from the anchor in pixels.
-
update
final Unit update(View anchor, Integer xOff)
updates popup and arrow position of the popup based on a new target anchor view with additional x-off and y-off.
- Parameters:
anchor- A target view which popup will be shown to.xOff- A horizontal offset from the anchor in pixels.
-
update
final Unit update(View anchor)
updates popup and arrow position of the popup based on a new target anchor view with additional x-off and y-off.
- Parameters:
anchor- A target view which popup will be shown to.
-
updateSizeOfBalloonCard
final Unit updateSizeOfBalloonCard(Integer width, Integer height)
-
dismissWithDelay
final Boolean dismissWithDelay(Long delay)
dismiss the popup menu with milliseconds delay.
-
setOnBalloonClickListener
final Unit setOnBalloonClickListener(OnBalloonClickListener onBalloonClickListener)
sets a OnBalloonClickListener to the popup.
-
clearAllPreferences
final Unit clearAllPreferences()
clears all persisted preferences.
-
setOnBalloonInitializedListener
final Unit setOnBalloonInitializedListener(OnBalloonInitializedListener onBalloonInitializedListener)
sets a OnBalloonInitializedListener to the popup. The OnBalloonInitializedListener.onBalloonInitialized will be invoked when inflating the body content of the balloon is finished.
-
setOnBalloonDismissListener
final Unit setOnBalloonDismissListener(OnBalloonDismissListener onBalloonDismissListener)
sets a OnBalloonDismissListener to the popup.
-
setOnBalloonOutsideTouchListener
final Unit setOnBalloonOutsideTouchListener(OnBalloonOutsideTouchListener onBalloonOutsideTouchListener)
sets a OnBalloonOutsideTouchListener to the popup.
-
setOnBalloonTouchListener
final Unit setOnBalloonTouchListener(View.OnTouchListener onTouchListener)
sets a View.OnTouchListener to the popup.
-
setOnBalloonOverlayTouchListener
final Unit setOnBalloonOverlayTouchListener(View.OnTouchListener onTouchListener)
sets a View.OnTouchListener to the overlay popup
-
setOnBalloonOverlayTouchListener
final Unit setOnBalloonOverlayTouchListener(Function2<View, MotionEvent, Boolean> block)
sets a View.OnTouchListener to the overlay popup using lambda.
-
setOnBalloonOverlayClickListener
final Unit setOnBalloonOverlayClickListener(OnBalloonOverlayClickListener onBalloonOverlayClickListener)
sets a OnBalloonOverlayClickListener to the overlay popup.
-
setIsAttachedInDecor
final Balloon setIsAttachedInDecor(Boolean value)
sets whether the popup window will be attached in the decor frame of its parent window. If you want to show up balloon on your DialogFragment, it's recommended to use with true. (#131)
-
getMeasuredWidth
final Integer getMeasuredWidth()
gets measured width size of the balloon popup.
-
getMeasuredHeight
final Integer getMeasuredHeight()
gets measured height size of the balloon popup.
-
getContentView
final ViewGroup getContentView()
gets a content view of the balloon popup window.
-
getBalloonArrowView
final View getBalloonArrowView()
gets a arrow view of the balloon popup window.
-
onPause
Unit onPause(LifecycleOwner owner)
dismiss when the LifecycleOwner be on paused.
-
onDestroy
Unit onDestroy(LifecycleOwner owner)
dismiss automatically when lifecycle owner is destroyed.
-
-
-
-