private void setupTint() {
   SystemBarTintManager tintManager = new SystemBarTintManager(this);
   tintManager.setStatusBarTintEnabled(true);
   tintManager.setStatusBarTintColor(getResources().getColor(R.color.red));
   tintManager.setNavigationBarTintEnabled(true);
   tintManager.setNavigationBarTintColor(getResources().getColor(R.color.red));
 }
Esempio n. 2
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.activity_messboard);
    // 设置状态栏
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
      Window win = getWindow();
      WindowManager.LayoutParams winParams = win.getAttributes();
      final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
      winParams.flags |= bits;
      win.setAttributes(winParams);
    }
    mTintManager = new SystemBarTintManager(this);
    mTintManager.setStatusBarTintEnabled(true);
    mTintManager.setNavigationBarTintEnabled(true);
    mTintManager.setTintColor(this.getResources().getColor(R.color.basecolor));

    initView();
    loadMess();
    initLocation();
  }