Reviewer: "Lookup Dictionary" menu item is unused
Functionality is hooked up, but not usable as the control is never made visible.
We should add this to "App Bar Buttons" so the user can move this around on the menu.
https://github.com/ankidroid/Anki-Android/blob/46075e2ccc93a40e3b64c39333263184f43fbe07/AnkiDroid/src/main/res/menu/reviewer.xml#L118-L121
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically
I'm working on it
@david-allison-1 Could you please provide a detailed description? Should I make this item appear? What's the funtionality of it and ... ?
AnkiDroid has a lookup dictionary which is rarely used. It involves looking up selected text in one of a few externally defined dictionaries.
It can be enabled in the settings.
The current flow is:
- Highlight a word,
- Copy it
- A clickable "lookup" icon should appear,
It would be helpful to also allow a menu item to replicate the functionality without copy/pasting the word:
- Highlight the word
- Select "Lookup" from the App Bar
The Menu Item is already defined in the linked code snippet, but the functionality was never implemented so the item is never shown.
This change would involve:
- Show the menu item if the "Lookup Dictionary" preference is enabled
- Disable the menu item when "Lookup Dictionary" preference is disabled
- Define the menu item https://github.com/ankidroid/Anki-Android/blob/5128cc2c756ce1434367eb58807650581f26c661/AnkiDroid/src/main/java/com/ichi2/anki/reviewer/ActionButtonStatus.java#L47
- Add a
ViewerCommandfor the functionality to lookup a word: https://github.com/ankidroid/Anki-Android/blob/ec5d9e535c391a150e3489ceb515426a3946c305/AnkiDroid/src/main/java/com/ichi2/anki/cardviewer/ViewerCommand.java#L66-L65 - Implement the ViewerCommand in
AbstractFlashcardViewer: do nothing/show a toast if no word is highlighted, otherwise perform a lookup search - (Optional) Add a gesture for the functionality (see past PRs for how this is done - maybe add some documentation).
can I work on this?
Let's give it 48 hours. @Abanoub-Asaad are you still working on this?
@mohaned-hassan Ping me when the 48 hours is up, thanks!!
@mohaned-hassan All yours
Thanks, on it.
@david-allison-1
Anki-Android/AnkiDroid/src/main/java/com/ichi2/anki/reviewer/ActionButtonStatus.java/setup
setupButton(preferences, R.id.action_search_dictionary, "customButtonSearchDictionary", SHOW_AS_ACTION_IF_ROOM);
Can you please point out why the preference of the search_dictionary button has no value (always returns the default value)?
@mohaned-hassan if the user has not opened the settings screen