FloatingActionButonBehavior: set translation back to 0 when snackbar dies

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2018-07-29 03:55:11 +02:00
parent e5a5bad240
commit 07359e392c

View File

@ -29,4 +29,11 @@ public class FloatingActionButtonBehavior extends CoordinatorLayout.Behavior<Flo
child.setBehaviorYTranslation(Math.min(0, dependency.getTranslationY() - dependency.getMeasuredHeight())); child.setBehaviorYTranslation(Math.min(0, dependency.getTranslationY() - dependency.getMeasuredHeight()));
return true; 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);
}
} }