use of me.yokeyword.fragmentation.anim.DefaultVerticalAnimator 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:
_mActivity.setFragmentAnimator(new DefaultVerticalAnimator());
Toast.makeText(_mActivity, "设置全局动画成功! 竖向", Toast.LENGTH_SHORT).show();
break;
case R.id.action_anim_horizontal:
_mActivity.setFragmentAnimator(new DefaultHorizontalAnimator());
Toast.makeText(_mActivity, "设置全局动画成功! 横向", Toast.LENGTH_SHORT).show();
break;
case R.id.action_anim_none:
_mActivity.setFragmentAnimator(new DefaultNoAnimator());
Toast.makeText(_mActivity, "设置全局动画成功! 无", Toast.LENGTH_SHORT).show();
break;
}
popupMenu.dismiss();
return true;
}
});
popupMenu.show();
break;
}
return true;
}
Aggregations