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

14554 Commits

Author SHA1 Message Date
David Allison
41656b6b75 refactor(tests): Improve Performance
Add `EmptyApplication` as these tests don't depend on AnkiDroid

Shaves 40/50s off test time
2022-03-14 17:20:33 +05:30
Arthur Milchior
1d5ccb5620 NF: rename folder to directory
Simply for the sake of consistency. It will ensure that when searching for a
method, function or variable name, I have a single word to look for

This was done by a simple search and replace in .java and .kt files, preserving
case.

The only exception being org.junit.rules.TemporaryFolder and its method
`newFolder`, which obviously was not renamed.

Note that `folder` can't be entirely renamed to `directory` either because of
the class `DirectoryStream`. It seems even Java is not consistent between Folder
and directory
2022-03-14 16:12:07 +05:30
Arthur Milchior
79ea132f02 NF: factorize createPermissionDenied
It is used to factorize code repeated 6 times
2022-03-14 15:57:56 +05:30
Arthur Milchior
7df299e361 NF: Directory.createTransientDirectory return File
It was never actually used as a directory
2022-03-14 15:57:36 +05:30
Divyansh Kushwaha
504ecf07a2 removed redundant @KotlinCleanup from Preferences.kt 2022-03-14 10:22:10 +05:30
Divyansh Kushwaha
e99f828822
kotlin cleanup, changed variable name val -> value (#10519) 2022-03-13 18:06:51 +00:00
Prince kushwaha
29b8a3a88d Enable LogConditional lint 2022-03-13 15:04:10 +05:30
David Allison
e32b63c9b6 Convert WhiteboardMultiTouchMethods.java -> kt
com.ichi2.anki.WhiteboardMultiTouchMethods

No rename commit as git detects the rename
2022-03-13 14:47:25 +05:30
Kilian Trosien
99cc0bc6aa [Kotlin Cleanup] BackupManager
- In DeckPickerNoSpaceToDowngradeDialogRemoving: removing collection's nullability was a minimal necessary change in order achieve compilation.
- In BackupManagerTest: replaced empty string by collection's default path to avoid test failure caused by NPEs. The affected method should have not be called with an empty string describing the path beforehand.
2022-03-13 01:59:05 +01:00
Akarsh Shukla
3c7b56d88f removing translatable 2022-03-12 23:12:03 +01:00
Akarsh Shukla
ffbd97c31c lowercase string resources 2022-03-12 23:12:03 +01:00
Akarsh Shukla
2b32adefc6 Removing changes in README.md 2022-03-12 23:12:03 +01:00
Akarsh Shukla
e67a129b62 debugging after lint tests 2022-03-12 23:12:03 +01:00
Akarsh Shukla
121bc037f3 transferring preferences.xml to values 2022-03-12 23:12:03 +01:00
Akarsh Shukla
e3258f79c0 replacing string literals with string constants in preferences_reviewing.xml' 2022-03-12 23:12:03 +01:00
Mike Hardy
a9ca2cfa85 Bumped version to 2.16alpha50 2022-03-11 23:39:06 +00:00
AnkiDroid Translations
9876bf44e7 Updated strings from Crowdin 2022-03-11 17:52:21 -05:00
dependabot[bot]
d71e10a1ca chore(deps): bump mockito-inline from 4.3.1 to 4.4.0
Bumps [mockito-inline](https://github.com/mockito/mockito) from 4.3.1 to 4.4.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v4.3.1...v4.4.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-inline
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-11 17:35:06 -05:00
Shridhar Goel
82a02f7858 Enhancements in CardBrowserMySearchesDialog.kt 2022-03-11 17:01:52 -05:00
puranjayK
36296fc8c2 Migrate Consts to Kotlin 2022-03-11 16:51:30 -05:00
puranjayK
660d121261 Rename .java to .kt 2022-03-11 16:51:30 -05:00
gradle-update-robot
5511174a50 Update Gradle Wrapper from 7.4 to 7.4.1.
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2022-03-11 16:22:11 -05:00
Brayan Oliveira
0ff7914183 Add show all hints gesture/command 2022-03-11 15:31:12 -05:00
Brayan Oliveira
1bab66d297 Add show hint gesture/command 2022-03-11 15:31:12 -05:00
Kilian Trosien
d2475449d4 Migrate TaskListenerWithContext.java to Kotlin 2022-03-11 14:50:51 -05:00
Kilian Trosien
d18e2c8139 Rename .java to .kt 2022-03-11 14:50:51 -05:00
Mike Hardy
a0642f573e
fix(kotlin): point to MAIN by default so PRs do not have conflicts 2022-03-11 14:36:02 -05:00
David Allison
796dd88726 refactor(scoped-storage): rename parameter
context -> throwingOperation
2022-03-11 20:28:31 +01:00
David Allison
b66fc61407 feat(scoped-storage): Retry DeleteEmptyDirectory
If DeleteEmptyDirectory fails, we want to perform
the MoveDirectory that spawned it

This could happen for many reasons, such as a failed file
move, or adding a file to `AnkiDroid` during the process
2022-03-11 20:28:31 +01:00
David Allison
d4635f629d refactor(scoped-storage-test): Introduce executor
A future commit will want to handle accessing the queue
 while the executor is executing. executeAll() did not allow this

So provide an executor which has the list of operations public

The general design is TBC, but the functionality will be used in prod
2022-03-11 20:28:31 +01:00
David Allison
c109e84508 refactor(java-to-kotlin): JSONObjectTest
com.ichi2.utils.JSONObjectTest

Removed tests:
* testAccumulateNull
* testGet
* testNullKeys
2022-03-11 14:21:48 -05:00
David Allison
2fb7a58b42 Rename JSONObjectTest.java to .kt
com.ichi2.utils.JSONObjectTest
2022-03-11 14:21:48 -05:00
Murugappan
3ea7b3630f
Image paste clipboard (#10320)
Co-authored-by: David Allison <62114487+david-allison-1@users.noreply.github.com>
2022-03-11 06:05:06 +01:00
Arthur Milchior
eb34dbb381 Test for missing permission
Normally, this commit tests every cases which indirectly access the list of files of a
folder and which . I.e.
* Directory's hasFile
* MoveDirectoryContent.createInstance
* DeleteDirectory.execute
* MoveDirectory executeAll
2022-03-10 20:42:48 -05:00
Arthur Milchior
ad3c10bc3c NF: move Test21And26 to compat folder
This is actually only related to compat interface. Plus, it will be necessary in
next commit to access a compat protected method
2022-03-10 20:42:48 -05:00
Rowan Decker
e763f9931a Add option to show all deck stats by default
This option is useful to anyone who wants to know "how many cards did I
study today (in total), and how many cards are due tomorrow (in total)".
In this situation it can save a few clicks and scrolls which can be slow
on e-ink displays.

Some additional context:
If using a single "To Review" filtered deck then stats are pretty
meaningless. For instance "Studied 3 cards in 0 minutes today". To
find the real statistics after studying with a filtered deck I have
to select "All decks" and then I correctly see "Studied 491 cards in
25 minutes today".
2022-03-10 19:15:20 -05:00
Brayan Oliveira
803da9df20 Update hamcrest-all:1.3 to hamcrest:2.2
The package name was updated in 2.0.
Handled deprecations:
isOneOf -> oneOf
isEmptyString -> emptyString
isEmptyOrNullString -> emptyOrNullString
2022-03-10 14:09:16 -05:00
Mike Hardy
0aa58b7b56 Bumped version to 2.16alpha49 2022-03-09 11:31:14 +00:00
krmanik
192d4062d6 tts field modifier
return false for now for tts - js api
2022-03-08 17:00:15 -05:00
Bishyan Kar
02e07d1eb2
#10442 Preferences title isn't reupdated after opening a screen optio… (#10457)
* #10442 Preferences title isn't reupdated after opening a screen option bug fixed

* Code quality improvement
2022-03-08 16:35:30 -05:00
David Allison
0d594b58e2 refactor(preferences): hasAnkiWebAccount
.isNotEmpty() removes a reference to Android as it's kotlin stdlib
2022-03-08 16:34:50 -05:00
David Allison
80b6d6d6db refactor(preferences): getDayOffset
`1` and `else` were equivalent
2022-03-08 16:34:50 -05:00
David Allison
8e3df1ad6f docs(preferences): SchedV2 is completed 2022-03-08 16:34:50 -05:00
David Allison
0ef6f4590e refactor(preferences): replaceString nullability
And documented

mOriginalSummaries is set to "" if unavailable, so return the same
2022-03-08 16:34:50 -05:00
David Allison
15818fc56c refactor(preferences): updateSummary nullability 2022-03-08 16:34:50 -05:00
David Allison
b69339bbbc lint(preferences): fix most issues
* 'protected' visibility is effectively 'private' in a final class
* Variable is same as 'X' and can be inlined
* Cascade if should be replaced with when
* Fix variable names
* Always returns null type
2022-03-08 16:34:50 -05:00
David Allison
8687479ae4 refactor(preferences): rename variable
typo: mOriginalSumarries => mOriginalSummaries
2022-03-08 16:34:50 -05:00
AnkiDroid Translations
4cb0d28477 Updated strings from Crowdin 2022-03-08 16:34:31 -05:00
dependabot[bot]
0543e13470 chore(deps): bump jackson-databind from 2.13.1 to 2.13.2
Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.1 to 2.13.2.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-08 14:39:43 -05:00
Arthur Milchior
55608f02ff NF: introduce Test21And26
This allow CompatHelper to return V21 and V26. Useful for cases where the only
difference between version is only in Compat.
2022-03-08 13:28:02 -05:00