diff --git a/app/src/main/java/org/tasks/dialogs/AlertDialogBuilder.java b/app/src/main/java/org/tasks/dialogs/AlertDialogBuilder.java index 7365195d0..c30b8a11d 100644 --- a/app/src/main/java/org/tasks/dialogs/AlertDialogBuilder.java +++ b/app/src/main/java/org/tasks/dialogs/AlertDialogBuilder.java @@ -83,7 +83,7 @@ public class AlertDialogBuilder { return this; } - AlertDialogBuilder setSingleChoiceItems( + public AlertDialogBuilder setSingleChoiceItems( List strings, int selectedIndex, DialogInterface.OnClickListener onClickListener) { builder.setSingleChoiceItems( addDirectionality(strings.toArray(new String[0])), diff --git a/app/src/main/java/org/tasks/locale/LocalePickerDialog.java b/app/src/main/java/org/tasks/locale/LocalePickerDialog.java index 0ee2a6c3c..f29b9d974 100644 --- a/app/src/main/java/org/tasks/locale/LocalePickerDialog.java +++ b/app/src/main/java/org/tasks/locale/LocalePickerDialog.java @@ -16,7 +16,6 @@ import org.tasks.injection.DialogFragmentComponent; import org.tasks.injection.ForActivity; import org.tasks.injection.InjectingDialogFragment; import org.tasks.themes.ThemeAccent; -import org.tasks.ui.SingleCheckedArrayAdapter; public class LocalePickerDialog extends InjectingDialogFragment { @@ -38,13 +37,11 @@ public class LocalePickerDialog extends InjectingDialogFragment { for (String override : getResources().getStringArray(R.array.localization)) { locales.add(locale.withLanguage(override)); } - final List display = transform(locales, Locale::getDisplayName); - SingleCheckedArrayAdapter adapter = - new SingleCheckedArrayAdapter(context, display, themeAccent); + List display = transform(locales, Locale::getDisplayName); return dialogBuilder .newDialog() .setSingleChoiceItems( - adapter, + display, display.indexOf(locale.getDisplayName()), (dialogInterface, i) -> { Locale locale = locales.get(i); @@ -52,6 +49,7 @@ public class LocalePickerDialog extends InjectingDialogFragment { getTargetFragment().onActivityResult(getTargetRequestCode(), RESULT_OK, data); dialogInterface.dismiss(); }) + .setNegativeButton(android.R.string.cancel, null) .show(); } diff --git a/app/src/main/res/layout/simple_list_item_single_choice.xml b/app/src/main/res/layout/simple_list_item_single_choice.xml index d40795ff6..7662e569a 100644 --- a/app/src/main/res/layout/simple_list_item_single_choice.xml +++ b/app/src/main/res/layout/simple_list_item_single_choice.xml @@ -29,4 +29,5 @@ android:checked="false" android:drawablePadding="@dimen/keyline_second" android:gravity="center_vertical" - android:textAppearance="?attr/textAppearanceListItemSmall"/> + android:textSize="18sp" + android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"/>