本文整理汇总了Java中com.afollestad.materialdialogs.color.ColorChooserDialog.getTitle方法的典型用法代码示例。如果您正苦于以下问题:Java ColorChooserDialog.getTitle方法的具体用法?Java ColorChooserDialog.getTitle怎么用?Java ColorChooserDialog.getTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.afollestad.materialdialogs.color.ColorChooserDialog
的用法示例。
在下文中一共展示了ColorChooserDialog.getTitle方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onColorSelection
import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int selectedColor) {
switch (dialog.getTitle()) {
case R.string.primary_color:
ThemeStore.editTheme(this)
.primaryColor(selectedColor)
.commit();
break;
case R.string.accent_color:
ThemeStore.editTheme(this)
.accentColor(selectedColor)
.commit();
break;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
new DynamicShortcutManager(this).updateDynamicShortcuts();
}
recreate();
}
示例2: onColorSelection
import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int selectedColor) {
switch (dialog.getTitle()) {
case R.string.primary_color:
ThemeStore.editTheme(this).primaryColor(selectedColor).commit();
break;
case R.string.accent_color:
ThemeStore.editTheme(this).accentColor(selectedColor).commit();
break;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
new DynamicShortcutManager(this).updateDynamicShortcuts();
}
recreate();
}
示例3: onColorSelection
import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
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));
}
示例4: onColorSelection
import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
@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);
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
}
示例5: onColorSelection
import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
@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
}
示例6: onColorSelection
import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
@Override
public void onColorSelection(@NonNull ColorChooserDialog colorChooserDialog, @ColorInt int i) {
ThemeStore themeStore = ThemeStore.editTheme(this);
switch (colorChooserDialog.getTitle()) {
case R.string.primary_color: themeStore.primaryColor(i); break;
case R.string.toolbar_text : Theme.setTextColorToolbar(prefEdit, i); break;
case R.string.tab_indicator: Theme.setTabIndicatorColor(prefEdit, i); break;
case R.string.accent_color : themeStore.accentColor(i); break;
case R.string.counter_back: Theme.setCounterBackColor(prefEdit, i); break;
case R.string.counter_text: Theme.setCounterTextColor(prefEdit, i); break;
}
prefEdit.commit();
themeStore.commit();
recreate();
}
示例7: onColorSelection
import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
@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);
break;
}
config.commit();
recreate(); // recreation needed to reach the checkboxes in the preferences layout
}
示例8: onColorSelection
import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
@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);
break;
}
config.commit();
recreate();
}
示例9: onColorSelection
import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
@Override
public void onColorSelection(ColorChooserDialog dialog, int color) {
int title = dialog.getTitle();
if (title == R.string.actionbr) {
actionbar = color;
} else if (title == R.string.navbr) {
navbar = color;
} else if (title == R.string.txt) {
text = color;
}
refresh();
}
示例10: onColorSelection
import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
/**
* Set the new text or background color for {@link #tempTag}.
* @param dialog Dialog whose title string's resource ID will determine if we're setting the text or
* background color.
* @param selectedColor New text or background color.
*/
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int selectedColor) {
if (dialog.getTitle() == R.string.title_tag_text_color) // Text color dialog.
ActionHelper.setTagTextColor(realm, tempTag, selectedColor);
else // Background color dialog.
ActionHelper.setTagBgColor(realm, tempTag, selectedColor);
// Notify the adapter that it needs to re-draw the tag's card.
adapter.notifyItemChanged(items.indexOf(tempTag));
// Indicate that we might need an explicit update.
taggingHelper.markForExplicitUpdateIfNecessary();
}
示例11: onColorSelection
import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int color) {
if (R.string.dialog_colour_primary_title == dialog.getTitle()) {
prefs.put(Constants.PREFS_COLOR_PRIMARY, String.valueOf(color));
Utils.resetColours(1);
} else if (R.string.dialog_colour_accent_title == dialog.getTitle()) {
prefs.put(Constants.PREFS_COLOR_ACCENT, String.valueOf(color));
Utils.resetColours(2);
}
recreate();
}
示例12: onColorSelection
import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int selectedColor) {
switch (dialog.getTitle()) {
case R.string.primary_color:
if (!App.isProVersion()) {
Arrays.sort(NonProAllowedColors.PRIMARY_COLORS);
if (Arrays.binarySearch(NonProAllowedColors.PRIMARY_COLORS, selectedColor) < 0) {
// color wasn't found
Toast.makeText(this, R.string.only_the_first_5_colors_available, Toast.LENGTH_LONG).show();
startActivity(new Intent(this, PurchaseActivity.class));
return;
}
}
ThemeStore.editTheme(this)
.primaryColor(selectedColor)
.commit();
break;
case R.string.accent_color:
if (!App.isProVersion()) {
Arrays.sort(NonProAllowedColors.ACCENT_COLORS);
if (Arrays.binarySearch(NonProAllowedColors.ACCENT_COLORS, selectedColor) < 0) {
// color wasn't found
Toast.makeText(this, R.string.only_the_first_5_colors_available, Toast.LENGTH_LONG).show();
startActivity(new Intent(this, PurchaseActivity.class));
return;
}
}
ThemeStore.editTheme(this)
.accentColor(selectedColor)
.commit();
break;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
new DynamicShortcutManager(this).updateDynamicShortcuts();
}
recreate();
}