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

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

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

DrawerLayout.setStatusBarBackgroundColor介绍

[英]Set a drawable to draw in the insets area for the status bar. Note that this will only be activated if this DrawerLayout fitsSystemWindows.
[中]在状态栏的插入区域中设置可绘制的。请注意,仅当抽屉布局适合系统窗口时,此选项才会激活。

代码示例

代码示例来源:origin: HotBitmapGG/bilibili-android-client

window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
drawerLayout.setStatusBarBackgroundColor(statusBarColor);
int systemUiVisibility = window.getDecorView().getSystemUiVisibility();
systemUiVisibility |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;

代码示例来源:origin: naman14/Timber

((DrawerLayout) ((ViewGroup) activity.findViewById(android.R.id.content)).getChildAt(0)).setStatusBarBackgroundColor(getStatusBarColor(color));
} catch (Exception e) {
  e.printStackTrace();

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

mDrawerLayout.setStatusBarBackgroundColor(
    getResources().getColor(R.color.myPrimaryDarkColor));

代码示例来源:origin: materialos/android-icon-pack

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  super.onActivityResult(requestCode, resultCode, data);
  if (requestCode == RQ_CROPANDSETWALLPAPER) {
    WallpapersFragment.showToast(this, R.string.wallpaper_set);
    WallpaperUtils.resetOptionCache(true);
  } else if (requestCode == RQ_VIEWWALLPAPER) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && mDrawer != null) {
      getWindow().setStatusBarColor(Color.TRANSPARENT);
      mDrawer.setStatusBarBackgroundColor(DialogUtils.resolveColor(this, R.attr.colorPrimaryDark));
    }
  }
}

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

public void setup(int fragmentId, DrawerLayout drawerLayout, Toolbar toolbar) {
 mFragmentContainerView = getActivity().findViewById(fragmentId);
 mDrawerLayout = drawerLayout;
 mDrawerLayout.setStatusBarBackgroundColor(getResources().getColor(R.color.myPrimaryDarkColor));

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

mDrawerLayout.setStatusBarBackgroundColor(getResources().getColor(R.color.primaryDark));

代码示例来源:origin: doc-rj/smartcard-reader

drawerLayout.setStatusBarBackgroundColor(activity.getResources().getColor(R.color.primary));
mParentItem = drawerLayout.findViewById(resId);
mParentItem.setActivated(true);

代码示例来源:origin: HotBitmapGG/LeisureRead

window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
drawerLayout.setStatusBarBackgroundColor(statusBarColor);

代码示例来源:origin: fodroid/XStatusBarHelper

window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
drawerLayout.setStatusBarBackgroundColor(statusBarColor);

代码示例来源:origin: WeDevelopTeam/HeroVideo-master

window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
drawerLayout.setStatusBarBackgroundColor(statusBarColor);

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

/**
 * Define all views
 */
private void setView() {
  mScrimInsetsFrameLayout = (ScrimInsetsFrameLayout) findViewById(R.id.scrimInsetsFrameLayout);
  mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
  if (mDrawerLayout != null) {
    mDrawerLayout.setStatusBarBackgroundColor(getResources().getColor(R.color.statusbar_color));
    mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
  }
  mDrawerList = (RecyclerView) findViewById(R.id.drawer_list);
  mSplashView = (SplashView) findViewById(R.id.splash_view);
  LinearLayoutManager mLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
  mLayoutManager.setSmoothScrollbarEnabled(true);
  mDrawerList.setLayoutManager(mLayoutManager);
  mDrawerList.setHasFixedSize(true);
  mDrawerList.setAdapter(new RecyclerView.Adapter() {
    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      return null;
    }
    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    }
    @Override
    public int getItemCount() {
      return 0;
    }
  });
}

代码示例来源:origin: brainysoon/cyberCar

((DrawerLayout) ((ViewGroup) activity.findViewById(android.R.id.content)).getChildAt(0)).setStatusBarBackgroundColor(getStatusBarColor(color));
} catch (Exception e) {
  e.printStackTrace();

代码示例来源:origin: student9128/BottomNavigationBarForAndroid

mDrawerToggle.setDrawerIndicatorEnabled(true);
mDrawerLayout.setDrawerListener(mDrawerToggle);
mDrawerLayout.setStatusBarBackgroundColor(ContextCompat.getColor(this, R.color.colorPrimaryDark));

代码示例来源:origin: xuancao/DynamicSkin

((DrawerLayout) rootView).setStatusBarBackgroundColor(Config.statusBarColor(activity, key));

代码示例来源:origin: materialos/android-icon-pack

mDrawer.setStatusBarBackgroundColor(DialogUtils.resolveColor(this, R.attr.colorPrimaryDark));
mNavView.setNavigationItemSelectedListener(this);

代码示例来源:origin: trezor/trezor-android

drawerLayout.setStatusBarBackgroundColor(activity.getResources().getColor(R.color.primary_dark));
drawerContent.setOnInsetsCallback(new OnInsetsCallback() {
  @Override

代码示例来源:origin: heinrichreimer/material-drawer

drawerLayout.setStatusBarBackgroundColor(ContextCompat.getColor(this, R.color.color_primary_dark));
drawerLayout.addDrawerListener(drawerToggle);
drawerLayout.closeDrawer(drawer);

相关文章