From 142b950fa29106940207c0920a66e82e02e4ba20 Mon Sep 17 00:00:00 2001 From: Guatam Singh Date: Thu, 26 Sep 2024 16:18:51 +0530 Subject: [PATCH] The Set Due Date dialog box is missing its title --- .../com/ichi2/anki/preferences/ControlsSettingsFragment.kt | 4 +++- .../anki/preferences/CustomButtonsSettingsFragment.kt | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/preferences/ControlsSettingsFragment.kt b/AnkiDroid/src/main/java/com/ichi2/anki/preferences/ControlsSettingsFragment.kt index 5f94d2a65b43..2ca592b7f583 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/preferences/ControlsSettingsFragment.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/preferences/ControlsSettingsFragment.kt @@ -45,7 +45,9 @@ class ControlsSettingsFragment : SettingsFragment() { private fun setDynamicTitle() { findPreference(getString(R.string.reschedule_command_key))?.let { - it.title = TR.actionsSetDueDate().toSentenceCase(R.string.sentence_set_due_date) + val preferenceTitle = TR.actionsSetDueDate().toSentenceCase(R.string.sentence_set_due_date) + it.title = preferenceTitle + it.dialogTitle = preferenceTitle } findPreference(getString(R.string.toggle_whiteboard_command_key))?.let { it.title = getString(R.string.gesture_toggle_whiteboard).toSentenceCase(R.string.sentence_gesture_toggle_whiteboard) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/preferences/CustomButtonsSettingsFragment.kt b/AnkiDroid/src/main/java/com/ichi2/anki/preferences/CustomButtonsSettingsFragment.kt index e66773a2ba9a..a045d57db086 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/preferences/CustomButtonsSettingsFragment.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/preferences/CustomButtonsSettingsFragment.kt @@ -20,6 +20,7 @@ import android.content.Intent import androidx.annotation.VisibleForTesting import androidx.appcompat.app.AlertDialog import androidx.core.content.edit +import androidx.preference.ListPreference import androidx.preference.Preference import com.ichi2.anki.CollectionManager.TR import com.ichi2.anki.R @@ -59,8 +60,10 @@ class CustomButtonsSettingsFragment : SettingsFragment() { } private fun setDynamicTitle() { - findPreference(getString(R.string.custom_button_schedule_card_key))?.let { - it.title = TR.actionsSetDueDate().toSentenceCase(this, R.string.sentence_set_due_date) + findPreference(getString(R.string.custom_button_schedule_card_key))?.let { + val preferenceTitle = TR.actionsSetDueDate().toSentenceCase(this, R.string.sentence_set_due_date) + it.title = preferenceTitle + it.dialogTitle = preferenceTitle } }