diff options
Diffstat (limited to 'android/src')
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/NotificationBanner.kt | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/NotificationBanner.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/NotificationBanner.kt index dd5de3a532..6a20bcbd7f 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/NotificationBanner.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/NotificationBanner.kt @@ -28,17 +28,19 @@ class NotificationBanner : FrameLayout { } override fun onAnimationEnd(animation: Animator) { - if (reversedAnimation) { - // Banner is now hidden - val notification = notifications.current + synchronized(this@NotificationBanner) { + if (reversedAnimation) { + // Banner is now hidden + val notification = notifications.current - visibility = View.INVISIBLE + visibility = View.INVISIBLE - if (notification != null) { - // Notification changed, restart animation - update(notification) - reversedAnimation = false - animation.start() + if (notification != null) { + // Notification changed, restart animation + update(notification) + reversedAnimation = false + animation.start() + } } } } @@ -70,7 +72,9 @@ class NotificationBanner : FrameLayout { private var reversedAnimation = false val notifications = InAppNotificationController { _ -> - animateChange() + synchronized(this@NotificationBanner) { + animateChange() + } } constructor(context: Context) : super(context) {} |
