Skip to content

"setBackgroundColorResource" not applied when app theme has a custom background tint #800

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

Open
SamH2022 opened this issue Mar 28, 2025 · 0 comments

Comments

@SamH2022
Copy link

SamH2022 commented Mar 28, 2025

Hello,

First, let me express my gratitude and appreciation to your great work, Thank you very much!!
On the app I'm working on , the main app theme is Theme.MaterialComponents.DayNight.Bridge
The background tint is set as as black.
<item name="android:backgroundTint">@color/black</item>
That affects the balloon 's setBackgroundColorResource . No matter what I do, the color never changes and stays black.
Any suggestions will be very much appreciated.

Thanks

Update:
It worth mentioning that setBackgroundColorResource works just fine if I set it up in a fragment, but not in an activity.
Here's the activity initialization of the balloon that fails to change background color:

Balloon balloon = new Balloon.Builder(this) .setWidthRatio(0.75f) .setHeight(BalloonSizeSpec.WRAP) .setText(getString(R.string.password_lenght_incorrect)) .setTextColorResource(R.color.white) .setTextSize(15.0f) .setArrowPositionRules(ArrowPositionRules.ALIGN_ANCHOR) .setArrowSize(10) .setArrowPosition(0.5f) .setPaddingTop(5) .setPaddingBottom(5) .setPaddingLeft(10) .setPaddingRight(10) .setCornerRadius(8f) .setBackgroundColorResource(R.color.red) .setBalloonAnimation(BalloonAnimation.OVERSHOOT) .setLifecycleOwner(this) .build(); balloon.showAlignTop(passwordEditText);

In fragment, it's exactly the same except the LifeCycleOwner in activity is : this. in frgament is : getViewLifecycleOwner()

Thanks

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

1 participant