use of me.yokeyword.fragmentation.anim.DefaultHorizontalAnimator in project Fragmentation by YoKeyword.
the class HomeFragment method onMenuItemClick.
@Override
public boolean onMenuItemClick(MenuItem item) {
switch(item.getItemId()) {
case R.id.action_anim:
final PopupMenu popupMenu = new PopupMenu(_mActivity, mToolbar, GravityCompat.END);
popupMenu.inflate(R.menu.home_pop);
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
switch(item.getItemId()) {
case R.id.action_anim_veritical:
((ISupportActivity) _mActivity).setFragmentAnimator(new DefaultVerticalAnimator());
Toast.makeText(_mActivity, R.string.anim_v, Toast.LENGTH_SHORT).show();
break;
case R.id.action_anim_horizontal:
((ISupportActivity) _mActivity).setFragmentAnimator(new DefaultHorizontalAnimator());
Toast.makeText(_mActivity, R.string.anim_h, Toast.LENGTH_SHORT).show();
break;
case R.id.action_anim_none:
((ISupportActivity) _mActivity).setFragmentAnimator(new DefaultNoAnimator());
Toast.makeText(_mActivity, R.string.anim_none, Toast.LENGTH_SHORT).show();
break;
}
popupMenu.dismiss();
return true;
}
});
popupMenu.show();
break;
}
return true;
}
Aggregations