Fix transliterate switch in map language dialog

This commit is contained in:
Vitaliy 2021-04-18 14:47:54 +03:00
parent 7ac56c9359
commit 3de36e5eef

View file

@ -530,7 +530,7 @@ public class ConfigureMapMenu {
TextView switchText = (TextView) v.findViewById(R.id.switchText); TextView switchText = (TextView) v.findViewById(R.id.switchText);
switchText.setText(activity.getString(R.string.translit_name_if_miss, txtValues[position])); switchText.setText(activity.getString(R.string.translit_name_if_miss, txtValues[position]));
SwitchCompat check = (SwitchCompat) v.findViewById(R.id.check); SwitchCompat check = (SwitchCompat) v.findViewById(R.id.check);
check.setChecked(settings.MAP_TRANSLITERATE_NAMES.isSet() ? transliterateNames : txtIds[position].equals("en")); check.setChecked(transliterateNames);
check.setOnCheckedChangeListener(translitChangdListener); check.setOnCheckedChangeListener(translitChangdListener);
UiUtilities.setupCompoundButton(nightMode, selectedProfileColor, check); UiUtilities.setupCompoundButton(nightMode, selectedProfileColor, check);
} else { } else {
@ -548,6 +548,7 @@ public class ConfigureMapMenu {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
selectedLanguageIndex = which; selectedLanguageIndex = which;
transliterateNames = settings.MAP_TRANSLITERATE_NAMES.isSet() ? transliterateNames : txtIds[which].equals("en");
((AlertDialog) dialog).getListView().setSelection(which); ((AlertDialog) dialog).getListView().setSelection(which);
singleChoiceAdapter.notifyDataSetChanged(); singleChoiceAdapter.notifyDataSetChanged();
} }