BaseActivity.java 文件源码

java
阅读 34 收藏 0 点赞 0 评论 0

项目:Toutiao 作者:
@Override
protected void onResume() {
    super.onResume();
    int color = SettingUtil.getInstance().getColor();
    int drawable = Constant.ICONS_DRAWABLES[SettingUtil.getInstance().getCustomIconValue()];
    if (getSupportActionBar() != null)
        getSupportActionBar().setBackgroundDrawable(new ColorDrawable(color));
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().setStatusBarColor(CircleView.shiftColorDown(color));
        // 最近任务栏上色
        ActivityManager.TaskDescription tDesc = new ActivityManager.TaskDescription(
                getString(R.string.app_name),
                BitmapFactory.decodeResource(getResources(), drawable),
                color);
        setTaskDescription(tDesc);
        if (SettingUtil.getInstance().getNavBar()) {
            getWindow().setNavigationBarColor(CircleView.shiftColorDown(color));
        } else {
            getWindow().setNavigationBarColor(Color.BLACK);
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号