1
这是我做的:FragmentDialog动画布局关闭
a。 FragmentDialog在onCreateView
之内的布局充气。
layMain = (LinearLayout) layout.findViewById(R.id.layMain);
final Animation anim = AnimationUtils.loadAnimation(getActivity(), R.anim.translate_from_bottom);
layMain.startAnimation(anim);`
b。创作动画效果很好。但是,我需要找到一种解决方法(例如,当用户按下“后退”按钮时)运行动画,然后关闭FragmentDialog c。我不想使用android:windowEnterAnimation
/android:windowExitAnimation
,因为并非所有设备在Developer菜单中都有动画活动,并且我需要在所有情况下运行动画。
因此,基本上,我应该重写什么事件才能运行动画,并在动画结束时进行关闭操作?
如果用户在对话框外按下,该怎么办?动画不起作用,对话框只是被解散。我正在寻找一个解决方案:/ – RJFares