Anki-Android icon indicating copy to clipboard operation
Anki-Android copied to clipboard

[Bug]: Set due date setting is cannot be searched

Open Prince-kushwaha opened this issue 1 year ago • 2 comments

Purpose / Description

Set due date setting is cannot be searched

Fixes

  • Fixes #16603

How Has This Been Tested?

physical device SDK 34

Screenshot

WhatsApp Image 2024-10-07 at 10 02 12 PM

Checklist

Please, go through these checks before submitting the PR.

  • [x] You have a descriptive commit message with a short title (first line, max 50 chars).
  • [x] You have commented your code, particularly in hard-to-understand areas
  • [x] You have performed a self-review of your own code
  • [x] UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • [x] UI Changes: You have tested your change using the Google Accessibility Scanner

Prince-kushwaha avatar Oct 07 '24 16:10 Prince-kushwaha

[!IMPORTANT] Maintainers: This PR contains https://github.com/ankidroid/Anki-Android/labels/Strings changes

  1. Sync Translations before merging this PR and wait for the action to complete
  2. Review and merge the auto-generated PR in order to sync all user-submitted translations
  3. Sync Translations again and merge the PR so the huge automated string changes caused by merging this PR are by themselves and easy to review

github-actions[bot] avatar Oct 07 '24 16:10 github-actions[bot]

Hi @david-allison ,when trying to set the title of the "Set Due Date" ListPreference dynamically from the HeaderFragment. The problem occurs because you're trying to access the ListPreference('Set due date'), which is defined in preferences_controls.xml, while the HeaderFragment is loading its preferences from R.xml.preference_headers. Since the ListPreference isn't part of the current preference screen loaded by the HeaderFragment, it results in a null reference when you try to access it.

In other words, the fragment is only aware of the preferences defined in preference_headers.xml and doesn't have access to the preferences from preferences_controls.xml. That's why you're unable to dynamically set the title of the ListPreference("Set due date") Screenshot 2024-10-08 134908

Prince-kushwaha avatar Oct 08 '24 08:10 Prince-kushwaha