* add scope function for Intent
Added .apply{} scope function for getIntent()
* IDE lint
* add: scope function
Added .apply{} scope function for data Intent
* cleanup: IDE lint for render_output_legacy() function
* cleanup: IDE lint for _renderQA() function
* cleanup: replaced with Kotlin function
* cleanup: use Kotlin's Random library instead of Java
after using Kotlin's Random there was no need for scope functions so removing that KotlinCleanup was ideal here.
After discarding the backend, Preferences was calling getCol and passing
itself in as the context. This caused the preferences screen to be retained
as the backend lives on. By switching to AnkiDroidApp, a leak can be
avoided.
- Move logic from backend into frontend, so a new backend release is
not required
- Fix mapping of Chinese languages and Hindi; check others
- Don't require a restart after changing language in prefs
Like the desktop, this works by using a single set of tests that
alter some of the checks depending on the active scheduler version,
so that code duplication is avoided.
- Mirrors the code layout of the desktop version, where routines like
buryCard(), that are not specific to V2 or V3, are stored in a separate
file. This leaves AbstractSched containing only the methods that will
need to be implemented separately for V3.
- Moves some methods from SchedV2 into BaseSched, as V3 will want to
use them as well for now.
- Some of the routines in BaseSched will only work with a schema upgrade.
For now, SchedV2 overrides these so they continue to work with the
legacy schema.
It was introduced due to #5666, but AnkiWeb has ignored the due counts
in the sanity check for about 18 months, so this is no longer necessary.
Also remove _updateCutoff() and _checkDay() from the public API.
Initial prep work for adding the V3 scheduler. Removed some methods that
are only used internally, and defined some overloads concretely.
eta() implementation in v1 appeared to be functionally identical to v2,
despite the comment.
Studying with the V1 scheduler enabled is no longer possible on recent
Anki, AnkiMobile or AnkiWeb versions, so AnkiDroid is the last one
still supporting it. Pushing users to upgrade will save them from some
of the footguns V1 had, and will allow AnkiDroid to cut out some code
and tests. Many users have likely already upgraded due to the use of
the other clients.
This commit adds support for the backend upgrade code, so that learning
cards will not be reset on upgrade. To make use of this, users will be
automatically updated to the latest schema version, the scheduler
upgrade will be performed, and then they're moved back to the legacy
schema.
I've also added a helper to more ergonomically deal with schema changes.
This method do not take nullable value anymore. And it seems that even from
java's code, it can't be called with nullable value, since it's only called from
either literals or result of Cursor. I.e. strings that are not null by
assumption about the database.
This method do not take nullable value anymore. And it seems that even from
java's code, it can't be called with nullable value, since it's only called from
result of Cursor. I.e. strings that are not null by assumption about the database.
* onOptionsItemSelected action_reposition_cards new filter cleanup
* convert concat string to template
* remove unnecessary `ArrayList`s
* made dialogs in R.id.action_reposition_cards have named args
* bring back val selectedCardIds = selectedCardIds
Possible now that the preferences are initialized on their respective screens
- Remove the repetition of `addPreferenceResource` on the start of every `initSubscreen()` and add it on `refreshScreen()`
- Inline `val screenName = analyticsScreenNameConstant`