当前位置: 首页>>代码示例>>Java>>正文


Java SystemBarTintManager类代码示例

本文整理汇总了Java中com.readystatesoftware.systembartint.SystemBarTintManager的典型用法代码示例。如果您正苦于以下问题:Java SystemBarTintManager类的具体用法?Java SystemBarTintManager怎么用?Java SystemBarTintManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SystemBarTintManager类属于com.readystatesoftware.systembartint包,在下文中一共展示了SystemBarTintManager类的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: hasTranslucentNavigation

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入依赖的package包/类
@TargetApi (19)
public boolean hasTranslucentNavigation() {
    if (!mTranslucentNavigationSet) {
        final SystemBarTintManager.SystemBarConfig config = getSystemBarTint().getConfig();
        if (Build.VERSION.SDK_INT >= 19) {
            boolean themeConfig =
                ((getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION)
                    == WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);

            mTranslucentNavigation = themeConfig && config.hasNavigtionBar() && config.isNavigationAtBottom()
                && config.getNavigationBarHeight() > 0;
        }
        mTranslucentNavigationSet = true;
    }
    return mTranslucentNavigation;
}
 
开发者ID:sephiroth74,项目名称:Material-BottomNavigation,代码行数:17,代码来源:BaseActivity.java

示例5: setupToolbar

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入依赖的package包/类
private int setupToolbar(final Activity activity) {
    SystemBarTintManager manager = new SystemBarTintManager(activity);
    final SystemBarTintManager.SystemBarConfig config = manager.getConfig();
    if (config.getPixelInsetTop(false) > 0) {
        ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar.getLayoutParams();
        params.topMargin = 0;
        params.height = config.getActionBarHeight() + config.getStatusBarHeight();
        toolbar.setLayoutParams(params);
        toolbar.setPadding(
            toolbar.getPaddingLeft(),
            toolbar.getPaddingTop() + config.getStatusBarHeight(),
            toolbar.getPaddingRight(),
            toolbar.getPaddingBottom()
        );
        return params.height;
    }
    return config.getActionBarHeight();
}
 
开发者ID:sephiroth74,项目名称:Material-BottomNavigation,代码行数:19,代码来源:ToolbarScrollHelper.java

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

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

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

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

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

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

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

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

示例14: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_common_listview);
	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);
		tintManager.setStatusBarTintResource(R.color.app_main_theme_color);
	}
	containerView = (LinearLayout)findViewById(R.id.myLinearLayout);
	context = this;
	inflater = LayoutInflater.from(context);
	
	listDataLoadWrap = new CommonListRequestWrap<T>(context, this, getBeanType());
	pagingListViewWrap = getPagingListViewWrap(this);
	loadListDataErrorViewWrap = new LoadListDataErrorViewWrap(this);
}
 
开发者ID:x251089003,项目名称:EveryXDay,代码行数:20,代码来源:ListBaseActivity.java

示例15: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_sample);
    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);
        tintManager.setStatusBarTintResource(R.color.app_main_theme_color);
    }
    fragmentManager = getFragmentManager();
    regToWx();
    initActionBar();
    initUpdate();
    initViews();
    initViewEvents();

    showFragment(1);

}
 
开发者ID:x251089003,项目名称:EveryXDay,代码行数:22,代码来源:EveryXDayMainActivity.java


注:本文中的com.readystatesoftware.systembartint.SystemBarTintManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。