0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 12:02:16 +02:00
Commit Graph

7908 Commits

Author SHA1 Message Date
oyeraghib
05b96990ce [Kotlin Cleanup] CollectionUtils 2022-05-13 10:30:09 -05:00
oyeraghib
381b1bd2af [Kotlin Cleanup] MockCursor 2022-05-13 10:25:09 -05:00
lukstbit
3fa836ba99 Refactor IField to prepare for its migration to java
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
2022-05-13 10:24:26 -05:00
oyeraghib
21d8a142ee [Kotlin Cleanup] ReminderServiceTest 2022-05-13 10:18:40 -05:00
dorrin-sot
9101795b3c Fix AutoFocus EditText Preferences Back/Return Button Bug 2022-05-13 10:17:55 -05:00
lukstbit
6306a0aec6 Fix ModelBrowser leaking its ModelBrowserContextMenu reference
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
2022-05-13 10:16:10 -05:00
David Allison
2704fcb866
feat(scoped-storage): complete migrateEssentialFiles (#11049)
* 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>
2022-05-13 10:03:37 -05:00
David Allison
fa15aeb759 fix: invalid sourceSets for Android Chipmunk
Due to https://issuetracker.google.com/issues/37001185 we were defining
`manifest.srcFile` for `debug` instead of for `test`. This is
because manifest merging previously occurred only with build variants

Was required for robolectric. Apparently fixed in AGP 0.13.0:
https://issuetracker.google.com/issues/37001185

It seems we can manifest merge based on 'test' and 'androidTest',
so remove the `debug` sourceSet.

This caused a bug on Android Chipmunk, as we included 'test' in the
'main' source set due to a change in how sourceSets were processed

Fixes 11291
Main comments: https://issuetracker.google.com/issues/232007221

https://issuetracker.google.com/issues/220326930

Originally added in ee463c2a3e
2022-05-12 11:36:03 -05:00
Mike Hardy
f731c47c5b fix(test): shorten time and use greaterThanOrEqualTo for sleep test 2022-05-12 09:06:28 -05:00
lukstbit
6f40e0211c Ignore image and audio paths check for text based fields 2022-05-12 08:21:50 -05:00
David Allison
1fa46e39b7 refactor: Kotlin Cleanup 2022-05-12 08:12:07 -05:00
David Allison
7813b56cab refactor: IDE Lint 2022-05-12 08:12:07 -05:00
David Allison
65eb32de13 refactor: Kotlin Cleanup: nullability 2022-05-12 08:12:07 -05:00
David Allison
03e41e7fe6 refactor: Kotlin Cleanup: nullability 2022-05-12 08:12:07 -05:00
David Allison
f80c4e8a3e refactor: Kotlin Cleanup: nullability 2022-05-12 08:12:07 -05:00
lukstbit
ca058f9226 Remove useless abstraction for IControllerFactory 2022-05-12 07:56:00 -05:00
David Allison
2902cff08d docs: Rationale for @NeedsTest
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
2022-05-12 07:46:05 -05:00
Jatin
df38bc3f49
[KotlinCleanup] AsyncDialogFragment.kt (#11287) 2022-05-12 10:02:58 +01:00
oyeraghib
888b518ac2 [Kotlin Cleanup] ListUtil 2022-05-11 09:18:05 -05:00
oyeraghib
e992dab68d [Kotlin Cleanup] Various 2022-05-11 09:02:18 -05:00
Nishant Bhandari
6148c90ebb
Allow only single imports on the .colpkg option. (#11303) 2022-05-11 08:47:06 -05:00
oyeraghib
20ff63ae8d [Kotlin Cleanup] CollectionTaskCheckDatabaseTest 2022-05-11 08:34:54 -05:00
lukstbit
6dff1b63c5 Remove code related to translation from project 2022-05-11 08:33:19 -05:00
lukstbit
8d9e79f90b Migrate FieldControllerBase.java to kotlin
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.
2022-05-11 08:17:27 -05:00
lukstbit
6807964cba Rename FieldControllerBase.java to .kt 2022-05-11 08:17:27 -05:00
oyeraghib
51059791c2 [Unit Test] ThreadUtilTest.kt 2022-05-11 08:08:20 -05:00
Mike Hardy
a145c032fd Bumped version to 2.16alpha65 2022-05-11 01:15:54 +00:00
lukstbit
078d4bd3b8 Migrate TagsList.java to Kotlin 2022-05-10 19:55:24 -05:00
lukstbit
663cc197cf Rename TagsList.java to .kt 2022-05-10 19:55:24 -05:00
lukstbit
05d3369abe Migrate RemoteMediaServer.java to Kotlin 2022-05-10 19:40:55 -05:00
lukstbit
dd90cff363 Rename RemoteMediaServer.java to .kt 2022-05-10 19:40:55 -05:00
AnkiDroid Translations
c9c54fa26a Updated strings from Crowdin 2022-05-10 18:27:07 -05:00
Brayan Oliveira
2d589f2bd0
Fix supportInvalidateOptionsMenu deprecation (#11312)
* 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
2022-05-10 18:26:39 -05:00
Mike Hardy
ae95643f1f
build(deps): Dependency updates 20220510 2022-05-10 18:07:18 -05:00
lukstbit
aaf54cd325 Refactor ArgumentUtils into BundleUtils 2022-05-10 17:51:05 -05:00
Jatin887
43ac8d071c [KotlinCleanup] TranslationActivity.kt 2022-05-10 15:19:04 -05:00
David Allison
efc9bf6d0c refactor: Convert MultimediaEditFieldActivity to Kotlin
com.ichi2.anki.multimediacard.activity.MultimediaEditFieldActivity
2022-05-10 15:00:39 -05:00
David Allison
832e932592 refactor: Rename MultimediaEditFieldActivity.java to .kt
com.ichi2.anki.multimediacard.activity.MultimediaEditFieldActivity
2022-05-10 15:00:39 -05:00
Prince kushwaha
d717a46c6e Migrate TokenizerTest.java to Kotlin 2022-05-10 10:58:50 -05:00
Prince kushwaha
4f3a8715fc Rename TokenizerTest.java to TokenizerTest.kt 2022-05-10 10:58:50 -05:00
dorrin-sot
4a24fc0228
fix: Overflow Icon Color Change on Config Change (Orientation Change) (#11061) 2022-05-10 10:54:39 -05:00
Jatin
9631e8f4e4
[KotlinCleanup] ActivityExportingDelegate.kt (#11289) 2022-05-10 10:14:54 -05:00
dorrin-sot
8728a9647f
Fixed A:: last deck not being escaped to "blank" (#11131) 2022-05-10 09:58:33 -05:00
Nishant Bhandari
3a1d5aedd7
feat: import multiple files (#10851) 2022-05-10 09:53:06 -05:00
puranjayK
15cd719ba5 Added test message explanations 2022-05-10 15:50:42 +01:00
Mahathi Vempati
30811aa2d3
Truncate Option in Card Browser (#10863) 2022-05-10 08:55:54 -05:00
Brayan Oliveira
5007e3d2fd Add inverse finish transitions on Card info command
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
2022-05-10 08:31:56 -05:00
Brayan Oliveira
cf0cfbb1cd Add inverse finish transitions on Add note and Edit note commands
Both are NoteEditor's actions, so they can be handled together
2022-05-10 08:31:56 -05:00
Brayan Oliveira
442b009a0e Move openCardInfo() to Reviewer.kt
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
2022-05-10 08:31:56 -05:00
Brayan Oliveira
10cbe75d81 Rename CALLER_REVIEWER to CALLER_REVIEWER_EDIT
Since there is a `CALLER_REVIEWER_ADD` constant, it wasn't clear what was the supposed use of `CALLER_REVIEWER`
2022-05-10 08:31:56 -05:00