ArcLayout
ArcLayout copied to clipboard
How to hide menu when back from another activity
I follow the code to implement Tumblr menu in MainActivity, when a item click, it navigate to SettingActivity, then I press back to finish Setting activity, the menu still show . How to close the menu at OnResume of MainActivity ?
private void hideMenu(int cx, int cy, float startRadius, float endRadius) {
List<Animator> animList = new ArrayList<>();
for (int i = arcLayout.getChildCount() - 1; i >= 0; i--) {
animList.add(createHideItemAnimator(arcLayout.getChildAt(i)));
}
animList.add(createHideItemAnimator(centerItem));
Animator revealAnim = createCircularReveal(menuLayout, cx, cy, startRadius, endRadius);
revealAnim.setInterpolator(new AccelerateDecelerateInterpolator());
revealAnim.setDuration(200);
revealAnim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
menuLayout.setVisibility(View.INVISIBLE);
}
});
animList.add(revealAnim);
AnimatorSet animSet = new AnimatorSet();
animSet.playSequentially(animList);
animSet.start();
}
I found above code to close menu when fab clicked. But it not help when close menu at onResume