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