禁用双层抽屉式导航栏右抽屉抽屉图标动画抽屉、图标、动画、抽屉式

2023-09-05 06:11:35 作者:时间生个野种叫回忆

我有一个Double导航抽屉

我有两个问题。

1)左边的抽屉式导航图标(3条)打开或关闭导航抽屉权当动画。

1) The navigation drawer icon on the left (3 bars) animate when opening or closing the navigation drawer on the right.

2)我不知道如何将图标添加到右侧,并只为右抽屉动画。

2) I do not know how to add the icon to the right and have it animate only for the right drawer.

推荐答案

您需要重写ActionBarDrawerToggle的onDrawerSlide方法和设置在 slideOffset 0 如果抽屉是正确的抽屉里。因此,这将禁用导航抽屉形象的动画右抽屉。

You need to override the onDrawerSlide method of ActionBarDrawerToggle and set the slideOffset to 0 if the drawer is right drawer. So this would disable the animation of the navigation drawer image for right drawer.

  @Override
  public void onDrawerSlide(View drawerView, float slideOffset) 
  {
        if(drawerView!=null && drawerView == rightDrawerListView){
              super.onDrawerSlide(drawerView, 0);
        }else{
              super.onDrawerSlide(drawerView, slideOffset);
        }
  }

这工作对我来说,谷歌+相似。

This worked for me similar to Google+.