Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to store history and favourite words. #63

Merged
merged 3 commits into from
Feb 17, 2024
Merged

Conversation

tirkarthi
Copy link
Owner

@tirkarthi tirkarthi commented Feb 11, 2024

This PR implements a commonly requested feature to add support to have a list of words searched along with favourite words. The implementation involves a separate table to track the word, is_favourite and last_accessed_at time for sorting the list with recent entries. Whenever there is a word search or a notification lookup the word is recorded. If the same word is seen again then last_accessed_at time is updated. During notification lookup star action currently instead of read for testing toggles is_favourite to be 1 so that favourites page can list them. All favourites are a subset of historical entries. Since the table is stored in respective db the entries are per db and hence when user changes from English to French then the list will be empty. This is due to clicking on the entry from list so that the relevant language is used for lookup. E.g. Having test as a favourite under English and opting to French dictionary to lookup favourite English word doesn't make sense in French since there is no translation feature.

TODO :

  • HistoryActivity.kt and FavouriteActivity.kt have almost same code except the layout inflation value and the method in dao to fetch all history entries and to fetch favourites respectively. Perhaps this can be refactored.
  • Android atleast in Samsung galaxy A54 used for testing seems to only allow 3 actions from notifications. There is already copy, share and read. Perhaps one of them need to be removed.
  • Clicking on the history/favourite word in listview should redirect to mainview to search the word.
  • Support to delete entry from history page. DAO already has method, Need UI
  • Support to unfavourite a word from favourites page. DAO already has method. Need UI.
  • Test migrations and upgrade db in CDN for fresh installs to have history table.
  • Test android room 2.5.0 is compatible with fdroid.

@tirkarthi tirkarthi changed the title [WIP] Add support to store history and favourite words. Add support to store history and favourite words. Feb 17, 2024
@tirkarthi
Copy link
Owner Author

fdroid compatibility needs build in CI but I don't anticipate any issues since room has been used previously and this is an upgrade of the version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant