onShow onHide listener
alorma opened this issue · comments
you can implement withVisibilityChangeListener(); in your SnackBar. here is mine using floating action button:
new SnackBar.Builder(ActivityHome.this) .withMessage(getString(R.string.distance_alert)) .withVisibilityChangeListener(new SnackBar.OnVisibilityChangeListener() { @Override public void onShow(int i) { ViewPropertyAnimator.animate(mFabLocation).cancel(); ViewPropertyAnimator.animate(mFabLocation).translationY(-72).setDuration(200).start(); } @Override public void onHide(int i) { ViewPropertyAnimator.animate(mFabLocation).cancel(); ViewPropertyAnimator.animate(mFabLocation).translationY(0).setDuration(200).start(); } }) .show();