當前位置: 首頁>>代碼示例>>Java>>正文


Java SystemBarTintManager.setNavigationBarTintEnabled方法代碼示例

本文整理匯總了Java中com.readystatesoftware.systembartint.SystemBarTintManager.setNavigationBarTintEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java SystemBarTintManager.setNavigationBarTintEnabled方法的具體用法?Java SystemBarTintManager.setNavigationBarTintEnabled怎麽用?Java SystemBarTintManager.setNavigationBarTintEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.readystatesoftware.systembartint.SystemBarTintManager的用法示例。


在下文中一共展示了SystemBarTintManager.setNavigationBarTintEnabled方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setTranslucentStatus

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@TargetApi(19)
private void setTranslucentStatus(boolean on) {

    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;
        if (on) {
            winParams.flags |= bits;
        } else {
            winParams.flags &= ~bits;
        }
        win.setAttributes(winParams);
    }
    SystemBarTintManager tintManager = new SystemBarTintManager(this);
    tintManager.setStatusBarTintColor(getResources().getColor(R.color.colorPrimary));
    tintManager.setStatusBarTintEnabled(true);
    tintManager.setNavigationBarTintEnabled(false);
}
 
開發者ID:huyongli,項目名稱:TigerVideo,代碼行數:20,代碼來源:MainActivity.java

示例2: initWindowFlags

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
/**
 * 初始化界麵的屬性
 */
private void initWindowFlags() {
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {

        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);

        ActivityComponent activityComponent = getActivityComponent();
        SystemBarTintManager systemBarTintManager = activityComponent.getSystemBarTintManager();
        systemBarTintManager.setNavigationBarTintEnabled(true);
        systemBarTintManager.setStatusBarTintEnabled(true);

        final int color = getResources().getColor(R.color.colorSplash);
        systemBarTintManager.setStatusBarTintColor(color);
        systemBarTintManager.setNavigationBarTintColor(color);
    }
}
 
開發者ID:ChanJLee,項目名稱:YunShuWeather,代碼行數:21,代碼來源:SplashActivity.java

示例3: setStatusBarTranslate

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
public static void setStatusBarTranslate(AppCompatActivity mActivity, int resId){

        SystemBarTintManager tintManager = new SystemBarTintManager(mActivity);
        if (resId== R.color.transparent){
            // enable status bar tint
            tintManager.setStatusBarTintEnabled(false);
            // enable navigation bar tint
            tintManager.setNavigationBarTintEnabled(false);
            //noinspection deprecation
        }else {
            // enable status bar tint
            tintManager.setStatusBarTintEnabled(true);
            // enable navigation bar tint
            tintManager.setNavigationBarTintEnabled(true);
            // enable navigation bar tint
        }
        tintManager.setStatusBarTintColor(mActivity.getResources().getColor(resId));

    }
 
開發者ID:a371166028,項目名稱:likequanmintv,代碼行數:20,代碼來源:SystemBarUtils.java

示例4: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

//        mNewsItemBiz = new NewsItemBiz(this);

        //使用tintManager設置狀態欄的顏色
        mTintManager= new SystemBarTintManager(this);
        // enable status bar tint
        //mTintManager.setStatusBarTintEnabled(true);
        if (isNavBarTransparent()) {
            mTintManager.setStatusBarTintEnabled(true);
            // 有虛擬按鍵時
            if (isHasNavigationBar()) {
                mTintManager.setNavigationBarTintEnabled(true);
            }else{
                mTintManager.setNavigationBarTintEnabled(false);
            }
        }

        // set a custom tint color for all system bars
        mTintManager.setTintColor(getResources().getColor(R.color.dark_primary_color));

//        SystemBarTintManager.SystemBarConfig config = tintManager.getConfig();
    }
 
開發者ID:nickalc,項目名稱:csdn-master,代碼行數:26,代碼來源:BaseActivity.java

示例5: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_three);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        //透明狀態欄
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        //透明導航欄
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        SystemBarTintManager tintManager = new SystemBarTintManager(this);
        // 激活狀態欄
        tintManager.setStatusBarTintEnabled(true);
        // enable navigation bar tint 激活導航欄
        tintManager.setNavigationBarTintEnabled(true);
        //設置係統欄設置顏色
        //tintManager.setTintColor(R.color.red);
        //給狀態欄設置顏色
        tintManager.setStatusBarTintResource(R.color.mask_tags_1);
        //Apply the specified drawable or color resource to the system navigation bar.
        //給導航欄設置資源
        tintManager.setNavigationBarTintResource(R.color.mask_tags_1);
    }
}
 
開發者ID:wuyinlei,項目名稱:ImmersiveStatusBar,代碼行數:24,代碼來源:ThreeActivity.java

示例6: setTranslucentStatus

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@TargetApi(19)
public void setTranslucentStatus(Activity activity, boolean on) {
    if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) {
        Window win = activity.getWindow();
        WindowManager.LayoutParams winParams = win.getAttributes();
        final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
        if (on) {
            winParams.flags |= bits;
        } else {
            winParams.flags &= ~bits;
        }
        win.setAttributes(winParams);

        SystemBarTintManager tintManager = new SystemBarTintManager(activity);
        tintManager.setStatusBarTintEnabled(true);
        tintManager.setNavigationBarTintEnabled(false);
        tintManager.setStatusBarTintColor(activity.getResources().getColor(R.color.colorPrimary));
        //tintManager.setNavigationBarTintColor(activity.getResources().getColor(R.color.colorPrimary));
        //			tintManager.setStatusBarTintResource(R.color.colorPrimary);
    }
}
 
開發者ID:captain-miao,項目名稱:bleYan,代碼行數:22,代碼來源:HomeActivity.java

示例7: setTranslucentStatus

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@TargetApi(19)
	public void setTranslucentStatus(Activity activity, boolean on) {
		if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) {
			Window win = activity.getWindow();
			WindowManager.LayoutParams winParams = win.getAttributes();
			final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
			if (on) {
				winParams.flags |= bits;
			} else {
				winParams.flags &= ~bits;
			}
			win.setAttributes(winParams);

			SystemBarTintManager tintManager = new SystemBarTintManager(activity);
			tintManager.setStatusBarTintEnabled(true);
			tintManager.setNavigationBarTintEnabled(false);
			tintManager.setStatusBarTintColor(activity.getResources().getColor(R.color.colorPrimary));
			//tintManager.setNavigationBarTintColor(activity.getResources().getColor(R.color.colorPrimary));
//			tintManager.setStatusBarTintResource(R.color.colorPrimary);
		}
	}
 
開發者ID:captain-miao,項目名稱:bleYan,代碼行數:22,代碼來源:BaseActivity.java

示例8: setBarColor

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
public void setBarColor(int color) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);


        getWindow().setStatusBarColor(color);
    }

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
                WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,
                WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        SystemBarTintManager tintManager = new SystemBarTintManager(this);
        tintManager.setTintColor(color);
        tintManager.setStatusBarTintEnabled(true);

        tintManager.setNavigationBarTintEnabled(true);

    }

}
 
開發者ID:okrt,項目名稱:FastMusic,代碼行數:23,代碼來源:NowPlayingActivity.java

示例9: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Timber.i("onCreate");
    AVAnalytics.trackAppOpened(getIntent());
    setContentView(provideContentViewId());
    ButterKnife.inject(this);
    if(toolbar!=null){
        setSupportActionBar(toolbar);
    }
    if(!TextUtils.isEmpty(NavUtils.getParentActivityName(this))){
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    }
    if(Build.VERSION.SDK_INT <= 19){
        tintManager = new SystemBarTintManager(this);
        tintManager.setStatusBarTintEnabled(true);
        tintManager.setNavigationBarTintEnabled(true);
        tintManager.setStatusBarTintColor(getResources().getColor(R.color.primary_dark));
    }
}
 
開發者ID:linroid,項目名稱:Sky31Radio,代碼行數:21,代碼來源:BaseActivity.java

示例10: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	
	// to make the statusbar tinted in API 19 or above, won't make any
	// difference in other devices
	SystemBarTintManager tintManager = new SystemBarTintManager(this);
	// enable status bar tint
	tintManager.setStatusBarTintEnabled(true);
	// enable navigation bar tint
	tintManager.setNavigationBarTintEnabled(true);
	tintManager.setTintColor(Color.parseColor("#00796b"));

	// Display the fragment as the main content.
	getFragmentManager().beginTransaction()
			.replace(android.R.id.content, new PrefFragment()).commit();
	getActionBar().setDisplayHomeAsUpEnabled(true);
}
 
開發者ID:MainMethod1,項目名稱:TrailMix-for-peel-android,代碼行數:19,代碼來源:PrefActivity.java

示例11: onPostCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
protected void onPostCreate(Bundle savedInstanceState) {
	// TODO Auto-generated method stub
	super.onPostCreate(savedInstanceState);
	if ( mImmersionEnable &&
			android.os.Build.VERSION.SDK_INT > 18) {
		Window window = getWindow();
		window.setFlags(
				WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
				WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
		window.setFlags(
				WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, 
				WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
		SystemBarTintManager tintManager = new SystemBarTintManager(this);
		tintManager.setNavigationBarTintEnabled(true);
		tintManager.setStatusBarTintEnabled(true);
		tintManager.setTintColor(Color.parseColor("#ff009688"));
		SystemBarConfig systemBarConfig = tintManager.getConfig();
		findViewById(R.id.about_listview).setPadding(
				0, systemBarConfig.getPixelInsetTop(getActionBar().isShowing()), 
				0, systemBarConfig.getPixelInsetBottom());
	} else {
		mImmersionEnable = false;
	}
}
 
開發者ID:SharerMax,項目名稱:MWord,代碼行數:26,代碼來源:AboutActivity.java

示例12: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_search);

  toolbar = (Toolbar) findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);

  ButterKnife.inject(this);

  if (SharePref.getInstance(this).isFirstTime()) {
    chooseFont();
    SharePref.getInstance(this).noLongerFirstTime();
  }

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    Log.d("Build Version", Build.VERSION.SDK_INT + "");
    SystemBarTintManager tintManager = new SystemBarTintManager(this);
    tintManager.setStatusBarTintEnabled(true);
    tintManager.setNavigationBarTintEnabled(false);
    tintManager.setStatusBarTintColor(getResources().getColor(R.color.colorPrimaryDark));
  }
}
 
開發者ID:PoePoeMyintSwe,項目名稱:Abidan,代碼行數:24,代碼來源:SearchActivity.java

示例13: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getActionBar().setIcon(R.drawable.logo_trans);
    getActionBar().setDisplayHomeAsUpEnabled(true);
    String token = FoursquareAccount.getInstance().getToken(this);
    if(token == null || token.equals("")){
        startActivity(new Intent(this, LoginActivity_.class));
        finish();
    }else{
        api.setoAuthToken(token);
    }



    // create our manager instance after the content view is set
    SystemBarTintManager tintManager = new SystemBarTintManager(this);
    // enable status bar tint
    tintManager.setStatusBarTintEnabled(true);
    // enable navigation bar tint
    tintManager.setNavigationBarTintEnabled(true);
    // set a custom tint color for all system bars
    tintManager.setTintColor(getResources().getColor(R.color.blue));
}
 
開發者ID:qbraet,項目名稱:Check-Me-In,代碼行數:25,代碼來源:BaseActivity.java

示例14: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.translucent_layout);
    tv=(TextView)this.findViewById(R.id.tv);
    int mode=getIntent().getIntExtra("mode",0);
    Log.d(TAG,"MODE:"+mode);
    //當係統版本為4.4或者4.4以上時可以使用沉浸式狀態欄
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        //透明狀態欄
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        //透明導航欄
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        if (mode == 0) {
             LinearLayout linear_bar=(LinearLayout)findViewById(R.id.linear_bar);
             linear_bar.setVisibility(View.VISIBLE);
             int statusHeight=getStatusBarHeight();
             android.widget.LinearLayout.LayoutParams params=(android.widget.LinearLayout.LayoutParams )linear_bar.getLayoutParams();
             params.height=statusHeight;
             linear_bar.setLayoutParams(params);
             tv.setText("係統方法沉浸式實現");
        } else if (mode == 1) {
            // create our manager instance after the content view is set
            SystemBarTintManager tintManager = new SystemBarTintManager(this);
            // 激活狀態欄
            tintManager.setStatusBarTintEnabled(true);
            // enable navigation bar tint 激活導航欄
            tintManager.setNavigationBarTintEnabled(true);
            //設置係統欄設置顏色
            //tintManager.setTintColor(R.color.red);
            //給狀態欄設置顏色
            tintManager.setStatusBarTintResource(R.color.middle_red);
            // 設置導航欄設置資源
            tintManager.setNavigationBarTintResource(R.color.color_nav);
            tv.setText("第三方庫沉浸式實現");
        }
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:39,代碼來源:TranslucentActivity.java

示例15: setupAppBar

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
/**
 * Sets up a top-padding for the given app bar equal to the height of the status bar.
 * This increases the length of the app bar so it fits nicely below the status bar.
 * This method also sets the status bar transparency.
 *
 * @param appBar   Toolbar to set padding to
 * @param activity Activity - current activity
 */
public static void setupAppBar(Toolbar appBar, Activity activity) {
    appBar.setPadding(0, getStatusBarHeight(activity.getResources()), 0, 0);

    SystemBarTintManager tintManager = new SystemBarTintManager(activity);
    tintManager.setStatusBarTintEnabled(true);
    tintManager.setNavigationBarTintEnabled(true);
    tintManager.setTintColor(Color.parseColor("#10000000"));
}
 
開發者ID:digital-voting-pass,項目名稱:polling-station-app,代碼行數:17,代碼來源:Util.java


注:本文中的com.readystatesoftware.systembartint.SystemBarTintManager.setNavigationBarTintEnabled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。