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

15168 Commits

Author SHA1 Message Date
codingtosh
2b43cd1e96 Fix #11100 : migrate.sh should give changed commit msg
"refactor: Convert fileName to Kotlin"
instead of
"refactor: Convert fileName.kt to Kotlin"
2022-04-26 15:30:07 -05:00
oyeraghib
2e748a6373 [Kotlin Cleanup] ExtendedFragmentFactoryTest.kt 2022-04-26 10:00:31 -05:00
dorrin-sot
4939304351
Made Focusable DeckOptions Preferences Auto-Focus (#11087)
* Made Focusable DeckOptions Preferences Auto-Focus
* Made Default AutoFocus behavior "Cursor at the end"
2022-04-26 09:41:08 -05:00
oyeraghib
611844a8d7 [Kotlin Cleanup] HtmlUtilsTest.kt 2022-04-26 09:25:22 -05:00
oyeraghib
b0abb84f67 [Kotlin Cleanup] MockTimeTest.kt 2022-04-26 09:18:42 -05:00
codingtosh
217430c44c refactor: Convert CardTemplatePreviewerTest.java to Kotlin
com.ichi2.anki.CardTemplatePreviewerTest
2022-04-26 09:09:07 -05:00
codingtosh
7aff669c45 refactor: Rename CardTemplatePreviewerTest.java to .kt
com.ichi2.anki.CardTemplatePreviewerTest
2022-04-26 09:09:07 -05:00
Prince kushwaha
fc2efb7778 Migrate UtilsTest.java to Kotlin 2022-04-26 08:56:02 -05:00
Prince kushwaha
8f3ab0b691 Rename UtilsTest.java to UtilsTest.kt 2022-04-26 08:56:02 -05:00
Brayan Oliveira
1d9462e669 Use same transition direction of swipe on Add note command 2022-04-26 08:42:39 -05:00
Brayan Oliveira
d6223f3d60 Use same transition direction of swipe on Card info command 2022-04-26 08:42:39 -05:00
Brayan Oliveira
3d792cb0bd Use same transition direction of swipe on Edit card command 2022-04-26 08:42:39 -05:00
Brayan Oliveira
542c8888c7 Add method to get same animation direction of a swipe gesture
If gesture is a swipe, return a transition to the same direction of the swipe.

Else return FADE as the default animation
2022-04-26 08:42:39 -05:00
Brayan Oliveira
25837c4349 Add fromGesture param to executeCommand()
This allows to know which gesture triggered the command
2022-04-26 08:42:39 -05:00
Brayan Oliveira
ecacf3105f Add DOWN animation transition
Inverse of the UP animation
2022-04-26 08:42:39 -05:00
Brayan Oliveira
ee27f6a459 Add RIGHT and LEFT animation transitions
Useful to explicitly use right or left transitions
2022-04-26 08:42:39 -05:00
Brayan Oliveira
479f5a920b Rename Direction.DOWN to DEFAULT
The DOWN animation direction was using the default Android animation, which isn't guaranteed to come from down
2022-04-26 08:42:39 -05:00
lukstbit
31887d14bb Migrate DeckTreeNode.java to Kotlin 2022-04-26 08:35:10 -05:00
lukstbit
7e929a3a41 Rename DeckTreeNode.java to .kt 2022-04-26 08:35:10 -05:00
Prince kushwaha
fa76516913 Migrate CardInfoModelTest.java to Kotlin 2022-04-26 08:26:13 -05:00
Prince kushwaha
c282792ec1 Rename CardInfoModelTest.java to CardInfoModelTest.kt 2022-04-26 08:26:13 -05:00
Jatin887
e668bb7b85 [KotlinCleanup] LoadPronunciationActivity.kt 2022-04-26 08:14:58 -05:00
AnkiDroid Translations
3dd5e0f6b8 Updated strings from Crowdin 2022-04-26 08:03:39 -05:00
Mike Hardy
1f2dc019d5 build(deps): remove ktlint memory leak workaround
It appears upstream has fixed the leak as of 0.45.0, so workaround
not needed, and ktlint is now on 0.45.2 anyway, so use that

Can't remove the actual version override that gets us 0.45.x until
the ktlint gradle plugin has a new release but that hasn't happened yet
2022-04-25 22:25:52 -05:00
Mike Hardy
88b60ef483 fix(build): assert that more than zero androidTests executed
Sometimes an emulator "runs" tests, but it actually discovered zero
tests, runs zero tests, and still reports success. Lookin' at you API21.

Fixes #11078
2022-04-25 22:25:52 -05:00
Mike Hardy
25473eeaff fix(build): lint-rules project should use common best build practices
extract our best-practices build settings to project-level file, apply
to all sub-projects

Fixes #11083
2022-04-25 22:25:52 -05:00
Mike Hardy
45e7c19f8b build(deps): lint-rules hamcrest use 2.2, extract hamcrest version
This is the recommended way to upgrade hamcrest from 1.x to 2.x when
using junit 4.x, see http://hamcrest.org/JavaHamcrest/distributables#gradle-upgrade-example
2022-04-25 22:25:52 -05:00
Mike Hardy
3e91bdc13e perf(ci): use gradle-build-action w/main cache only on all workflows
This should optimize LRU cache eviction so main and branches always have
reasonably fresh gradle caches and main does not ever get evicted, since
branches have independent caches and would otherwise fill up 10GB cache limit

Note that `--daemon` is specified as the default for this action is no daemon,
that is correct for long-lived runners to avoid cross-build contamination, but
on GitHub Hosted Runners (which we use) we are clean each run, so this is a small
optimization to share gradle between steps: https://github.com/gradle/gradle-build-action/issues/113#issuecomment-1003204780
2022-04-25 22:25:52 -05:00
Mike Hardy
fed9f97d87 build(deps): bump jacoco from 0.8.7 to 0.8.8 2022-04-25 22:25:52 -05:00
Mike Hardy
9de60878ba
build(deps): dependency updates 20220425
chore(deps): bump kotlin_version from 1.6.20 to 1.6.21  c275b35
chore(deps): bump mockito-inline from 4.4.0 to 4.5.0  0eee1e6
chore(deps): bump leakcanary-android from 2.7 to 2.9 (#10988)  72bede3
chore(deps): bump protobuf-java from 3.20.0 to 3.20.1  e79c835
chore(deps): bump leakcanary-android from 2.9 to 2.9.1  674c833
chore(deps): bump mockito-inline from 4.5.0 to 4.5.1  e790731
build(deps): kotlin stdlib deps are implicit now #10991
2022-04-25 11:07:21 -05:00
David Allison
f870ea277c fix(strings): missing positional string args
Plurals missing positional string args were previously
 not detected by either lint or AAPT2. A future PR will fix this
 and the code needs to have no issues.

To fix: rename:
`reviewer_window_title_days` -> `reviewer_window_title_days_new`
`reviewer_window_title_hours` -> `reviewer_window_title_hours_new`
and fix the strings: `%d` -> `%1$d`

I renamed the strings as:
* This was easier to do in the IDE, rather than deleting them
* They'll be overwritten on the next translation sync
  * and with less of a 'line change'

Issue 11072
Unblocks 11081 (adding the lint)
2022-04-25 07:21:26 -05:00
Yxx
d49ff89192 Kotlin Cleanup: AbstractFlashcardViewerTest.kt
Part of issue #10489

Update AbstractFlashcardViewerTest.kt

Fix a code style problem.

update`AbstractFlashcardViewerTest.kt`. Apply parameterized tests

update`AbstractFlashcardViewerTest.kt`. Clean the code style

Change the input parameter to tuple to improve the readability of the code

format the code style

fix code style
2022-04-24 15:18:57 -05:00
codingtosh
ced8ebb50b refactor: Convert CompatV21.kt to Kotlin
com.ichi2.compat.CompatV21
2022-04-24 15:08:26 -05:00
codingtosh
d2e651887f refactor: Rename CompatV21.java to .kt
com.ichi2.compat.CompatV21
2022-04-24 15:08:26 -05:00
David Allison
b1468a2425 fix: Don't apply lint to ignored file
tools:ignore ignores the outcome, but still processed the file

This caused a bug as it found a duplicate key in an ignored file

and flagged it as an error on the non-ignored file
2022-04-24 14:56:36 -05:00
Prince kushwaha
4c1c9390ca Migrate AnkiDroidAppTest.java to Kotlin 2022-04-24 14:33:56 -05:00
Prince kushwaha
760ea174a0 Rename AnkiDroidAppTest.java to AnkiDroidAppTest.kt 2022-04-24 14:33:56 -05:00
Mani
e3c3359e6e
[JS API] Reschedule card with x days (#11071) 2022-04-24 13:26:15 -05:00
Mike Hardy
b565d5b19c perf(ci, emulator): community emulator action / AVD caching / gradle cachine
Also adds an emulator run benchmarking suite that works in combo with matrix

If branch builds result in cache upload of emulator files the cache files there will
need to be scoped for just changes on the snapshot file(s)
2022-04-24 13:15:19 -05:00
Mani
14b3ac814b
feat: get list of addons model from json containing array of addons data (#11023) 2022-04-24 11:09:43 -05:00
codingtosh
8ac9d06227 [Kotlin Migration] ThreadUtils
Package: com.ichi2.anki.testutil
2022-04-24 11:02:40 -05:00
codingtosh
d7022ecb97 Rename ThreadUtils.java to .kt
Package: com.ichi2.anki.testutil
2022-04-24 11:02:40 -05:00
codingtosh
e799c5b56a [Kotlin Migration] InstrumentedTest
Package: com.ichi2.anki.tests
2022-04-24 10:55:37 -05:00
codingtosh
dce09cdfc5 Rename InstrumentedTest.java to .kt
Package: com.ichi2.anki.tests
2022-04-24 10:55:37 -05:00
codingtosh
fabb8d76aa [Kotlin Migration] DatabaseUtils
Package: com.ichi2.anki.testutil
2022-04-24 10:49:18 -05:00
codingtosh
299e51b71c Rename DatabaseUtils.java to .kt
Package: com.ichi2.anki.testutil
2022-04-24 10:49:18 -05:00
Brayan Oliveira
65bad3506c Convert ReviewerTest.kt to Kotlin 2022-04-24 10:40:23 -05:00
Brayan Oliveira
7aedbe8b90 Rename ReviewerTest.java to .kt 2022-04-24 10:40:23 -05:00
David Allison
625bb0ee38 feat(scoped-storage): let dialog execute migration 2022-04-24 10:24:26 -05:00
David Allison
bec3b346f1 fix: Don't apply strings lint to non-strings file
DuplicateCrowdInStrings applies to only the /values/ folder
But there are other files in the values folder aside from translatable
strings (resources, constants, etc...)

As lint does not currently have a good way to exclude files from linting
So instead we use `tools:ignore` to do this
2022-04-24 10:18:11 -05:00