AttributeActivity.java 文件源码

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

项目:mesh-core-on-android 作者:
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int color) {
    if (dialog.isAccentMode()) {
        accentPreselect = color;
        ThemeSingleton.get().positiveColor = DialogUtils.getActionTextStateList(this, color);
        ThemeSingleton.get().neutralColor = DialogUtils.getActionTextStateList(this, color);
        ThemeSingleton.get().negativeColor = DialogUtils.getActionTextStateList(this, color);
        ThemeSingleton.get().widgetColor = color;
        Log.i(TAG, "onColorSelection: #"+ Integer.toHexString(color));
        setStateItem(ElementAppItem.APP_TYPE_COLOR, "#"+Integer.toHexString(color));
    } else {
        primaryPreselect = color;
        if (getSupportActionBar() != null) {
            getSupportActionBar().setBackgroundDrawable(new ColorDrawable(color));
        }
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            getWindow().setStatusBarColor(CircleView.shiftColorDown(color));
            getWindow().setNavigationBarColor(color);
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号