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));
 }
Beispiel #2
0
 private void setUpSystembar() {
   if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
     SystemBarTintManager tintManager = new SystemBarTintManager(this);
     tintManager.setStatusBarTintEnabled(true);
     tintManager.setStatusBarTintResource(R.color.colorPrimaryDark);
   }
 }
  /** 设置透明标题栏,子类调用此函数 */
  protected void initToolbar() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
      setTranslucentStatus(true);
    }

    SystemBarTintManager tintManager = new SystemBarTintManager(this);
    tintManager.setStatusBarTintEnabled(true);
    tintManager.setStatusBarTintResource(R.color.colorPrimary);
  }
 @Override
 public void setContentView(int layoutResID) {
   super.setContentView(layoutResID);
   SystemBarTintManager tintManager = new SystemBarTintManager(this);
   tintManager.setStatusBarTintEnabled(true);
   tintManager.setTintColor(getResources().getColor(R.color.system_press));
   initView();
   initData();
 }
 private void adjustSystemBarTintAsNeeded()
 {
   if (Build.VERSION.SDK_INT == 19)
   {
     SystemBarTintManager localSystemBarTintManager = new SystemBarTintManager(this);
     localSystemBarTintManager.setStatusBarTintEnabled(true);
     localSystemBarTintManager.setTintColor(getResources().getColor(R.color.primaryDark));
     localSystemBarTintManager.setStatusBarTintColor(getResources().getColor(R.color.primaryDark));
   }
 }
Beispiel #6
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
     setTranslucentStatus(true);
     SystemBarTintManager tintManager = new SystemBarTintManager(this);
     tintManager.setStatusBarTintEnabled(true);
     tintManager.setStatusBarTintResource(R.color.action_bar_color);
   }
   mitchDevice(brand);
 }
 /**
  * use SytemBarTintManager
  *
  * @param tintDrawable
  */
 public void setSystemBarTintDrawable(Drawable tintDrawable) {
   if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
     SystemBarTintManager mTintManager = new SystemBarTintManager(this);
     if (tintDrawable != null) {
       mTintManager.setStatusBarTintEnabled(true);
       mTintManager.setTintDrawable(tintDrawable);
     } else {
       mTintManager.setStatusBarTintEnabled(false);
       mTintManager.setTintDrawable(null);
     }
   }
 }
Beispiel #8
0
 @TargetApi(19)
 public static void setTranslucentStatusBar(Activity activity, NavigationView navigationView) {
   if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT && navigationView != null) {
     // fix 天坑 4.4 + drawerlayout + navigationView
     tianKeng(activity, activity.getResources().getColor(R.color.primary), navigationView);
   } else {
     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
       activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
       SystemBarTintManager tintManager = new SystemBarTintManager(activity);
       tintManager.setStatusBarTintEnabled(true);
       tintManager.setStatusBarTintColor(activity.getResources().getColor(R.color.primary));
     }
   }
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.detailed_info);

    telephone = "10086";

    dpview = (TextView) findViewById(R.id.Description);
    dpview.setText("������ʾ��Ҫ��Ϣ...");

    call = (Button) findViewById(R.id.Call);
    join = (Button) findViewById(R.id.Join);
    // return_back = (TextView) findViewById(R.id.Return);
    open_close = (TextView) findViewById(R.id.OpenOrClose);
    open_close.setText("�鿴���� ��");

    call.setOnClickListener(this);
    join.setOnClickListener(this);
    // return_back.setOnClickListener(this);
    open_close.setOnClickListener(this);
    // �Զ���ActionBar
    final ActionBar actionBar = getActionBar();
    actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
    actionBar.setCustomView(R.layout.actionbar_detail_info); // �Զ���ActionBar����

    // ָ��״̬����ɫ
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
      setTranslucentStatus(true);
    }
    SystemBarTintManager tintManager = new SystemBarTintManager(this);
    tintManager.setStatusBarTintEnabled(true);
    tintManager.setStatusBarTintResource(R.color.blueviolet);
    mTVBack = (Button) findViewById(R.id.detailInfo_backBtn);
    mTVBack.setOnClickListener(this);

    itemList = new ArrayList<ParticipatorItem>();
    itemList.add(new ParticipatorItem(R.drawable.ghost, "����", "�����ܼ򵥣�"));
    itemList.add(new ParticipatorItem(R.drawable.ghost, "����", "�����ܼ򵥣�"));
    itemList.add(new ParticipatorItem(R.drawable.ghost, "����", "�����ܼ򵥣�"));
    itemList.add(new ParticipatorItem(R.drawable.ghost, "����", "�����ܼ򵥣�"));
    itemList.add(new ParticipatorItem(R.drawable.ghost, "����", "�����ܼ򵥣�"));
    adapter = new Adapter(this, R.layout.participator_item, itemList);

    lv = (ListView) findViewById(R.id.participatorListView);
    lv.setAdapter(adapter);
    lv.setOnItemClickListener(this);
  }
  @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();
  }
 private void setupViews() {
   if (AndroidUtils.isKitKatOrHigher()) {
     // fix padding with translucent status bar
     // warning: status bar not always translucent (e.g. Nexus 10)
     // (using fitsSystemWindows would not work correctly with multiple views)
     mSystemBarTintManager = new SystemBarTintManager(this);
     int insetTop = mSystemBarTintManager.getConfig().getPixelInsetTop(false);
     ViewGroup actionBarToolbar = (ViewGroup) findViewById(R.id.sgToolbar);
     ViewGroup.MarginLayoutParams layoutParams =
         (ViewGroup.MarginLayoutParams) actionBarToolbar.getLayoutParams();
     layoutParams.setMargins(
         layoutParams.leftMargin,
         layoutParams.topMargin + insetTop,
         layoutParams.rightMargin,
         layoutParams.bottomMargin);
   }
 }