diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-07-29 03:55:11 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-07-29 04:23:30 +0200 |
commit | 07359e392cc3ce26fa8ac79079897973fa53acd1 (patch) | |
tree | 096406fdf6f417c11e1f31d82641e85588509790 | |
parent | e5a5bad240c9d31611823ca1c41b7abdffec0993 (diff) |
FloatingActionButonBehavior: set translation back to 0 when snackbar dies
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | app/src/main/java/com/wireguard/android/widget/fab/FloatingActionButtonBehavior.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/src/main/java/com/wireguard/android/widget/fab/FloatingActionButtonBehavior.java b/app/src/main/java/com/wireguard/android/widget/fab/FloatingActionButtonBehavior.java index 8067728e..c41687b0 100644 --- a/app/src/main/java/com/wireguard/android/widget/fab/FloatingActionButtonBehavior.java +++ b/app/src/main/java/com/wireguard/android/widget/fab/FloatingActionButtonBehavior.java @@ -29,4 +29,11 @@ public class FloatingActionButtonBehavior extends CoordinatorLayout.Behavior<Flo child.setBehaviorYTranslation(Math.min(0, dependency.getTranslationY() - dependency.getMeasuredHeight())); return true; } + + @Override + public void onDependentViewRemoved(final CoordinatorLayout parent, FloatingActionsMenu child, + final View dependency) { + // TODO(msf): animate this so it isn't so dramatic when the snackbar is swiped away + child.setBehaviorYTranslation(0); + } } |