Skip to content

Instantly share code, notes, and snippets.

@Binary-Finery
Created May 21, 2018 15:38
Show Gist options
  • Save Binary-Finery/1981af0cc4662c2b2d37466785d7cf40 to your computer and use it in GitHub Desktop.
Save Binary-Finery/1981af0cc4662c2b2d37466785d7cf40 to your computer and use it in GitHub Desktop.
animate menu fabs
private void hideMenuFabs() {
isFabRotated = false;
fab.startAnimation(AnimationUtils.loadAnimation(MainActivity.this, R.anim.fab_backwards));
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
fabShare.startAnimation(AnimationUtils.loadAnimation(MainActivity.this, R.anim.zoom_gone));
fabShare.setVisibility(View.INVISIBLE);
fab.setClickable(true);
}
}, 100);
fabSave.startAnimation(AnimationUtils.loadAnimation(MainActivity.this, R.anim.zoom_gone));
fabSave.setVisibility(View.INVISIBLE);
}
private void showMenuFabs() {
isFabRotated = true;
fab.startAnimation(AnimationUtils.loadAnimation(MainActivity.this, R.anim.fab_forward));
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
fabSave.setVisibility(View.VISIBLE);
fabSave.startAnimation(AnimationUtils.loadAnimation(MainActivity.this, R.anim.zoom_appear));
fab.setClickable(true);
}
}, 100);
fabShare.setVisibility(View.VISIBLE);
fabShare.startAnimation(AnimationUtils.loadAnimation(MainActivity.this, R.anim.zoom_appear));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment