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

15431 Commits

Author SHA1 Message Date
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
Nishant
6957e562fc Bumped API version due to kotlin visibility change on package protected 2022-05-12 09:21:07 -05:00
Nishant
f5c8c5ebb7 Migrate BasicModel to Kotlin 2022-05-12 09:21:07 -05:00
Nishant
e87ddac85e Rename .java to .kt 2022-05-12 09:21:07 -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
David Allison
e136d85362 docs: better explain cleanup annotation 2022-05-11 05:02:32 +01:00
David Allison
853d76de7d refactor: kotlin cleanup - documentation fix
No semicolons in Kotlin
2022-05-11 05:02:32 +01:00
David Allison
d597bbd2db refactor: kotlin cleanup - improve readability
add method: removeHungarianPrefix and document it
2022-05-11 05:02:32 +01:00
David Allison
e8c79f0f84 refactor: kotlin cleanup - shorten method 2022-05-11 05:02:32 +01:00
David Allison
e264e0260e refactor: remove requireNonNull
No longer required
2022-05-11 05:02:32 +01:00
David Allison
f7374d23ac refactor: Kotlin Cleanup: use listOf
Reduction in code without reduction of readability
2022-05-11 05:02:32 +01:00
David Allison
56fcdf4922 refactor(lint-rules): fix IDE lint
Removes all IDE lint warnings from the non-test Kotlin classes
2022-05-11 05:02:32 +01:00
David Allison
330854683f refactor: ignore "UnstableApiUsage" lint warnings
We're aware that these classes are using `@Beta` functionality

Removes a lot of IDE lint warnings
2022-05-11 05:02:32 +01:00
Mike Hardy
a145c032fd Bumped version to 2.16alpha65 2022-05-11 01:15:54 +00:00
David Allison
168407e8f0 refactor: Convert DirectSystemTimeInstantiation to Kotlin
com.ichi2.anki.lint.rules.DirectSystemTimeInstantiation
2022-05-10 20:14:25 -05:00
David Allison
c964b1fae6 refactor: Rename DirectSystemTimeInstantiation.java to .kt
com.ichi2.anki.lint.rules.DirectSystemTimeInstantiation
2022-05-10 20:14:25 -05: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
David Allison
9ae744759a refactor: Convert Constants to Kotlin
com.ichi2.anki.lint.utils.Constants
2022-05-10 19:26:31 -05:00
David Allison
966b0142c1 refactor: Rename Constants.java to .kt
com.ichi2.anki.lint.utils.Constants
2022-05-10 19:26:31 -05:00
David Allison
dcba4fbd3a refactor: Convert JavaFieldNamingPatternDetector to Kotlin
com.ichi2.anki.lint.rules.JavaFieldNamingPatternDetector
2022-05-10 19:17:42 -05:00
David Allison
22ddbe7c67 refactor: Rename JavaFieldNamingPatternDetector.java to .kt
com.ichi2.anki.lint.rules.JavaFieldNamingPatternDetector
2022-05-10 19:17:42 -05:00
David Allison
a8ff459281 refactor: Convert StringFormatDetector to Kotlin
com.ichi2.anki.lint.utils.StringFormatDetector
2022-05-10 19:04:53 -05:00
David Allison
884ce1065f refactor: Rename StringFormatDetector.java to .kt
com.ichi2.anki.lint.utils.StringFormatDetector
2022-05-10 19:04:53 -05:00
David Allison
5548273bdd refactor: Convert LintUtils to Kotlin
com.ichi2.anki.lint.utils.LintUtils
2022-05-10 18:55:24 -05:00
David Allison
abb3220e68 refactor: Rename LintUtils.java to .kt
com.ichi2.anki.lint.utils.LintUtils
2022-05-10 18:55:24 -05:00
David Allison
1440013117 refactor: Convert ImportStatementDetector to Kotlin
com.ichi2.anki.lint.lint.ImportStatementDetector
2022-05-10 18:41:35 -05:00
David Allison
4721645e94 refactor: Rename ImportStatementDetector.java to .kt
com.ichi2.anki.lint.lint.ImportStatementDetector
2022-05-10 18:41:35 -05:00