use of me.ccrama.redditslide.databinding.ChoosethemesmallBinding in project Slide by ccrama.
the class SettingsThemeFragment method setupSettingsThemeBase.
void setupSettingsThemeBase() {
final LinearLayout themeBase = (LinearLayout) context.findViewById(R.id.settings_theme_base);
themeBase.setOnClickListener(v -> {
final ChoosethemesmallBinding choosethemesmallBinding = ChoosethemesmallBinding.inflate(context.getLayoutInflater());
final View root = choosethemesmallBinding.getRoot();
final TextView title = choosethemesmallBinding.title;
title.setBackgroundColor(Palette.getDefaultColor());
if (SettingValues.isNight()) {
choosethemesmallBinding.nightmsg.setVisibility(View.VISIBLE);
}
for (final Pair<Integer, Integer> pair : ColorPreferences.themePairList) {
root.findViewById(pair.first).setOnClickListener(v1 -> {
SettingsThemeFragment.changed = true;
final String[] names = new ColorPreferences(context).getFontStyle().getTitle().split("_");
final String name = names[names.length - 1];
final String newName = name.replace("(", "");
for (final ColorPreferences.Theme theme : ColorPreferences.Theme.values()) {
if (theme.toString().contains(newName) && theme.getThemeType() == pair.second) {
back = theme.getThemeType();
new ColorPreferences(context).setFontStyle(theme);
context.restartActivity();
break;
}
}
});
}
new AlertDialog.Builder(context).setView(root).show();
});
}
Aggregations