当我取消所有油炸面包片时,油炸面包片有没有办法显示出动画?
当用户再次与触摸屏交互时,我使用自定义布局来拦截触摸事件:
@Override
public boolean onInterceptTouchEvent(final MotionEvent ev)
{
Crouton.cancelAllCroutons();
return super.onInterceptTouchEvent(ev);
}
该布局对显示的面包块一无所知。它以这种方式工作,但不是让它们消失,而是我想要播放动画(油炸面包块上升)。
我快速查看了源代码,Builder 可用于创建自定义动画以显示 toast。当我自定义面包块以播放动画淡入淡出时,它按预期工作,当面包块被取消时,似乎只有输出动画被忽略
final View customMessage = LayoutInflater.from(getContext()).inflate(R.layout.custom_layout,null);
final Configuration croutonConfig = new Configuration.Builder().setDuration(Configuration.DURATION_INFINITE).setInAnimation(android.R.anim.fade_in).setOutAnimation(android.R.anim.fade_out).build();
Crouton.make(this.getActivity(),customMessage).setConfiguration(croutonConfig).show();
任何人都知道如何做到这一点?