Skip to content

.setDismissWhenTouchOutside(false) did not work Β #766

@WilsonScott

Description

@WilsonScott

Please complete the following information:

  • Library Version [1.6.11]
  • Affected Device(s) [Redmi Note 13]

Describe the Bug:
.setDismissWhenTouchOutside(false) did not work
when click outside , the balloon dismissed

Add a clear description about the problem.
Code:
balloon?.dismiss()
balloon = Balloon.Builder(this)
.setText(desc)
.setTextSize(13f)
.setTextTypeface(Typeface.SANS_SERIF)
.setTextColorResource(R.color.colorTextWhite)
.setTextGravity(Gravity.CENTER_VERTICAL)
.setArrowSize(6)
.setArrowColor(ContextCompat.getColor(this,themeColor))
.setArrowOrientation(ArrowOrientation.BOTTOM)
.setLifecycleOwner(this)
.setArrowPosition(0.5f)
.setCornerRadius(4f)
.setPaddingLeft(16)
.setPaddingRight(16)
.setPaddingTop(8)
.setPaddingBottom(8)
.setCornerRadius(12f)
.setIsVisibleOverlay(true)
.setMaxWidthRatio(0.5f)
.setOverlayPadding(0F)
.setOverlayPaddingColor(ContextCompat.getColor(this@MainActivity,R.color.transparent))
.setOverlayColorResource(R.color.colorDim)
.setOverlayPaddingColorResource(R.color.colorPrimary)
.setOverlayShape(BalloonOverlayRoundRect(radius, radius))
.setShouldPassTouchEventToAnchor(true)
.setDismissWhenTouchOutside(false)
.setFocusable(false)
.setBackgroundColor(ContextCompat.getColor(this, themeColor))
.setBalloonAnimation(BalloonAnimation.CIRCULAR)
.setBalloonHighlightAnimation(BalloonHighlightAnimation.HEARTBEAT)
.build()
anchorView.post {
if (balloon?.isShowing == false){
balloon?.showAlignTop(anchorView)
}
}
Expected Behavior:
when i clicked outside of the balloon , the balloon did not disappeared
A clear description of what you expected to happen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions