From 5dfec7da4ca1d5e7f9d5313ce5ffea8649b9247b Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 5 Jul 2023 21:08:53 +0530 Subject: [PATCH] Changed Material Dialog with Alert Dialog for CardBrowserMySearchesDialog.kt --- .../ichi2/anki/dialogs/CardBrowserMySearchesDialog.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/CardBrowserMySearchesDialog.kt b/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/CardBrowserMySearchesDialog.kt index 45c7c492e82a..5f8d6e6ab5c6 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/CardBrowserMySearchesDialog.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/dialogs/CardBrowserMySearchesDialog.kt @@ -4,6 +4,7 @@ package com.ichi2.anki.dialogs import android.annotation.SuppressLint import android.app.Dialog import android.os.Bundle +import androidx.appcompat.app.AlertDialog import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager import com.afollestad.materialdialogs.MaterialDialog @@ -14,6 +15,10 @@ import com.ichi2.anki.R import com.ichi2.anki.analytics.AnalyticsDialogFragment import com.ichi2.compat.CompatHelper.Companion.getSerializableCompat import com.ichi2.ui.ButtonItemAdapter +import com.ichi2.utils.message +import com.ichi2.utils.negativeButton +import com.ichi2.utils.positiveButton +import com.ichi2.utils.show import timber.log.Timber // TODO: Add different classes for the two different dialogs @@ -79,7 +84,7 @@ class CardBrowserMySearchesDialog : AnalyticsDialogFragment() { } private fun removeSearch(searchName: String) { - MaterialDialog(requireActivity()).show { + AlertDialog.Builder(requireActivity()).show { message(text = resources.getString(R.string.card_browser_list_my_searches_remove_content, searchName)) positiveButton(android.R.string.ok) { mySearchesDialogListener!!.onRemoveSearch(searchName) @@ -90,9 +95,6 @@ class CardBrowserMySearchesDialog : AnalyticsDialogFragment() { notifyAdapterDataSetChanged() } dialog?.dismiss() // Dismiss the root dialog - if (savedFilters!!.isEmpty()) { - dialog!!.dismiss() - } } negativeButton(R.string.dialog_cancel) }