当前位置: 首页>>代码示例>>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;未经允许,请勿转载。