SettingsActivity.java 文件源码

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

项目:app-theme-engine 作者:
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int selectedColor) {
    final Config config = ATE.config(this, getATEKey());
    switch (dialog.getTitle()) {
        case R.string.primary_color:
            config.primaryColor(selectedColor);
            break;
        case R.string.accent_color:
            config.accentColor(selectedColor);
            // We've overridden the navigation view selected colors in the default config,
            // which means we are responsible for keeping those colors up to date.
            config.navigationViewSelectedIcon(selectedColor);
            config.navigationViewSelectedText(selectedColor);
            break;
        case R.string.primary_text_color:
            config.textColorPrimary(selectedColor);
            break;
        case R.string.secondary_text_color:
            config.textColorSecondary(selectedColor);
            break;
    }
    config.commit();
    recreate(); // recreation needed to reach the checkboxes in the preferences layout
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号