diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-06-27 01:19:59 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-07-01 22:59:29 +0000 |
| commit | 088b0e99985c166c44dfe79f60f9bbb9607070a6 (patch) | |
| tree | 785ade1f13de85902a5d4139f46080c53e6cf011 /android | |
| parent | 64a5fc0c1de54a852b4666efed82c754c7553b2b (diff) | |
| download | mullvadvpn-088b0e99985c166c44dfe79f60f9bbb9607070a6.tar.xz mullvadvpn-088b0e99985c166c44dfe79f60f9bbb9607070a6.zip | |
Work around banner showing bottom part too soon
If the notification that is to be shown increases the height of the
banner, it will take another layout pass for it to properly adjust the
animation offsets. During this time, the view becomes visible and shows
the bottom part of the banner before the animation starts.
The work around implemented here is to simply delay the animation by a
small amount (enough for a frame to be skipped) to ensure the layout has
completed and moved the banner up enough for the bottom part to not be
shown when the view becomes visible.
Diffstat (limited to 'android')
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/NotificationBanner.kt | 3 |
1 files changed, 3 insertions, 0 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 976a82cdd2..17d8fd3e20 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 @@ -38,6 +38,9 @@ class NotificationBanner : FrameLayout { private val animation = ObjectAnimator.ofFloat(this, "translationY", 0.0f).apply { addListener(animationListener) setDuration(350) + + // Ensure there's time for the layout to finish before making the banner visible + setStartDelay(20) } private val container = |
