A flexible widget for user notification. Customize your text, button, duration, animations and much more. For Android devs, it is made to replace Snackbars and Toasts.
In our app, we have a case when we need to show the Flushbar on app state change. Currently, we are executing the logic like this:
if (state.isOff && !customFlushbar.isShowing()) {
customFlushbar.show(context);
} else if (state.isOn && customFlushbar.isShowing()) {
customFlushbar.dismiss(context);
}
However, there are cases when the state could change while the app is running in the background, then we receive multiple state change events at the same time on the app resume. As a result, the first condition returns true until the Flushbar animation ends which means that the customFlushbar.show(context); could be triggered multiple times, multiple Flushbars appear on top of each other.
To resolve this, I would like to expose the isAppearing() and isHiding() methods so we could check both states - whether the Flushbar is showing or the showing animation is ongoing.
In our app, we have a case when we need to show the Flushbar on app state change. Currently, we are executing the logic like this:
However, there are cases when the state could change while the app is running in the background, then we receive multiple state change events at the same time on the app resume. As a result, the first condition returns
true
until the Flushbar animation ends which means that thecustomFlushbar.show(context);
could be triggered multiple times, multiple Flushbars appear on top of each other.To resolve this, I would like to expose the
isAppearing()
andisHiding()
methods so we could check both states - whether the Flushbar is showing or the showing animation is ongoing.