- Ensures tags are registered correctly
- Enables undoing of adds
- Also disables automatic backups when testing under robolectric, since
it causes race conditions in the tests.
Closes#12608
Change the order of audio-related items to group them
- Move "Set TTS language" above "Deck options" (Move "Deck options" to the bottom of the menu)
- Move "Replay audio" and "Check pronunciation" above "Set TTS language"
This commit also adds for userAcceptsSchemaChange(Collection) handling for canceling the dialog in other ways(like
tapping outside or using the back button). Without onCancel the function will never resume in the situations mentioned
above.
Due to Scoped Storage, we will no longer need this dialog
It was added because people were complaining about the storage
permission prompt, and this will no longer be shown
We remove this now to remove the burden on translators and a step
for developers to test a new version of the app.
Later, we'll remove this function entirely.
See: issue 5304 - scoped storage
This is the equivalent method from AnkiDroidApp and AnkiActivity,
but this dialog does not inherit from them, so it has to override
the language in it's own implementation
- note using "acra" as prefs prefix so this works with current version
(which needs "" for prefs to work) and next version (which needs null)
just specifying a custom file works around the existing bug and new fixed style
see https://github.com/ACRA/acra/issues/1113 and related commit
instead of modifying the existing builder to change config, rebuild
each time by storing the modifications locally and then
re-doing the config completely using our local state
* Extracted SuspendCardMulti to suspendCardMulti
* SuspendCardMulti now extends TaskDelegate
* Moved exception handling to suspendCardMulti function
* Migrated SuspendCardMulti to Coroutines
* Exceptions are now handled by launchCatchingTask
* Extracted long condition out of `if()` to a variable
* DeleteNoteHandler now extends TaskListenerWithContext
Copied the logic from previous parent: ListenerWithProgressBarCloseOnFalse
* DeleteNoteMulti now extends TaskDelegate not DismissNotes
DismissNotes is a wrapper that just executes the original task in db-transaction. This behaviour is now directly implemented in DeleteNoteMulti
* Extracted DeleteNoteMulti::task to deleteNoteMulti
* deleteNoteMulti: result is returned finally instead of publishing as progress
In previous implementation, result was being published using doProgress and just after function returns. So basically is is equivalent to finally returning the result.
Also notes are removed from view only if the operation results in success
* Migrated DeleteNoteMulti to Coroutines
pre and post delete behaviour has be imported from Cardbrowser.mDeleteNoteHandler.
* KotlinCleanup: CardBrowser
* Exceptions are now handled by launchCatchingTask
* Changes to UI is now done behind a progress dialog
* renamed variables to more descriptive ones
result to deleteCard
deleteNoteMulti to deleteMultipleNotes
* Refactor `preds` to define it as a `val` instead of `var`
* move initialization to when declaration happens
auto suggestion by Android Studio
* remove redundant curly braces
* Extracted out RenderBrowserQA::task to renderBrowserQA
* Extracted out onPostExecuteRenderBrowserQA function
* KotlonCleanup: CardBrowser
* Coroutines migration RenderBrowserQA
Replaced cancellation check of CollectionTask with coroutineScope.ensureActive()
* Extracted out ConfSetSubdecks::task to confSetSubdecks
* Migrated ConfSetSubdecks to Coroutines
Since the launch is taking place from inside a AppCompatPreferenceActivity which is not a lifecycleOwner. And launchCatchingTask can only happen from a lifecycleOwner, so a custom CoroutineScope implementation is required which cancels any job (launched from this activity) when the activity gets destroyed and that is achieved by extending 'AppCompatPreferenceActivity: CoroutineScope by MainScope' and calling cancel in onDestroy.
MainScope delegates the CoroutineScope implementation with having Main dispatcher as default for launch{} calls. This is the reason why coroutine is launched using launch{} instead of launchCatchingTask{}
* Exceptions are now handled by CoroutineExceptionHandler
* Moved confSetSubdecks to DeckOptions
If you use TabLayout, and
if that tabMode is "scrollable" (which we want, vs auto or fixed), and
if you do not specify a non-default gravity,
then you get a TabLayout set for mode scrollable + gravity fill, which is not compatible
In this commit I switch to gravity start, which simply matches the behavior the TabLayout falls back to
- I considered tabMode:auto, then that puts the tabs in the center which looks bad, unless,
- I considered tabMode:auto with gravity start, now tabs are in right spot, but there is no change in behavior vs
- I consdiered tabMode:scrollable with gravity start - which is the fallback behavior and
works best while representing the minimal change
This is the warning:
W/TabLayout: MODE_SCROLLABLE + GRAVITY_FILL is not supported, GRAVITY_START will be used instead