禁用双层抽屉式导航栏右抽屉抽屉图标动画 [英] Disable animation of drawer icon in double navigation drawer for right drawer

查看:293
本文介绍了禁用双层抽屉式导航栏右抽屉抽屉图标动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个<一个href="http://stackoverflow.com/questions/17861755/drawerlayout-double-drawer-left-and-right-drawers-simultaneously">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+.

这篇关于禁用双层抽屉式导航栏右抽屉抽屉图标动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆