Actions:
- remove unsused methods
- change signatures of methods to make the transition to properties easier
- rename an extra reference of a property from one of the subclasses of IField which would clash with some class methods
during migration
To solve the leak and decouple the two classes, this PR also:
- refactors the ModelBrowserContextMenu class to remove it's reference to the activity
- fixes a @KotlinCleanup for the method where the leak occurs
* feat(scoped-storage): implement migrateEssentialFiles
Handles selection of the correct directory, and handling deletion
if an issue occurred with the copy
Co-authored-by: Arthur Milchior <arthur@milchior.fr>
Explain the impact now: new contributors think about tests,
and encourage tests to be written without being overbearing
And future plans: moving to a codebase with better coverage and
better formalizing the requirements for writing a test for GSoC
This PR has changes besides the output of the java-kotlin IDE migration tool:
- the tool made the fields in FieldControllerBase as nullable which triggered a lot of changes in
subclasses for adding !!. To reduce the number of changes this PR tackles the nullability of the class properties and
made them lateinit var
- there's one extra getter method added for the mActivity field because one of the subclasses' test requires access to
the field. It is possible to access protected fields from the same packages in java but this isn't possible in kotlin
code.
* Fix supportInvalidateOptionsMenu deprecation on CardBrowser.kt
Substituted for equivalent `invalidateOptionsMenu()`
* Fix supportInvalidateOptionsMenu deprecation on AbstractFlashcardViewer.kt
Substituted for equivalent `invalidateOptionsMenu()`
* Fix supportInvalidateOptionsMenu deprecation on DeckPicker.kt
Substituted for equivalent `invalidateOptionsMenu()`
* Fix supportInvalidateOptionsMenu deprecation on CardTemplateEditor.kt
* Fix supportInvalidateOptionsMenu deprecation on MultimediaEditFieldActivity.kt
* Fix supportInvalidateOptionsMenu deprecation on NavigationDrawerActivity.kt
* Remove supportInvalidateOptionsMenu on MyAccount.kt
it doesn't have a options menu to invalidate, so it isn't necessary
Overriding `onBackPressed()` is necessary because it triggered the default `finish()`, and finish() shouldn't be directly overriden because AnkiActivity deprecates it
Overriding `onActionBarBackPressed()` is necessary because super's (AnkiActivity) equivalent finishes without animation
Reviewer is the only inheritor of AbstractFlashcardViewer which calls `openCardInfo`
Another reason is to simplify the use/importing of the constants/methods necessary to implement the reverse transitions on finish