当前位置: 首页>>代码示例>>Java>>正文


Java DrawerListener类代码示例

本文整理汇总了Java中android.support.v4.widget.DrawerLayout.DrawerListener的典型用法代码示例。如果您正苦于以下问题:Java DrawerListener类的具体用法?Java DrawerListener怎么用?Java DrawerListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DrawerListener类属于android.support.v4.widget.DrawerLayout包,在下文中一共展示了DrawerListener类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: close

import android.support.v4.widget.DrawerLayout.DrawerListener; //导入依赖的package包/类
public static Observable<Irrelevant> close(final DrawerLayout drawer) {
    return Observable.create(emitter -> {
        drawer.closeDrawer(GravityCompat.START);
        DrawerListener listener = new DrawerLayout.SimpleDrawerListener() {
            @Override
            public void onDrawerSlide(View drawerView, float slideOffset) {
                if (slideOffset < OFFSET_THRESHOLD) {
                    emitter.onNext(Irrelevant.INSTANCE);
                    emitter.onComplete();
                    drawer.removeDrawerListener(this);
                }
            }
        };
        drawer.addDrawerListener(listener);
    });
}
 
开发者ID:xcc3641,项目名称:SeeWeather,代码行数:17,代码来源:RxDrawer.java

示例2: registerListener

import android.support.v4.widget.DrawerLayout.DrawerListener; //导入依赖的package包/类
/**
 * Returns a {@link ViewAction} that adds an {@link IdlingDrawerListener} as a drawer listener to
 * the {@link DrawerLayout}. The idling drawer listener wraps any listener that already exists.
 */
private static ViewAction registerListener() {
  return new ViewAction() {
    @Override
    public Matcher<View> getConstraints() {
      return isAssignableFrom(DrawerLayout.class);
    }

    @Override
    public String getDescription() {
      return "register idling drawer listener";
    }

    @Override
    public void perform(UiController uiController, View view) {
      DrawerLayout drawer = (DrawerLayout) view;
      DrawerListener existingListener = getDrawerListener(drawer);
      if (existingListener instanceof IdlingDrawerListener) {
        // listener is already registered. No need to assign.
        return;
      }
      drawer.setDrawerListener(IdlingDrawerListener.getInstance(existingListener));
    }
  };
}
 
开发者ID:DocuSignDev,项目名称:android-test-kit,代码行数:29,代码来源:DrawerActions.java

示例3: getInstance

import android.support.v4.widget.DrawerLayout.DrawerListener; //导入依赖的package包/类
private static IdlingDrawerListener getInstance(DrawerListener parentListener) {
  if (instance == null) {
    instance = new IdlingDrawerListener();
    Espresso.registerIdlingResources(instance);
  }
  instance.setParentListener(parentListener);
  return instance;
}
 
开发者ID:DocuSignDev,项目名称:android-test-kit,代码行数:9,代码来源:DrawerActions.java

示例4: setDrawerListener

import android.support.v4.widget.DrawerLayout.DrawerListener; //导入依赖的package包/类
public void setDrawerListener(DrawerListener drawerListener, boolean oneTimeListener) {
	this.drawerListener = drawerListener;
	this.oneTimeListener = oneTimeListener; 
}
 
开发者ID:ZalemSoftware,项目名称:Ymir,代码行数:5,代码来源:PerspectiveActivity.java

示例5: setDrawerListener

import android.support.v4.widget.DrawerLayout.DrawerListener; //导入依赖的package包/类
public final void setDrawerListener(DrawerLayout.DrawerListener paramDrawerListener)
{
  this.mDrawerListener = paramDrawerListener;
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:5,代码来源:PlayDrawerLayout.java

示例6: setParentListener

import android.support.v4.widget.DrawerLayout.DrawerListener; //导入依赖的package包/类
public void setParentListener(@Nullable DrawerListener parentListener) {
  this.parentListener = parentListener;
}
 
开发者ID:DocuSignDev,项目名称:android-test-kit,代码行数:4,代码来源:DrawerActions.java


注:本文中的android.support.v4.widget.DrawerLayout.DrawerListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。