android.support.v4.widget.DrawerLayout.post()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(148)

本文整理了Java中android.support.v4.widget.DrawerLayout.post()方法的一些代码示例,展示了DrawerLayout.post()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DrawerLayout.post()方法的具体详情如下:
包路径:android.support.v4.widget.DrawerLayout
类名称:DrawerLayout
方法名:post

DrawerLayout.post介绍

暂无

代码示例

代码示例来源:origin: eclipse/paho.mqtt.android

public void setUp(int fragmentId, DrawerLayout drawerLayout, final Toolbar toolbar) {
  containerView = getActivity().findViewById(fragmentId);
  mDrawerLayout = drawerLayout;
  mDrawerToggle = new ActionBarDrawerToggle(getActivity(), drawerLayout, toolbar, R.string.drawer_open, R.string.drawer_close) {
    @Override
    public void onDrawerOpened(View drawerView) {
      super.onDrawerOpened(drawerView);
      getActivity().invalidateOptionsMenu();
    }
    @Override
    public void onDrawerClosed(View drawerView) {
      super.onDrawerClosed(drawerView);
      getActivity().invalidateOptionsMenu();
    }
    @Override
    public void onDrawerSlide(View drawerView, float slideOffset) {
      super.onDrawerSlide(drawerView, slideOffset);
      toolbar.setAlpha(1 - slideOffset / 2);
    }
  };
  mDrawerLayout.setDrawerListener(mDrawerToggle);
  mDrawerLayout.post(new Runnable() {
    @Override
    public void run() {
      mDrawerToggle.syncState();
    }
  });
}

代码示例来源:origin: xbmc/Kore

private void saveUserLearnedDrawer() {
  if (!mUserLearnedDrawer) {
    mUserLearnedDrawer = true;
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getActivity());
    sp.edit().putBoolean(PREF_USER_LEARNED_DRAWER, true).apply();
    // Sync the drawer toggle on the first run
    mDrawerLayout.post(new Runnable() {
      @Override
      public void run() {
        mDrawerToggle.syncState();
      }
    });
  }
}

代码示例来源:origin: hefuyicoder/ZhihuDaily

private void setUpDrawer() {
  mNavigationFragment = (NavigationFragment) getSupportFragmentManager().findFragmentById(R.id.navigation_drawer);
  mTitle = getTitle();
  mDrawerToggle = new ActionBarDrawerToggle(this, drawerLayout, mToolbar,
      R.string.navigation_drawer_open, R.string.navigation_drawer_close) {
    @Override
    public void onDrawerClosed(View drawerView) {
      super.onDrawerClosed(drawerView);
      supportInvalidateOptionsMenu();
    }
    @Override
    public void onDrawerOpened(View drawerView) {
      super.onDrawerOpened(drawerView);
      supportInvalidateOptionsMenu();
    }
  };
  drawerLayout.post(new Runnable() {
    @Override
    public void run() {
      mDrawerToggle.syncState();
    }
  });
  drawerLayout.addDrawerListener(mDrawerToggle);
}

代码示例来源:origin: stackoverflow.com

mDrawerLayout.post(new Runnable(){

代码示例来源:origin: xiangzhihong/zhihu

mDrawerLayout.openDrawer(mFragmentContainerView);
mDrawerLayout.post(new Runnable() {
  @Override
  public void run() {

代码示例来源:origin: marcoRS/rxjava-essentials

mDrawerLayout.post(new Runnable() {
 @Override public void run() {
  mActionBarDrawerToggle.syncState();

代码示例来源:origin: yoinx/kernel_adiutor

/**
 * Setup the views
 */
private void setInterface() {
  if (mScrimInsetsFrameLayout != null) {
    mScrimInsetsFrameLayout.setLayoutParams(getDrawerParams());
    if (Utils.DARKTHEME)
      mScrimInsetsFrameLayout.setBackgroundColor(getResources().getColor(R.color.navigationdrawer_background_dark));
  }
  setItems(null);
  if (mDrawerLayout != null) {
    mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, toolbar, 0, 0);
    mDrawerLayout.setDrawerListener(mDrawerToggle);
    mDrawerLayout.post(new Runnable() {
      @Override
      public void run() {
        if (mDrawerToggle != null) mDrawerToggle.syncState();
      }
    });
  }
}

代码示例来源:origin: rajeeviiit/AndroidProject

mDrawerLayout.post(new Runnable() {
  @Override
  public void run() {

代码示例来源:origin: PhilippeBoisney/SimpleDroidRx

public void setUp(int fragmentId, DrawerLayout drawerLayout, final Toolbar toolbar) {
  containerView = getActivity().findViewById(fragmentId);
  mDrawerLayout = drawerLayout;
  mDrawerToggle = new ActionBarDrawerToggle(getActivity(), drawerLayout, toolbar, R.string.drawer_open, R.string.drawer_close) {
    @Override
    public void onDrawerOpened(View drawerView) {
      super.onDrawerOpened(drawerView);
      getActivity().invalidateOptionsMenu();
    }
    @Override
    public void onDrawerClosed(View drawerView) {
      super.onDrawerClosed(drawerView);
      getActivity().invalidateOptionsMenu();
    }
    @Override
    public void onDrawerSlide(View drawerView, float slideOffset) {
      super.onDrawerSlide(drawerView, slideOffset);
      toolbar.setAlpha(1 - slideOffset / 2);
    }
  };
  mDrawerLayout.setDrawerListener(mDrawerToggle);
  mDrawerLayout.post(new Runnable() {
    @Override
    public void run() {
      mDrawerToggle.syncState();
    }
  });
}

代码示例来源:origin: xbmc/Kore

mDrawerLayout.post(new Runnable() {
  @Override
  public void run() {

代码示例来源:origin: first087/Android-License-Fragment

mDrawerLayout.post(new Runnable() {
  @Override
  public void run() {

代码示例来源:origin: vipulyaara/betterHotels

mDrawerLayout.post(new Runnable() {
  @Override
  public void run() {

代码示例来源:origin: geeksonsecurity/android-overlay-protection

mDrawerLayout.post(new Runnable() {
  @Override
  public void run() {

代码示例来源:origin: fmgarcia27/AndroidstudioProjects

mDrawerLayout.post(new Runnable() {
  @Override
  public void run() {

代码示例来源:origin: AppLozic/Applozic-Android-SDK

mDrawerLayout.post(new Runnable() {
  @Override
  public void run() {

代码示例来源:origin: square1-io/rich-text-android

mDrawerLayout.post(new Runnable() {
  @Override
  public void run() {

代码示例来源:origin: googolmo/OkVolley

mDrawerLayout.post(new Runnable() {
  @Override
  public void run() {

代码示例来源:origin: Coinomi/coinomi-android

mDrawerLayout.post(new Runnable() {
  @Override
  public void run() {

代码示例来源:origin: openwalletGH/openwallet-android

mDrawerLayout.post(new Runnable() {
  @Override
  public void run() {

代码示例来源:origin: lime-ime/limeime

mDrawerLayout.post(new Runnable() {
  @Override
  public void run() {

相关文章