Пример #1
0
  public static void setStatusBar(Activity activity) {
    if (true) return;

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      activity.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
      Window window = activity.getWindow();
      window.clearFlags(
          WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
              | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
      window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); // |
      // View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
      window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
      //            window.setStatusBarColor(Utils.resolveColor(activity,
      // R.attr.theme_statusbar_color, Color.BLUE));
      window.setStatusBarColor(Color.parseColor("#20000000"));
      window.setNavigationBarColor(
          activity
              .getResources()
              .getColor(ThemeUtils.themeColorArr[AppSettings.getThemeColor()][1]));
      //            window.setNavigationBarColor(Utils.resolveColor(activity, R.attr.theme_color,
      // Color.BLUE));

      //            Window window = activity.getWindow();
      //            window.requestFeature(Window.FEATURE_NO_TITLE);
      //            window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
      //                    | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
      //
      // window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
      //                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
      //                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
      //            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
      //            window.setStatusBarColor(Color.TRANSPARENT);
      //            window.setNavigationBarColor(Utils.resolveColor(activity,
      // R.attr.theme_statusbar_color, Color.TRANSPARENT));
    }
  }
Пример #2
0
 @Override
 protected int configTheme() {
   return ThemeUtils.themeArr[AppSettings.getThemeColor()][1];
 }