Skip to content

Commit

Permalink
fix:set due date is not searchable
Browse files Browse the repository at this point in the history
  • Loading branch information
Prince-kushwaha authored and BrayanDSO committed Oct 28, 2024
1 parent a1ca725 commit 54decf9
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ import com.bytehamster.lib.preferencesearch.SearchConfiguration
import com.bytehamster.lib.preferencesearch.SearchPreference
import com.ichi2.anki.BuildConfig
import com.ichi2.anki.CollectionManager
import com.ichi2.anki.CollectionManager.TR
import com.ichi2.anki.R
import com.ichi2.anki.ui.internationalization.toSentenceCase
import com.ichi2.compat.CompatHelper
import com.ichi2.preferences.HeaderPreference
import com.ichi2.utils.AdaptionUtil
Expand Down Expand Up @@ -108,6 +110,7 @@ class HeaderFragment : PreferenceFragmentCompat() {
private const val DEFAULT_SELECTED_HEADER = "generalScreen"

fun configureSearchBar(activity: AppCompatActivity, searchConfiguration: SearchConfiguration) {
val setDuePreferenceTitle = TR.actionsSetDueDate().toSentenceCase(activity, R.string.sentence_set_due_date)
with(searchConfiguration) {
setActivity(activity)
setBreadcrumbsEnabled(true)
Expand All @@ -127,6 +130,12 @@ class HeaderFragment : PreferenceFragmentCompat() {
index(R.xml.preferences_accessibility)
index(R.xml.preferences_backup_limits)
ignorePreference(activity.getString(R.string.pref_backups_help_key))
indexItem()
.withKey(activity.getString(R.string.reschedule_command_key))
.withTitle(setDuePreferenceTitle)
.withResId(R.xml.preferences_controls)
.addBreadcrumb(activity.getString(R.string.pref_cat_controls))
.addBreadcrumb(setDuePreferenceTitle)
}

// Some preferences and categories are only shown conditionally,
Expand Down

0 comments on commit 54decf9

Please sign in to comment.