问题描述
我在我的应用程序中使用导航抽屉
。
I'm using Navigation Drawer
in my application.
当用户点击任何抽屉菜单项,它会打开一个新的活动
的(不片段)的。
When the user clicks on any of the menu item in drawer, it opens a new Activity
(not fragment).
现在,我使用 slide_right_in / slide_left_out动画
的活动之间的转换。
Now, I'm using slide_right_in/slide_left_out animation
as transition between activities.
在code ++工程,但收盘动画导航抽屉的这些动画冲突,甚至在抽屉里得到完全封闭,目前活动开始滑落至左和放大器;接下来的活动开始从右侧滑动。
The code works, but these animations conflicts with the closing animation of Navigation Drawer, as even before the drawer gets completely closed, the current activity starts sliding out to left & next activity starts sliding in from right.
那么,有没有什么办法可以启动动画后,才抽屉完全关闭?
So, is there any way to start the animation only after drawer is completely closed?
感谢您
推荐答案
您可以打开活动
有延迟。例如,以这样的方式活性
250毫秒后,将启动
You can open Activity
with a delay. For example, in such a way Activity
will be started after 250ms:
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(<filter>);
startActivity(intent);
finish();
}
}, 250);
mDrawerLayout.closeDrawer(mDrawerList);
这篇关于打开下一个活动的导航抽屉完成它关闭动画后,才的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!