diff --git a/AnkiDroid/src/main/java/com/ichi2/preferences/ControlPreference.kt b/AnkiDroid/src/main/java/com/ichi2/preferences/ControlPreference.kt index fac7f178ae78..c2ecf1dd3fdc 100644 --- a/AnkiDroid/src/main/java/com/ichi2/preferences/ControlPreference.kt +++ b/AnkiDroid/src/main/java/com/ichi2/preferences/ControlPreference.kt @@ -23,7 +23,6 @@ import android.text.TextUtils import android.util.AttributeSet import android.view.View import android.widget.ArrayAdapter -import android.widget.LinearLayout import android.widget.ListView import androidx.appcompat.app.AlertDialog import androidx.core.view.isVisible @@ -219,15 +218,16 @@ class ControlPreferenceDialogFragment : DialogFragment() { private fun setupRemoveControlEntries(view: View) { val bindings = preference.getMappableBindings().toMutableList() + val listView = view.findViewById(R.id.list_view) if (bindings.isEmpty()) { - view.findViewById(R.id.remove_layout).isVisible = false + listView.isVisible = false return } val titles = bindings.map { getString(R.string.binding_remove_binding, it.toDisplayString(requireContext())) } - view.findViewById(R.id.list_view).apply { + listView.apply { adapter = ArrayAdapter(requireContext(), R.layout.control_preference_list_item, titles) setOnItemClickListener { _, _, index, _ -> bindings.removeAt(index) diff --git a/AnkiDroid/src/main/res/drawable/dotted_line.xml b/AnkiDroid/src/main/res/drawable/dotted_line.xml deleted file mode 100644 index c44a6594f76a..000000000000 --- a/AnkiDroid/src/main/res/drawable/dotted_line.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - diff --git a/AnkiDroid/src/main/res/layout/control_preference.xml b/AnkiDroid/src/main/res/layout/control_preference.xml index 5ea6cd785c9f..a82d809f7383 100644 --- a/AnkiDroid/src/main/res/layout/control_preference.xml +++ b/AnkiDroid/src/main/res/layout/control_preference.xml @@ -52,25 +52,10 @@ android:textAppearance="?attr/textAppearanceBodyLarge" /> - - - - - - - + android:divider="@null" + /> \ No newline at end of file