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

Storage fix and other features #44

Closed
wants to merge 29 commits into from

Conversation

lrq3000
Copy link

@lrq3000 lrq3000 commented Jan 13, 2023

This PR is based on the develop branch and it implements the following changes:

  • restore support for an external folder using scoped storage permissions via SimpleStorage library. Note that due to how permissions now work, the filetype defines the file extension, so that all files now are .1list.json instead of .1list as before (EDIT: in fact it's possible to force a custom file extension by not specifying a mimeType in makeFile() in PersistenceHelper.kt, but then it may be risky in the future, maybe Android may confuse this with a MediaStore file and restrict permission if it is unsure it's a DocumentFile, so I would rather keep .1list.json just to be sure, and also 3rd-party reading apps can more easily open these files). Big thanks to @anggrayudi for his help with making this possible despite Google's insanity! (See issues here and here). Fixes Error while getting your list from content #41, fixes Default storage folder is ignored #26 and fixes Export/Import lists #38.
  • a Share All Lists button as a quick workaround to export a backup of all lists easily.
  • option for Share and Share All export in Markdown or plain text.
  • option to add new tasks at the list's end instead of top. Fixes Let user decide if items are added to top or bottom of list #32.
  • option to NOT move done tasks. Fixes [Feature] Optional reordering when done #10 and fixes Please let the order of the list-items as they are #27.
  • option when editing a task to move it to another list. A typical use case is to move urgent tasks to an "URGENT" list, and when done or not urgent anymore, it can be moved back to its original list such as "Errands" or "Work". Given how the app's main utility revolves around multitasking and navigating quickly around multiple lists, I feel this feature is totally in the app's ethos.

For those who are impatient, a debug APK is available here: https://github.com/lrq3000/OneList/releases/tag/storage-fix-and-more-features-bugfix5

Important note: this PR increases the minimum API from 16 to 19 to support the minimum libraries required for SimpleStorage to work, so by merging this we drop support for Android versions older than 19 (KITKAT).

@lolo-io This PR is fully functional, and if you don't like the additional features, you can just cherry-pick whichever commits you want, I rebased to separate them cleanly.

However there are a few minor things that could be improved:

  • Currently, the Share and Share All functions are represented by 2 different buttons. They could be merged into one, with a dialog being created to allow user to select between "Share this list" or "Share all lists".
  • In the Preferences, I added an option "storage_force" which, when clicked, copies all lists into the new default path. I implemented this to ease the transition of current users, so they can easily copy all their lists to the new storage. Although this option is not destructive, it would be better if it asked the user to confirm before being applied, to avoid misclicks.
  • bug: can move new tasks to the very bottom of the list, then trying to move it will make the app crash. New tasks with option "Add to the bottom" should be created at the bottom but before done tasks!
  • bug: when force storage update, path of lists are not updated on UI in EditListDialog until app is closed and reopened
  • bug: force storage update not working when selecting App private storage, should just delete list.path
  • portugues translations are missing for my additions, so it's in english until someone translate in this language. But the French translation is done. (won't do, I cannot translate in portuguese unfortunately, help is welcome!)

As you can see, these are very minor issues, it's just that I am not experienced enough with making dialogs. We only need very simple dialogs to make these two options perfectly fine. This can be done at a later point in time. This is now done.

Also note that I left Log.d calls on purpose, as they are anyway muted and skipped in the compiled app, but are very helpful if we ever need to debug storage issues again (especially if users need to debug! You can ask for a dump and it will tell you right away where there is an issue and if permissions were correctly granted).

Loïc Teyssier and others added 10 commits December 1, 2021 17:52
Signed-off-by: Stephen L. <lrq3000@gmail.com>
Signed-off-by: Stephen L. <lrq3000@gmail.com>
Signed-off-by: Stephen L. <lrq3000@gmail.com>
… load SimpleStorage

Signed-off-by: Stephen L. <lrq3000@gmail.com>
…tandardize extension to 1list.json (for compatibility and clarity that it is a DocumentFile, not a MediaStore) + add button to copy all lists to new storage location + bump version 1.3.2-DEV

Signed-off-by: Stephen L. <lrq3000@gmail.com>
Signed-off-by: Stephen L. <lrq3000@gmail.com>
Signed-off-by: Stephen L. <lrq3000@gmail.com>
Signed-off-by: Stephen L. <lrq3000@gmail.com>
…lots of comments to ease future maintenance (literate programming)

Signed-off-by: Stephen L. <lrq3000@gmail.com>
…top (fixes lolo-io#32)

Signed-off-by: Stephen L. <lrq3000@gmail.com>
…reference

Signed-off-by: Stephen L. <lrq3000@gmail.com>
Signed-off-by: Stephen L. <lrq3000@gmail.com>
Signed-off-by: Stephen L. <lrq3000@gmail.com>
…antaneously in EditItemDialog (no more slowdowns) by reusing OneListFragment's allLists

Signed-off-by: Stephen L. <lrq3000@gmail.com>
…s current selectedList

Signed-off-by: Stephen L. <lrq3000@gmail.com>
Signed-off-by: Stephen L. <lrq3000@gmail.com>
Signed-off-by: Stephen L. <lrq3000@gmail.com>
@lrq3000
Copy link
Author

lrq3000 commented Jan 19, 2023

@lolo-io did you have time to have a look? Please let me know if you need me to change something :-)

@lrq3000
Copy link
Author

lrq3000 commented Jan 19, 2023

Also I've been using the debug apk for a week now on a daily basis, everything seems to work very fine!

…opying lists to defaultPath

Signed-off-by: Stephen L. <lrq3000@gmail.com>
… tasks, instead of after done tasks + fix draggable range and avoid crashes with doneItemsToBottom option

Signed-off-by: Stephen L. <lrq3000@gmail.com>
…backs (no change in UX, it's just for future code maintenance)

Signed-off-by: Stephen L. <lrq3000@gmail.com>
…ge, should just delete list.path

Signed-off-by: Stephen L. <lrq3000@gmail.com>
…n UI in EditListDialog until app is closed and reopened

Signed-off-by: Stephen L. <lrq3000@gmail.com>
Signed-off-by: Stephen L. <lrq3000@gmail.com>
Signed-off-by: Stephen L. <lrq3000@gmail.com>
@lrq3000
Copy link
Author

lrq3000 commented Jan 24, 2023

@lolo-io just to let you know that I did a last pass of polishing on this PR to clean up all remaining issues such as implementing confirmation dialogs and some edge case errors, except portuguese translation, so this PR can be merged without additional work.

Signed-off-by: Stephen L. <lrq3000@gmail.com>
@lrq3000
Copy link
Author

lrq3000 commented Apr 27, 2023

Four months later I am still using this build in production, combined with SyncThing to make a backup to a computer, and it works flawlessly. It is very stable, it can be merged whenever you want @lolo-io .

@lrq3000
Copy link
Author

lrq3000 commented Apr 27, 2023

@lolo-io If you give me access to this GitHub repository and the Android store for this app, I can take care of maintaining it. I would like to avoid making a fork, but I think it's a shame that this app is abandoned now despite its huge potential. If you cannot take care of it anymore, please let someone else maintain it.

@lolo-io
Copy link
Owner

lolo-io commented Jan 23, 2024

Hi @lrq3000. A am back on this project after a long time of absence.
I have been working lately on a new way of handling stored lists on the device.
The way it was done initially was experimental and I didn't like that much the fact that each lists could be saved in its own folder. That made storage management very painful to maintain/manage/predict. The majority of people will assign only y one of their folders to 1List, so I headed up this way.
Now you can just chose if your lists (all lists) will be backed up in the one folder you chose. This is done from the settings and not the list options.

I also wasn't happy with the codebase, so I refactored all of it to make it more aligned with nowadays coding standards. There is still work to do on that side but I'm on it. The consequence is that all previous PRs are totally out of date now.

I want to thank you for your PR even if I didn't merge it. It was very useful, I looked into it during my refacto. I used SimpleStorage as you advised me.
The reasons I didn't merge it was 1- I needed to make sure no user would loose their lists while updating to the new version, 2- I still wasn't satisfied about this storage feature, so I already wanted to rethink it to make it more user friendly, and 3- Th PR was very big, with a lot of different stuff to review/test, or even to chose to implement or not. Making cherry-picks on other's PR's isn't an enjoyable task 😅, so I ended up postponing it forever.

Anyway, thanks for the support. Sorry for having been away so long,
I will close this PR because now it is totally desychronized from master.

@lolo-io lolo-io closed this Jan 23, 2024
@lrq3000
Copy link
Author

lrq3000 commented Jan 24, 2024

No problem, thank you @lolo-io for your huge work refactoring your great app and I'm glad if my code could help at least with some parts of the implemeetation, SimpleStorage is an awesome library that makes our lives easier as Android devs 😄

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