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


Java SystemBarTintManager.setStatusBarTintColor方法代碼示例

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


在下文中一共展示了SystemBarTintManager.setStatusBarTintColor方法的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: init

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@SuppressWarnings("deprecation")
private void init() {
    ButterKnife.bind(this);
    m_toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            finish();
        }
    });

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        SystemBarTintManager systemBarTintManager = m_aboutPresenter.getSystemBarTintManager();
        systemBarTintManager.setStatusBarTintEnabled(true);
        systemBarTintManager.setStatusBarTintColor(getResources().getColor(R.color.about));
    }
}
 
開發者ID:ChanJLee,項目名稱:YunShuWeather,代碼行數:18,代碼來源:AboutActivity.java

示例4: setTranslucentBar

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
/**
 * 設置透明狀態欄
 */
@SuppressWarnings("deprecation")
@TargetApi(19)
protected void setTranslucentBar(int color, View paddingView) {

    if (paddingView != null) {
        paddingView.setPadding(0, PhoneInfoUtils.getStatusBarHeight(this), 0, 0);
    }

    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.setStatusBarTintColor(getResources().getColor(color));
        tintManager.setStatusBarTintEnabled(true);
    }
}
 
開發者ID:maxwell-nc,項目名稱:ExhibitionCenter,代碼行數:20,代碼來源:BaseActivity.java

示例5: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
    protected void onCreate(Bundle savedInstanceState) {
        showActivityInAnim();
        super.onCreate(savedInstanceState);
        setContentView(getContentResId());
        // 經測試在代碼裏直接聲明透明狀態欄更有效
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
//            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);

            //沉浸式時,對狀態欄染色
            // create our manager instance after the content view is set
            SystemBarTintManager tintManager = new SystemBarTintManager(this);
            tintManager.setStatusBarTintColor(getStatusBarColor());
            // enable status bar tint
            tintManager.setStatusBarTintEnabled(true);
//        // enable navigation bar tint
//        tintManager.setNavigationBarTintEnabled(true);
        }

        ButterKnife.bind(this);

        if (null != getIPresenter()) {
            getIPresenter().onCreate(savedInstanceState);
        }
    }
 
開發者ID:duanze,項目名稱:Meizitu,代碼行數:27,代碼來源:BaseActivity.java

示例6: afterCreate

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

    View toolbar = findViewById(R.id.ll_root);
    toolbar.setPadding(0, PhoneInfoUtils.getStatusBarHeight(this), 0, 0);//防止遮擋
    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.setStatusBarTintColor(MethodUtils.getColor(toolbar, R.color.main_theme));
        tintManager.setStatusBarTintEnabled(true);
    }

    findViewById(R.id.iv_back).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            finish();
        }
    });

}
 
開發者ID:maxwell-nc,項目名稱:ExhibitionCenter,代碼行數:22,代碼來源:ScanActivity.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,代碼來源:HomeActivity.java

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

示例9: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) {
        // 透明狀態欄
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        // 透明導航欄
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
    }
    super.onCreate(savedInstanceState);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        setTranslucentStatus(true);
        SystemBarTintManager tintManager = new SystemBarTintManager(this);
        tintManager.setStatusBarTintEnabled(true);
        tintManager.setStatusBarTintColor(0xFF01579b);
    }
}
 
開發者ID:lookwhatlook,項目名稱:WeiboWeiBaTong,代碼行數:17,代碼來源:TranslucentStatusBarActivity.java

示例10: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	requestWindowFeature(Window.FEATURE_NO_TITLE);
	BaseApplication.getInstance().addActivity(this);
	mHelper = new SwipeBackActivityHelper(this);
	mHelper.onActivityCreate();
	Log = MyLogger.kLog();
	BookTheme.setChangeTheme(false);
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
		setTranslucentStatus();
	}
	tintManager = new SystemBarTintManager(this);
	tintManager.setStatusBarTintEnabled(true);
	tintManager.setStatusBarTintColor(BookTheme.THEME_COLOR);// 通知欄所需顏色
}
 
開發者ID:justingboy,項目名稱:CouldBooks,代碼行數:17,代碼來源:SwipeBackActivity.java

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

示例12: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
    protected void onCreate(Bundle savedInstanceState) {
        initTheme();
        super.onCreate(savedInstanceState);
        // 這句很關鍵,注意是調用父類的方法
        super.setContentView(R.layout.activity_base);
        // 經測試在代碼裏直接聲明透明狀態欄更有效
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            WindowManager.LayoutParams localLayoutParams = getWindow().getAttributes();
            localLayoutParams.flags = (WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | localLayoutParams.flags);

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

            //沉浸式時,對狀態欄染色
            // create our manager instance after the content view is set
            SystemBarTintManager tintManager = new SystemBarTintManager(this);
            tintManager.setStatusBarTintColor(getStatusBarColor());
            // enable status bar tint
            tintManager.setStatusBarTintEnabled(true);
//        // enable navigation bar tint
//        tintManager.setNavigationBarTintEnabled(true);
        }

        initToolbar();
    }
 
開發者ID:duanze,項目名稱:PureNote,代碼行數:27,代碼來源:BaseActivity.java

示例13: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    buildMockData();
    listView = (ListView) findViewById(R.id.listView);
    viewCell = new ViewCell(dataModel);
    listView.setAdapter(viewCell);
    viewCell.notifyDataSetChanged();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        setTranslucentStatus(true);
        setTranslucentNavigation(true);

    }

    SystemBarTintManager tintManager = new SystemBarTintManager(this);
    tintManager.setStatusBarTintEnabled(true);
    tintManager.setStatusBarTintColor(Color.parseColor("#00796B"));
}
 
開發者ID:cbedoy,項目名稱:EasterListView,代碼行數:21,代碼來源:MainActivity.java

示例14: onCreate

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

    mNavigationDrawerFragment = (NavigationDrawerFragment) getSupportFragmentManager().findFragmentById(R.id
            .navigation_drawer);

    mTitle = getTitle();

    mNavigationDrawerFragment.setUp(
            R.id.navigation_drawer,
            (DrawerLayout) findViewById(R.id.drawer_layout));

    SystemBarTintManager systemBarTintManager = new SystemBarTintManager(this);
    systemBarTintManager.setStatusBarTintEnabled(true);
    systemBarTintManager.setStatusBarTintColor(getResources().getColor(R.color.action_bar_color_end));
    if (savedInstanceState == null) {
        handleIntent(getIntent());
    }
}
 
開發者ID:runningcode,項目名稱:CUMtd,代碼行數:23,代碼來源:MainActivity.java

示例15: invalidateNavBar

import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
public void invalidateNavBar() {
    if (SDK_INT == 20 || SDK_INT == 19) {
        SystemBarTintManager tintManager = new SystemBarTintManager(this);
        tintManager.setStatusBarTintEnabled(true);
        tintManager.setStatusBarTintColor(getColorPreference().getColor(ColorUsage.getPrimary(MainActivity.currentTab)));

        FrameLayout.MarginLayoutParams p = (ViewGroup.MarginLayoutParams) findViewById(R.id.preferences).getLayoutParams();
        SystemBarTintManager.SystemBarConfig config = tintManager.getConfig();
        p.setMargins(0, config.getStatusBarHeight(), 0, 0);
    } else if (SDK_INT >= 21) {
        SharedPreferences Sp = PreferenceManager.getDefaultSharedPreferences(this);
        boolean colourednavigation = Sp.getBoolean(PreferencesConstants.PREFERENCE_COLORED_NAVIGATION, true);
        Window window = getWindow();
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        int tabStatusColor = PreferenceUtils.getStatusColor(getColorPreference().getColorAsString(ColorUsage.getPrimary(MainActivity.currentTab)));
        window.setStatusBarColor(tabStatusColor);
        if (colourednavigation) {
            window.setNavigationBarColor(tabStatusColor);
        } else if(window.getNavigationBarColor() != Color.BLACK){
            window.setNavigationBarColor(Color.BLACK);
        }
    }

    if (getAppTheme().equals(AppTheme.BLACK)) getWindow().getDecorView().setBackgroundColor(Utils.getColor(this, android.R.color.black));
}
 
開發者ID:TeamAmaze,項目名稱:AmazeFileManager,代碼行數:27,代碼來源:PreferencesActivity.java


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