Lots of threading bugs here, this is sloppy code and needs to be
cleaned up ASAP
* Add a lock when closing the collection
* Use 'safe' collection methods inside DeckAdapter to respect the lock
* Add a mutex to stop 'duplicated' decks appearing
Fixes 13429
Introduce a check to not touch the view system if the fragment's UI is not available. Also increases the polling for
download state to 1 second as it isn't very efficient/wise to query the system DownloadManager every 100ms.
* sortedWith extension function provided by Kotlin for collections that will allows us to sort a list with a custom comparator
* sortedWith extension function provided by Kotlin for collections that will allows us to sort a list with a custom comparator
* mAllTags to list() then calling the sort method
IndexOutOfBoundsException when moving from
'Basic (optional reversed card)' to 'Basic (and reversed card)'
after setting 'Toggle Sticky' for all fields
This is due to 'toggle sticky' being present, but the field not
existing
Fixes 13719
Quick fix to stop a crash. Needs more thought and testing
The documentation on `getExternalFilesDirs` states:
> Some individual paths may be {@code null} if that
> shared storage is not currently available
Fixes 13705
In the ACRA interface, we only see the title of the exception
unless we dig into the exception message.
Show developers that manually reported exceptions have more information
Previously imports via clicking a deck in 'Files' failed
with intent_handler_failed_no_storage_permission:
"Missing required storage permission.
Please grant storage permission then retry your action"
Co-authored-by: lukstbit <52494258+lukstbit@users.noreply.github.com>
I've never used the information, and it makes navigation of the crash log
more difficult than it should be
I'll face the consequences if I'm incorrect here.
* Update ScopedStorageService.kt
Fixed warnings in ScopedStorageService.kt.
issue: #13282
* Removed lines in ScopedStorageService.kt
Deleted the code that was commented out.
- will abort (like before) if play store rejects us or play build fails
- will only commit/push build tag if play store works
- universal builds happen after play upload so universal doesn't upload
- migration completion notification and dialog
- added showAsyncDialogFragment to show the alert dialog/notification
- added callback in application to get current activity
---
* Refactor MigrationSuccessDialogFragment & add MigrationFailedDialogFragment
First of all, this moves MigrationSuccessDialogFragment to
com/ichi2/anki/ui/dialogs/ActivityAgnosticDialogs.kt along with the
related code that tracks the started activities and runs code on start
of any of them.
This also adds MigrationFailedDialogFragment. As we currently lack the
knowledge about what exactly can realistically fail and how, it just
shows the exception text and allows copying the debug info in the same
way as the notification does. It would be nice to try to account for
the most common errors here.
Also this:
* makes the above dialogs not cancellable on touch outside;
* adds DefaultActivityLifecycleCallbacks--same as
Application.ActivityLifecycleCallbacks but with all methods having
default implementations--for simplicity;
* adds Activity.canProperlyShowSnackbars() to determine if a
snackbar, if shown in an activity, will animate properly, or if
a toast should be shown instead;
* fixes a slight issue in Snackbars.kt where an activity with a view
with the ID root_layout would be treated as one that can properly
show a snackbar--the code wasn't checking whether or not the view
was CoordinatorLayout so it could produce the wrong result.
* Extract & change strings related to migration success or failure
* Dismiss migration progress dialog when done
* add real URL to storage migration error doc
---------
Co-authored-by: Ashish Yadav <48384865+criticalAY@users.noreply.github.com>
Co-authored-by: Mike Hardy <github@mikehardy.net>