skydoves / Balloon

:balloon: Modernized and sophisticated tooltips, fully customizable with an arrow and animations for Android.

Home Page:https://skydoves.github.io/libraries/balloon/html/balloon/com.skydoves.balloon/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prevent Balloon on theme changed

Wonderjack996 opened this issue · comments

Hi @skydoves. I was using your amazing library, but i didn't find a way to persist the balloon when i change app theme (dark to ligth or viceversa). Is there a predefined way suggested?

Hey @Wonderjack996, altering the device theme involves systematic operations and can be treated as a configuration change. This solution on Stack Overflow might be helpful for listening to the dark mode, allowing you to re-show your balloon:

https://stackoverflow.com/questions/59694023/listening-on-dark-theme-in-notification-area-toggle-and-be-notified-of-a-chang)

Alternatively, if your project already uses' ViewModel', you can leverage it to preserve data through configuration changes. For instance, your ViewModel can hold an observable (LiveData/StateFlow or any other), and your Activity/Fragment or Composable can observe state changes and display your balloon accordingly.