skydoves / Balloon

:balloon: Modernized and sophisticated tooltips, fully customizable with an arrow and animations for Android.
https://skydoves.github.io/libraries/balloon/html/balloon/com.skydoves.balloon/index.html
Apache License 2.0
3.7k stars 289 forks source link

Balloon is not showing except version v1.2.2 #121

Closed victory316 closed 3 years ago

victory316 commented 3 years ago

Hi. Thanks for the great library.

But I have some issue on 1.2.4 and 1.2.5.

It was fine when I applied 1.2.4 on different branch of our previous project,

But now Its not showing balloon after I merged in recent project.

so I downgraded to 1.2.2 and It works now..

I left current versions of library we used, please it would helps.

Thanks.

kotlinVersion = '1.4.10' gradleVersion = '4.1.0' jUnitVersion = '4.1' extJUnitVersion = '1.1.2' mockitoInlineVersion = '2.21.0' mochitoAndroidVersion = '2.24.5' googleServicesVersion = '4.3.3' firebaseCrashlyticsGradleVersion = '1.28.0' compileSdkVersion = 29 minSdkVersion = 21 targetSdkVersion = 29 androidSupportVersion = '28.0.0' aacLifecycleVersion = '1.1.1' pagingVersion = '1.0.1' butterknifeVersion = '8.4.0' rxAndroidVersion = '2.1.1' rxJavaVersion = '2.1.3' okhttpVersion = '3.14.9' retrofitVersion = '2.3.0' retrofitOldVersion = '2.1.0' circleImageviewVersion = '2.2.0' koinAndroidVersion = '2.2.0-rc-2' gsonVersion = '2.8.5' glideVersion = '4.8.0' securePreferenceVersion = '0.1.4' pageIndicatorViewVersion = '1.0.1' ankoVersion = '0.10.5' coverFlowVersion = 'release-v1.0.5' lottieVersion = '3.4.0' tedPermissionVersion = '2.2.3' slidingUpPanelVersion = '3.4.0' duktapeVersion = '1.3.0' lifeCycleExtVersion = '2.2.0' materialVersion = '1.2.1' constraintLayoutVersion = '2.0.4' firebaseAnalyticsVersion = '18.0.0' firebaseCrashlyticsVersion = '17.3.0' firebaseMessagingVersion = '21.0.0' firebaseDynamicLinkVersion = '19.1.1' rxBindingVersion = '3.1.0' appsFlyerVersion = '5.4.3' installReferrerVersion = '2.1' playCoreVersion = '1.8.3' facebookSDKVersion = '5.15.3' bundletoolVersion = '0.9.0' channelIOVersion = '7.0.7' balloonVersion = '1.2.4'

skydoves commented 3 years ago

Hi, @victory316 Would you give some implementation details of the Balloon.Builder and what method used to show up?

skydoves commented 3 years ago

Please reopen this if you find the specifications of the issue. Thanks ;)

victory316 commented 3 years ago
class BalloonBuilder {

    fun createWhiteBalloon(context: Context, text: String): Balloon {

        return createBalloon(context) {
            setArrowSize(10)
            setHeight(65)
            setArrowPosition(0.2f)
            setCornerRadius(4f)
            setText(text)
            setMarginLeft(12)
            setPaddingLeft(5)
            setPaddingRight(5)
            setArrowOrientation(ArrowOrientation.TOP)
            setTextColorResource(R.color.gray_600)
            setBackgroundColorResource(R.color.white)
            setBalloonAnimation(BalloonAnimation.FADE)
            setLifecycleOwner(lifecycleOwner)
        }.apply {
            dismissWithDelay(BALLOON_SHOW_DELAY)
        }
    }

    fun createBlueBalloon(context: Context, text: String): Balloon {

        return createBalloon(context) {
            setArrowSize(10)
            setHeight(65)
            setArrowPosition(0.2f)
            setCornerRadius(4f)
            setText(text)
            setMarginLeft(12)
            setPaddingLeft(5)
            setPaddingRight(5)
            setArrowOrientation(ArrowOrientation.BOTTOM)
            setTextColorResource(R.color.white)
            setBackgroundColorResource(R.color.primary_500)
            setBalloonAnimation(BalloonAnimation.FADE)
            setLifecycleOwner(lifecycleOwner)
        }.apply {
            dismissWithDelay(BALLOON_SHOW_DELAY)
        }
    }

    companion object {
        const val BALLOON_SHOW_DELAY = 5000L
    }
}

I Used it inside in onCreate in activity like below.

        BalloonBuilder().createWhiteBalloon(this, getString(R.string.text_needhelp_tooltip))
                .showAlignBottom(binding.toolbarInfoLayout.llCs)

Thanks!

@skydoves

skydoves commented 3 years ago

Is that show the same result if you give the width ratio?

.setWidthRatio(1.0f)

Or giving a specific width size.

.setWidth(600)
harmeetsingh-work commented 3 years ago

Same v1.2.8 ballon does not show, same code v1.2.4 working fine.

skydoves commented 3 years ago

Hi, @harmeetsingh-work. Could you provide a sample project or codes including the issue? Actually, it seems to work fine in the demo project.

harmeetsingh-work commented 3 years ago

Ya Sure:

val balloonCoinsOnShare = createBalloon(context) {
            setArrowSize(10)
            setWidthRatio(0.5f)
            setHeight(65)
            setArrowPosition(0.6f)
            setCornerRadius(8f)
            setAlpha(0.9f)
            setText("Share Result On WhatsApp To Earn Coins.")
            setTextColorResource(R.color.gray_light)
            setIconDrawable(ContextCompat.getDrawable(context, R.drawable.ic_game_coin_128))
            setPaddingLeft(8)
            setBackgroundColorResource(R.color.colorPrimary)
            setBalloonAnimation(BalloonAnimation.ELASTIC)
            setLifecycleOwner(lifecycleOwner)
            setFocusable(false)
            setMarginRight(16)
        }

balloonCoinsOnShare.showAlignTop(getCustomView().findViewById<Button>(R.id.tv_share))