balloon / com.skydoves.balloon / Balloon / Builder

Builder

class Builder

Builder class for creating Balloon.

Constructors

<init>

Builder class for creating Balloon.

Builder(context: Context)

Properties

alpha

var alpha: Float

arrowColor

var arrowColor: Int

arrowDrawable

var arrowDrawable: Drawable?

arrowOrientation

var arrowOrientation: ArrowOrientation

arrowPosition

var arrowPosition: Float

arrowSize

var arrowSize: Int

arrowVisible

var arrowVisible: Boolean

autoDismissDuration

var autoDismissDuration: Long

backgroundColor

var backgroundColor: Int

backgroundDrawable

var backgroundDrawable: Drawable?

balloonAnimation

var balloonAnimation: BalloonAnimation

balloonAnimationStyle

var balloonAnimationStyle: Int

cornerRadius

var cornerRadius: Float

dismissWhenClicked

var dismissWhenClicked: Boolean

dismissWhenShowAgain

var dismissWhenShowAgain: Boolean

dismissWhenTouchOutside

var dismissWhenTouchOutside: Boolean

elevation

var elevation: Float

height

var height: Int

iconColor

var iconColor: Int

iconDrawable

var iconDrawable: Drawable?

iconForm

var iconForm: IconForm?

iconSize

var iconSize: Int

iconSpace

var iconSpace: Int

isFocusable

var isFocusable: Boolean

isRtlSupport

var isRtlSupport: Boolean

layout

var layout: Int

lifecycleOwner

var lifecycleOwner: LifecycleOwner?

onBalloonClickListener

var onBalloonClickListener: OnBalloonClickListener?

onBalloonDismissListener

var onBalloonDismissListener: OnBalloonDismissListener?

onBalloonOutsideTouchListener

var onBalloonOutsideTouchListener: OnBalloonOutsideTouchListener?

padding

var padding: Int

paddingBottom

var paddingBottom: Int

paddingLeft

var paddingLeft: Int

paddingRight

var paddingRight: Int

paddingTop

var paddingTop: Int

preferenceName

var preferenceName: String?

showTimes

var showTimes: Int

space

var space: Int

text

var text: String

textColor

var textColor: Int

textForm

var textForm: TextForm?

textSize

var textSize: Float

textTypeface

var textTypeface: Int

textTypefaceObject

var textTypefaceObject: Typeface?

width

var width: Int

widthRatio

var widthRatio: Float

Functions

build

fun build(): Balloon

isRtlSupport

sets flag for enabling rtl support

fun isRtlSupport(value: Boolean): Builder

setAlpha

sets the alpha value to the popup.

fun setAlpha(value: Float): Builder

setArrowColor

sets a color of the arrow.

fun setArrowColor(value: Int): Builder

setArrowColorResource

sets a color of the arrow using a resource.

fun setArrowColorResource(value: Int): Builder

setArrowDrawable

sets a custom drawable of the arrow.

fun setArrowDrawable(value: Drawable?): Builder

setArrowDrawableResource

sets a custom drawable of the arrow using the resource.

fun setArrowDrawableResource(value: Int): Builder

setArrowOrientation

sets the arrow orientation using ArrowOrientation.

fun setArrowOrientation(value: ArrowOrientation): Builder

setArrowPosition

sets the arrow position by popup size ration. The popup size depends on arrowOrientation.

fun setArrowPosition(value: Float): Builder

setArrowSize

sets the size of the arrow.

fun setArrowSize(value: Int): Builder

setArrowVisible

sets the visibility of the arrow.

fun setArrowVisible(value: Boolean): Builder

setAutoDismissDuration

dismisses automatically some milliseconds later when the popup is shown.

fun setAutoDismissDuration(value: Long): Builder

setBackgroundColor

sets the background color of the arrow and popup.

fun setBackgroundColor(value: Int): Builder

setBackgroundColorResource

sets the background color of the arrow and popup using the resource color.

fun setBackgroundColorResource(value: Int): Builder

setBackgroundDrawable

sets the background drawable of the popup.

fun setBackgroundDrawable(value: Drawable?): Builder

setBackgroundDrawableResource

sets the background drawable of the popup by the resource.

fun setBackgroundDrawableResource(value: Int): Builder

setBalloonAnimation

sets the balloon showing animation using BalloonAnimation.

fun setBalloonAnimation(value: BalloonAnimation): Builder

setBalloonAnimationStyle

sets the balloon showing animation using custom xml animation style.

fun setBalloonAnimationStyle(value: Int): Builder

setCornerRadius

sets the corner radius of the popup.

fun setCornerRadius(value: Float): Builder

setDismissWhenClicked

dismisses when the popup clicked.

fun setDismissWhenClicked(value: Boolean): Builder

setDismissWhenShowAgain

dismisses when invoked show function again.

fun setDismissWhenShowAgain(value: Boolean): Builder

setDismissWhenTouchOutside

dismisses when touch outside.

fun setDismissWhenTouchOutside(value: Boolean): Builder

setElevation

sets the elevation to the popup.

fun setElevation(value: Int): Builder

setFocusable

sets isFocusable option to the body window. if true when the balloon is showing, can not touch other views and onBackPressed will be fired to the balloon.

fun setFocusable(value: Boolean): Builder

setHeight

sets the height size.

fun setHeight(value: Int): Builder

setIconColor

sets the color of the icon drawable.

fun setIconColor(value: Int): Builder

setIconColorResource

sets the color of the icon drawable using the resource color.

fun setIconColorResource(value: Int): Builder

setIconDrawable

sets the icon drawable of the popup.

fun setIconDrawable(value: Drawable?): Builder

setIconDrawableResource

sets the icon drawable of the popup using the resource.

fun setIconDrawableResource(value: Int): Builder

setIconForm

applies IconForm attributes to the icon.

fun setIconForm(value: IconForm): Builder

setIconSize

sets the size of the icon drawable.

fun setIconSize(value: Int): Builder

setIconSpace

sets the space between the icon and the main text content.

fun setIconSpace(value: Int): Builder

setLayout

sets the custom layout resource to the popup content.

fun setLayout(layout: Int): Builder

setLifecycleOwner

sets the LifecycleOwner for dismissing automatically when the LifecycleOwner is destroyed. It will prevents memory leak : Avoid Memory Leak

fun setLifecycleOwner(value: LifecycleOwner?): Builder

setOnBalloonClickListener

sets a OnBalloonClickListener to the popup.

fun setOnBalloonClickListener(value: OnBalloonClickListener): Builder

sets a OnBalloonClickListener to the popup using lambda.

fun setOnBalloonClickListener(unit: (View) -> Unit): Builder

setOnBalloonDismissListener

sets a OnBalloonDismissListener to the popup.

fun setOnBalloonDismissListener(value: OnBalloonDismissListener): Builder

sets a OnBalloonDismissListener to the popup using lambda.

fun setOnBalloonDismissListener(unit: () -> Unit): Builder

setOnBalloonOutsideTouchListener

sets a OnBalloonOutsideTouchListener to the popup.

fun setOnBalloonOutsideTouchListener(value: OnBalloonOutsideTouchListener): Builder

sets a OnBalloonOutsideTouchListener to the popup using lambda.

fun setOnBalloonOutsideTouchListener(unit: (View, MotionEvent) -> Unit): Builder

setPadding

sets the padding on all directions.

fun setPadding(value: Int): Builder

setPaddingBottom

sets the bottom padding on all directions.

fun setPaddingBottom(value: Int): Builder

setPaddingLeft

sets the left padding on all directions.

fun setPaddingLeft(value: Int): Builder

setPaddingRight

sets the right padding on all directions.

fun setPaddingRight(value: Int): Builder

setPaddingTop

sets the top padding on all directions.

fun setPaddingTop(value: Int): Builder

setPreferenceName

sets the preference name for persisting showing times(showTimes).

fun setPreferenceName(value: String): Builder

setShowTime

sets the show times.

fun setShowTime(value: Int): Builder

setSpace

sets the side space between popup and display.

fun setSpace(value: Int): Builder

setText

sets the main text content of the popup.

fun setText(value: String): Builder

setTextColor

sets the color of the main text content.

fun setTextColor(value: Int): Builder

setTextColorResource

sets the color of the main text content using the resource color.

fun setTextColorResource(value: Int): Builder

setTextForm

applies TextForm attributes to the main text content.

fun setTextForm(value: TextForm): Builder

setTextResource

sets the main text content of the popup using resource.

fun setTextResource(value: Int): Builder

setTextSize

sets the size of the main text content.

fun setTextSize(value: Float): Builder

setTextTypeface

sets the typeface of the main text content.

fun setTextTypeface(value: Int): Builder
fun setTextTypeface(value: Typeface): Builder

setWidth

sets the width size.

fun setWidth(value: Int): Builder

setWidthRatio

sets the width size by the display screen size ratio.

fun setWidthRatio(value: Float): Builder