Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After Dismiss First Popup Another is Not Open without Second Time Click #124

Closed
Shreyansh286 opened this issue Nov 25, 2020 · 11 comments
Closed

Comments

@Shreyansh286
Copy link

Shreyansh286 commented Nov 25, 2020

Please complete the following information:

  • Library Version [e.g. v1.2.6]
  • Affected Device(s) [e.g. Samsung Galaxy J7 Pro with Android 9.0]

Describe the Bug:

  • I used This Lib in Bottom Navigation.when I click on any bottom navigation Tab it is open.when I click on second tab first popup dismiss but not open second one.After Click Second Time New PopUp open.please help me for same.
    BottomPopUP

Expected Behavior:
-I want when i click on tab that particular tab popup open and old one dismiss if it is open.

@skydoves
Copy link
Owner

skydoves commented Nov 26, 2020

Could you provide an example of the Balloon.Builder implementations?
And are two (first and second) Balloon properties declared differently?

@Shreyansh286
Copy link
Author

Shreyansh286 commented Nov 30, 2020

yes..Declare Differently.Create new instance for each tab.

private val customListHomeBalloon by balloon(CustomListHomeBalloonFactory::class)
private val customListSuggestionsBalloon by balloon(CustomListSuggestionsBalloonFactory::class)
private val customListSellProductBalloon by balloon(CustomListSellProductBalloonFactory::class)
private val customListShopChumsBalloon by balloon(CustomListShopChumsBalloonFactory::class)
private val customListSpreadTheWordBalloon by balloon(CustomListSpreadTheWordBalloonFactory::class)
`class CustomListHomeBalloonFactory : Balloon.Factory() {

override fun create(context: Context, lifecycle: LifecycleOwner?): Balloon {
    return Balloon.Builder(context)
            .setLayout(R.layout.layout_custom_list)
            .setArrowOrientation(ArrowOrientation.BOTTOM)
            .setArrowConstraints(ArrowConstraints.ALIGN_ANCHOR).setTextGravity(Gravity.CENTER)
            //.setArrowPosition(0.5f)
            .setArrowSize(20)
            .setTextSize(9f)
            .isRtlSupport(BalloonUtils.isRtlLayout())
            .setCornerRadius(6f)
            .setMarginRight(12).setMarginBottom(30)
            .setElevation(7).setWidth(230).setHeight(345)
            .setBackgroundColorResource(R.color.white).setTextGravity(Gravity.CENTER)
            .setBalloonAnimation(BalloonAnimation.FADE)
            .setDismissWhenShowAgain(true)
            .setLifecycleOwner(lifecycle)
            .build()
}

}`

@Shreyansh286
Copy link
Author

@skydoves Please help me for same.I stuck for same Issue.

@skydoves
Copy link
Owner

skydoves commented Dec 4, 2020

Hi, @shreyushah
I just built the demo project using the below codes and it works well.
Could you run the demo project?

CustomActivity.kt

bottomNavigationView.setOnNavigationItemSelectedListener {
        customTagBalloon.showAlignTop(bottomNavigationView, 130, 0)
        true
}

customTagBalloon.setOnBalloonClickListener {
        customTagBalloon.dismiss()
        editBalloon.showAlignTop(bottomNavigationView, 130, 0)
 }

Thanks.

@Shreyansh286
Copy link
Author

yes I run..my issue is when one popup open click on another tab open popup should dismiss and new popup should open..in current if one popup open than->click second tab->first dismiss->when second time tab new popup open

@skydoves
Copy link
Owner

skydoves commented Dec 4, 2020

Ah, I got it!
Use this method for your Balloon.Builder.

setFocusable(false)

This method allows your balloon that can touch outsides so you can touch the menu directly without dismissing the Balloon.

The actual process from the issue seems ..

one popup open than->click second tab (Actually not the menu is not clicked, the touch event will be hooked by the balloon for dismissing the balloon) -> click the second tab again -> first dismiss and show the second one.

@skydoves
Copy link
Owner

skydoves commented Dec 8, 2020

@shreyushah
Any updates?

@Shreyansh286
Copy link
Author

Shreyansh286 commented Dec 8, 2020 via email

@skydoves
Copy link
Owner

I will close this issue now.
Please reopen if you would get any related issues.

@Shreyansh286
Copy link
Author

@skydoves
It is working fine now.Thanks for awesome library and support.

@skydoves
Copy link
Owner

Thanks for checking 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants