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


Java SystemBarTintManager.setTintColor方法代碼示例

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


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

示例1: 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

示例2: 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

示例3: onCreate

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

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        SystemBarTintManager manager = new SystemBarTintManager(this);
        manager.setStatusBarTintEnabled(true);
        int color = getResources().getColor(R.color.gpcard_image_bg_green);
        manager.setTintColor(color);
    }

    ActionBar actionBar = getActionBar();
    actionBar.setTitle(null);
    actionBar.setDisplayHomeAsUpEnabled(true);

    fragment = (WebViewFragment) getSupportFragmentManager().findFragmentById(R.id.webview_fragment);
}
 
開發者ID:mthli,項目名稱:Geeky,代碼行數:19,代碼來源:WebViewActivity.java

示例4: onCreate

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

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        SystemBarTintManager manager = new SystemBarTintManager(this);
        manager.setStatusBarTintEnabled(true);
        int color = getResources().getColor(R.color.gpcard_image_bg_green);
        manager.setTintColor(color);
    }

    requests = Volley.newRequestQueue(this);

    getHomePage();
}
 
開發者ID:mthli,項目名稱:Geeky,代碼行數:17,代碼來源:InitActivity.java

示例5: configureActionbar

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
private void configureActionbar(){
    ActionBar bar = getActionBar();
    bar.setHomeButtonEnabled(true);
    bar.setDisplayShowHomeEnabled(false);

    tint = new SystemBarTintManager(this);
    TypedValue tintColor = new TypedValue();
    if(getTheme().resolveAttribute(R.attr.statusBarBackground, tintColor, true)){
        tint.setStatusBarTintEnabled(true);
        tint.setTintColor(tintColor.data);
        defaultActionbarColor = tintColor.data;
        currentActionbarColor = tintColor.data;
    }else{
        tint.setStatusBarTintEnabled(false);
    }

    TypedValue actionbarBackground = new TypedValue();
    if(getTheme().resolveAttribute(R.attr.actionbarBackgroundLayerList, actionbarBackground, false)){
        actionbarBackgroundList = (LayerDrawable) getResources().getDrawable(actionbarBackground.data);
        actionbarBackgroundList.mutate();
        actionbarColor = (ColorDrawable) actionbarBackgroundList.findDrawableByLayerId(R.id.actionbar_background_color);
        actionbarColor.mutate();
        bar.setBackgroundDrawable(actionbarBackgroundList);
    }

}
 
開發者ID:2fast2fourier,項目名稱:something.apk,代碼行數:27,代碼來源:SomeActivity.java

示例6: 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

示例7: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_edit_environment);
    if (savedInstanceState == null) {
        placeholderFragment = new PlaceholderFragment();
        getFragmentManager().beginTransaction()
                .add(R.id.container, placeholderFragment)
                .commit();
    }
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
        int flags = getWindow().getAttributes().flags | WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
        getWindow().setFlags(flags,flags);
        SystemBarTintManager tintManager = new SystemBarTintManager(this);
        tintManager.setStatusBarTintEnabled(true);
        tintManager.setTintColor(getResources().getColor(R.color.action_bar_edit_environment));
    }
}
 
開發者ID:aravindsagar,項目名稱:SmartLockScreen,代碼行數:19,代碼來源:EditEnvironment.java

示例8: setUpActionBar

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
private void setUpActionBar(){
    ActionBar actionBar = getSupportActionBar();
    actionBarColor = getResources().getColor(R.color.action_bar_settings);
    if(!Utility.checkForNullAndWarn(actionBar, LOG_TAG)){
        actionBar.setBackgroundDrawable(new ColorDrawable(actionBarColor));
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setHomeButtonEnabled(true);
    }
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,
                WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
    }

    tintManager = new SystemBarTintManager(this);
    tintManager.setStatusBarTintEnabled(true);
    tintManager.setTintColor(actionBarColor);
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        mPaddingTop = tintManager.getConfig().getPixelInsetTop(true);
        if(Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT){
            mPaddingTop += 16;
        }
        mPaddingBottom = tintManager.getConfig().getNavigationBarHeight();
    }
}
 
開發者ID:aravindsagar,項目名稱:SmartLockScreen,代碼行數:25,代碼來源:SmartLockScreenSettings.java

示例9: onCreate

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

    //Intent
    intent = getIntent();
    //Init
    setUpActionBar();
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,
                WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);

        SystemBarTintManager tintManager = new SystemBarTintManager(this);
        tintManager.setStatusBarTintEnabled(true);
        tintManager.setTintColor(getResources().getColor(R.color.action_bar_location));
        paddingBottom = tintManager.getConfig().getNavigationBarHeight();
        paddingTop = tintManager.getConfig().getPixelInsetTop(true);
        if(Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT){
            paddingTop += 16;
        }
    }
    setUpGoogleMap();
}
 
開發者ID:aravindsagar,項目名稱:SmartLockScreen,代碼行數:25,代碼來源:SelectLocation.java

示例10: onCreate

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

    mSetMasterPasswordFragment = new SetMasterPasswordFragment();
    if (savedInstanceState == null) {
        getFragmentManager().beginTransaction()
                .add(R.id.container, mSetMasterPasswordFragment)
                .commit();
    }

    ActionBar actionBar = getSupportActionBar();
    if(!Utility.checkForNullAndWarn(actionBar, LOG_TAG)) {
        actionBar.setBackgroundDrawable(new ColorDrawable(
                getResources().getColor(R.color.action_bar_setup)));
    }
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,
                WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);

        SystemBarTintManager tintManager = new SystemBarTintManager(this);
        tintManager.setStatusBarTintEnabled(true);
        tintManager.setTintColor(getResources().getColor(R.color.action_bar_setup));
    }
}
 
開發者ID:aravindsagar,項目名稱:SmartLockScreen,代碼行數:27,代碼來源:SetMasterPassword.java

示例11: onCreate

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

    setContentView(R.layout.activity_add_environment);
    if (savedInstanceState == null) {
        placeholderFragment = new PlaceholderFragment();
        getFragmentManager().beginTransaction()
                .add(R.id.container, placeholderFragment)
                .commit();
    }
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
        int flags = getWindow().getAttributes().flags | WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
        getWindow().setFlags(flags,flags);
        SystemBarTintManager tintManager = new SystemBarTintManager(this);
        tintManager.setStatusBarTintEnabled(true);
        tintManager.setTintColor(getResources().getColor(R.color.action_bar_add_environment));
    }
}
 
開發者ID:aravindsagar,項目名稱:SmartLockScreen,代碼行數:20,代碼來源:AddEnvironment.java

示例12: 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

示例13: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    int color = getResources().getColor(R.color.action_bar_red);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        SystemBarTintManager tintManager = new SystemBarTintManager(this);
        tintManager.setStatusBarTintEnabled(true);
        tintManager.setTintColor(color);
    }

    getSupportActionBar().setBackgroundDrawable(new ColorDrawable(color));
    Drawable icon = getResources().getDrawable(R.drawable.ic_launcher);
    icon.setColorFilter(Color.WHITE, PorterDuff.Mode.SRC_ATOP);
    getSupportActionBar().setIcon(icon);

}
 
開發者ID:GabrielCastro,項目名稱:fanshawe-connect,代碼行數:17,代碼來源:BaseActivity.java

示例14: 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

示例15: tintBars

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
private void tintBars(){
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        setTranslucentStatusAndNavigationBar();
    }
    tintManager = new SystemBarTintManager(this);
    tintManager.setStatusBarTintEnabled(true);
    tintManager.setNavigationBarTintEnabled(true);
    tintManager.setTintColor(ThemeUtil.getPrimaryColor(this));
}
 
開發者ID:adrielcafe,項目名稱:NMSAlphabetAndroidApp,代碼行數:10,代碼來源:BaseActivity.java


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