setOnBalloonOverlayClickListener does not work
See original GitHub issuesetOnBalloonOverlayClickListener
does not work. The listener block assigned was not invoked.
- Library Version v1.3.1
Update example
EditBalloonFactory
code to the following and addsetOnBalloonOverlayClickListener
override fun create(context: Context, lifecycle: LifecycleOwner?): Balloon {
return Balloon.Builder(context)
.setText("You can edit your profile now!")
.setArrowSize(10)
.setWidthRatio(1.0f)
.setHeight(BalloonSizeSpec.WRAP)
.setArrowPositionRules(ArrowPositionRules.ALIGN_ANCHOR)
.setArrowPosition(0.5f)
.setPadding(12)
.setMarginRight(12)
.setMarginLeft(12)
.setTextSize(15f)
.isRtlSupport(BalloonUtils.isRtlLayout())
.setCornerRadius(8f)
.setTextColorResource(R.color.white_87)
.setIconDrawableResource(R.drawable.ic_edit)
.setBackgroundColorResource(R.color.skyBlue)
.setBalloonAnimation(BalloonAnimation.ELASTIC)
.setIsVisibleOverlay(true)
.setOverlayColorResource(R.color.overlay)
.setOverlayPadding(6f)
.setOverlayShape(BalloonOverlayRoundRect(12f, 12f))
.setLifecycleOwner(lifecycle)
.setDismissWhenClicked(true)
.setOnBalloonDismissListener {
Toast.makeText(context.applicationContext, "dismissed", Toast.LENGTH_SHORT).show()
}.setOnBalloonOverlayClickListener {
Toast.makeText(context.applicationContext, "overlay", Toast.LENGTH_SHORT).show()
}.build()
}
}
Build and run the sample app.
Click on the Edit Profile
button
Balloon is shown with overlay on top of the button
Click on the overlay on top of the Edit Profile
button
** Observed **
Balloon dismissed with no overlay
toast
Expected Behavior:
overlay
toast is displayed before dismissing balloon.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
clicking in ballon in mapview should start another activity
setOnBallonTapListener (overlayIndex, new OnBalloonTapListener() { @Override public void onBalloonTap(int ... It works for me very fine.
Read more >setOnBalloonDismissListener
setOnBalloonDismissListener ... fun setOnBalloonDismissListener(onBalloonDismissListener: OnBalloonDismissListener?) ... sets a OnBalloonDismissListener to the ...
Read more >Untitled
Disability rights protests, Aeroderivative turbines don't have, ... Light level overlay 1.4.6, The first miracle of mary mackillop, Stream main event live, ...
Read more >National Fire Incident Reporting System Complete Reference ...
ment was the first in-depth discussion of this country's fire problem. ... In this event, create an EMS incident ... Balloon construction.
Read more >Tissue Engineered Skin Substitutes - Cigna
language and coverage determinations do not apply to those clients. ... In the event of a conflict, a customer's benefit.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, Thanks for this awesome library. Our requirement is: when clicking on the anchor view, which is highlighted, we need a callback (listener). But when clicking outside, the ballon should dismiss. Some like this will do:
Hi, @NattyBadWolf You can implement it using the below codes.