public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int selectedColor) {
switch (dialog.getTitle()) {
case R.string.primary_color:
if (PreferenceUtils.getPrimaryColor(getContext()) == selectedColor) return;
prefs.edit().putInt(PreferenceUtils.PRIMARY, selectedColor).apply();
primary.transition(new ColorDrawable(selectedColor));
break;
case R.string.accent_color:
if (PreferenceUtils.getAccentColor(getContext()) == selectedColor) return;
prefs.edit().putInt(PreferenceUtils.ACCENT, selectedColor).apply();
accent.transition(new ColorDrawable(selectedColor));
break;
default:
return;
}
pasta.showToast(getString(R.string.restart_msg));
}
SettingsFragment.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:Pasta-Music
作者:
评论列表
文章目录