balloon / com.skydoves.balloon / Balloon / Builder

Builder

class Builder

Builder class for creating Balloon.

Constructors

<init>

Builder(context: Context)

Builder class for creating Balloon.

Properties

alpha

var alpha: Float

arrowDrawable

var arrowDrawable: Drawable?

arrowOrientation

var arrowOrientation: ArrowOrientation

arrowPosition

var arrowPosition: Float

arrowSize

var arrowSize: Int

arrowVisible

var arrowVisible: Boolean

backgroundColor

var backgroundColor: Int

backgroundDrawable

var backgroundDrawable: Drawable?

balloonAnimation

var balloonAnimation: BalloonAnimation

cornerRadius

var cornerRadius: Float

dismissWhenClicked

var dismissWhenClicked: Boolean

dismissWhenShowAgain

var dismissWhenShowAgain: Boolean

dismissWhenTouchOutside

var dismissWhenTouchOutside: Boolean

height

var height: Int

iconDrawable

var iconDrawable: Drawable?

iconForm

var iconForm: IconForm?

iconSize

var iconSize: Int

iconSpace

var iconSpace: Int

layout

var layout: Int

lifecycleOwner

var lifecycleOwner: LifecycleOwner?

onBalloonClickListener

var onBalloonClickListener: OnBalloonClickListener?

onBalloonDismissListener

var onBalloonDismissListener: OnBalloonDismissListener?

onBalloonOutsideTouchListener

var onBalloonOutsideTouchListener: OnBalloonOutsideTouchListener?

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

width

var width: Int

widthRatio

var widthRatio: Float

Functions

build

fun build(): Balloon

setAlpha

fun setAlpha(value: Float): Builder

sets the alpha value to the popup.

setArrowDrawable

fun setArrowDrawable(value: Drawable?): Builder

sets a custom drawable of the arrow.

setArrowOrientation

fun setArrowOrientation(value: ArrowOrientation): Builder

sets the arrow orientation using ArrowOrientation.

setArrowPosition

fun setArrowPosition(value: Float): Builder

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

setArrowSize

fun setArrowSize(value: Int): Builder

sets the size of the arrow.

setArrowVisible

fun setArrowVisible(value: Boolean): Builder

sets the visibility of the arrow.

setBackgroundColor

fun setBackgroundColor(value: Int): Builder

sets the background color of the arrow and popup.

setBackgroundColorResource

fun setBackgroundColorResource(value: Int): Builder

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

setBackgroundDrawable

fun setBackgroundDrawable(value: Drawable?): Builder

sets the background drawable of the popup.

setBalloonAnimation

fun setBalloonAnimation(value: BalloonAnimation): Builder

sets the balloon showing animation using BalloonAnimation.

setCornerRadius

fun setCornerRadius(value: Float): Builder

sets the corner radius of the popup.

setDismissWhenClicked

fun setDismissWhenClicked(value: Boolean): Builder

dismisses when the popup clicked.

setDismissWhenShowAgain

fun setDismissWhenShowAgain(value: Boolean): Builder

dismisses when invoked show function again.

setDismissWhenTouchOutside

fun setDismissWhenTouchOutside(value: Boolean): Builder

dismisses when touch outside.

setHeight

fun setHeight(value: Int): Builder

sets the height size.

setIconDrawable

fun setIconDrawable(value: Drawable?): Builder

sets the icon drawable of the popup.

setIconForm

fun setIconForm(value: IconForm): Builder

applies IconForm attributes to the icon.

setIconSize

fun setIconSize(value: Int): Builder

sets the size of the icon drawable.

setIconSpace

fun setIconSpace(value: Int): Builder

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

setLayout

fun setLayout(layout: Int): Builder

sets the custom layout resource to the popup content.

setLifecycleOwner

fun setLifecycleOwner(value: LifecycleOwner): Builder

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

setOnBalloonClickListener

fun setOnBalloonClickListener(value: OnBalloonClickListener): Builder

sets a OnBalloonClickListener to the popup.

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

sets a OnBalloonClickListener to the popup using lambda.

setOnBalloonDismissListener

fun setOnBalloonDismissListener(value: OnBalloonDismissListener): Builder

sets a OnBalloonDismissListener to the popup.

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

sets a OnBalloonDismissListener to the popup using lambda.

setOnBalloonOutsideTouchListener

fun setOnBalloonOutsideTouchListener(value: OnBalloonOutsideTouchListener): Builder

sets a OnBalloonOutsideTouchListener to the popup.

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

sets a OnBalloonOutsideTouchListener to the popup using lambda.

setPreferenceName

fun setPreferenceName(value: String): Builder

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

setShowTime

fun setShowTime(value: Int): Builder

sets the show times.

setSpace

fun setSpace(value: Int): Builder

sets the side space between popup and display.

setText

fun setText(value: String): Builder

sets the main text content of the popup.

setTextColor

fun setTextColor(value: Int): Builder

sets the color of the main text content.

setTextColorResource

fun setTextColorResource(value: Int): Builder

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

setTextForm

fun setTextForm(value: TextForm): Builder

applies TextForm attributes to the main text content.

setTextSize

fun setTextSize(value: Float): Builder

sets the size of the main text content.

setTextTypeface

fun setTextTypeface(value: Int): Builder

sets the typeface of the main text content.

setWidth

fun setWidth(value: Int): Builder

sets the width size.

setWidthRatio

fun setWidthRatio(value: Float): Builder

sets the width size by the display screen size ratio.