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

16099 Commits

Author SHA1 Message Date
Prince kushwaha
5f94a5ebd1 Migrate BackendEmulatingOpenConflictTest.java to kotlin 2022-07-30 13:24:24 -05:00
Prince kushwaha
35133dd3e7 Rename BackendEmulatingOpenConflictTest.java to to BackendEmulatingOpenConflictTest.kt 2022-07-30 13:24:24 -05:00
Mohd Raghib
f9020b3092
cleanup: add scope function in CardTemplateBrowserAppearanceEditor (#11749)
* add scope function for Intent
Added .apply{} scope function for getIntent()
* IDE lint
* add: scope function
Added .apply{} scope function for data Intent
2022-07-30 13:22:40 -05:00
Prince kushwaha
d8f80b30eb Migrate TimePreferenceTest.java to Kotlin 2022-07-30 13:15:55 -05:00
Prince kushwaha
870e943545 Rename TimePreferenceTest.java to TimePreference.kt 2022-07-30 13:15:55 -05:00
dorrin-sot
2eeeaa1ccd updateSearchItemQA isEmpty 2022-07-30 13:11:42 -05:00
lukstbit
39383c9032 Fix onActivityResult deprecation for NavigationActivity
Replaces the deprecated onActivityResult with the newer ActivityResultLauncher apis.
2022-07-30 13:08:11 -05:00
Mohd Raghib
9cd43789b8
some cleanups in Collection.kt (#11941)
* cleanup: IDE lint for render_output_legacy() function

* cleanup: IDE lint for _renderQA() function

* cleanup: replaced with Kotlin function

* cleanup: use Kotlin's Random library instead of Java

after using Kotlin's Random there was no need for scope functions so removing that KotlinCleanup was ideal here.
2022-07-30 19:56:57 +02:00
dorrin-sot
86e72f4ec5 Fix Answer Buttons Pos "None" hiding everything else 2022-07-30 12:55:22 -05:00
Brayan Oliveira
9703ac7bb2 Move DevOptionsSettingsFragment to a new file 2022-07-30 19:36:56 +02:00
Brayan Oliveira
1ce7827acc Move ControlsSettingsFragment to a new file 2022-07-30 19:36:56 +02:00
Brayan Oliveira
aa2758cd45 Move CustomSyncServerSettingsFragment to a new file 2022-07-30 19:36:56 +02:00
Brayan Oliveira
81ce07cf67 Move AdvancedStatisticsSettingsFragment to a new file 2022-07-30 19:36:56 +02:00
Brayan Oliveira
1e3f04f1d7 Move CustomButtonsSettingsFragment to a new file 2022-07-30 19:36:56 +02:00
Brayan Oliveira
89fcddef97 Move AdvancedSettingsFragment to a new file 2022-07-30 19:36:56 +02:00
Brayan Oliveira
8176e781b3 Move AppearanceSettingsFragment to a new file 2022-07-30 19:36:56 +02:00
Brayan Oliveira
d9ccf2dfee Move SyncSettingsFragment to a new file 2022-07-30 19:36:56 +02:00
Brayan Oliveira
2b46172788 Move ReviewingSettingsFragment to a new file 2022-07-30 19:36:56 +02:00
Brayan Oliveira
ef3ddc9a92 Move GeneralSettingsFragment to a new file 2022-07-30 19:36:56 +02:00
Brayan Oliveira
9146710893 Move SettingsFragment to a new file 2022-07-30 19:36:56 +02:00
Brayan Oliveira
dc4f5de817 Move HeaderFragment to a new file 2022-07-30 19:36:56 +02:00
Brayan Oliveira
2b1e982b72 Rename preferences_acessibility.xml to preferences_accessibility.xml
There was a typo
2022-07-30 19:36:56 +02:00
Mike Hardy
c221f11eb8 Bumped version to 2.16alpha76 2022-07-27 17:56:44 +00:00
AnkiDroid Translations
abcf3f7a2b Updated strings from Crowdin 2022-07-27 12:54:49 -05:00
Damien Elmes
d02093dcdc Fix some connected tests failing when legacy_schema=false
Some were irrelevant; the ones in ContentProviderTest need investigating.
2022-07-27 09:21:52 -05:00
Damien Elmes
2181d90787 Fix LeakCanary warning when changing language/v16 schema
After discarding the backend, Preferences was calling getCol and passing
itself in as the context. This caused the preferences screen to be retained
as the backend lives on. By switching to AnkiDroidApp, a leak can be
avoided.
2022-07-27 09:21:52 -05:00
Damien Elmes
b72755563d Backend language tweaks
- Move logic from backend into frontend, so a new backend release is
not required
- Fix mapping of Chinese languages and Hindi; check others
- Don't require a restart after changing language in prefs
2022-07-27 09:21:52 -05:00
Damien Elmes
712ec6b48e Use backend to calculate legacy timezone
I expect this fixes #9368

Bumps the backend version, since the API changed.

Closes #11881
2022-07-27 09:21:52 -05:00
Damien Elmes
66bbd569f7 Add V3 scheduler tests
Like the desktop, this works by using a single set of tests that
alter some of the checks depending on the active scheduler version,
so that code duplication is avoided.
2022-07-27 09:21:52 -05:00
Damien Elmes
348e03efc0 Add support for the V3 scheduler 2022-07-27 09:21:52 -05:00
Damien Elmes
bcfd3a0770 Split majority of AbstractSched into BaseSched
- Mirrors the code layout of the desktop version, where routines like
buryCard(), that are not specific to V2 or V3, are stored in a separate
file. This leaves AbstractSched containing only the methods that will
need to be implemented separately for V3.
- Moves some methods from SchedV2 into BaseSched, as V3 will want to
use them as well for now.
- Some of the routines in BaseSched will only work with a schema upgrade.
For now, SchedV2 overrides these so they continue to work with the
legacy schema.
2022-07-27 09:21:52 -05:00
Damien Elmes
a6c0cdc3af Remove setReportLimit()
It was introduced due to #5666, but AnkiWeb has ignored the due counts
in the sanity check for about 18 months, so this is no longer necessary.

Also remove _updateCutoff() and _checkDay() from the public API.
2022-07-27 09:21:52 -05:00
Damien Elmes
3c32c7669a Reduce the API surface of AbstractSched
Initial prep work for adding the V3 scheduler. Removed some methods that
are only used internally, and defined some overloads concretely.

eta() implementation in v1 appeared to be functionally identical to v2,
despite the comment.
2022-07-27 09:21:52 -05:00
Damien Elmes
142f789a7b Require V1 scheduler users to update when they try to study
Studying with the V1 scheduler enabled is no longer possible on recent
Anki, AnkiMobile or AnkiWeb versions, so AnkiDroid is the last one
still supporting it. Pushing users to upgrade will save them from some
of the footguns V1 had, and will allow AnkiDroid to cut out some code
and tests. Many users have likely already upgraded due to the use of
the other clients.

This commit adds support for the backend upgrade code, so that learning
cards will not be reset on upgrade. To make use of this, users will be
automatically updated to the latest schema version, the scheduler
upgrade will be performed, and then they're moved back to the legacy
schema.

I've also added a helper to more ergonomically deal with schema changes.
2022-07-27 09:21:52 -05:00
Mike Hardy
b481023b7b Bumped version to 2.16alpha75 2022-07-25 14:39:10 +00:00
Arthur Milchior
2334564bf4 NF: uses "when" in filtered deck options 2022-07-25 06:28:14 +03:00
dependabot[bot]
cebd64cb82 Bump protobuf-kotlin from 3.21.2 to 3.21.3
Bumps protobuf-kotlin from 3.21.2 to 3.21.3.

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-kotlin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-24 21:22:52 -05:00
dependabot[bot]
07fbaa7a07 build(deps): bump Android-Image-Cropper from 4.3.0 to 4.3.1
Bumps [Android-Image-Cropper](https://github.com/CanHub/Android-Image-Cropper) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/CanHub/Android-Image-Cropper/releases)
- [Changelog](https://github.com/CanHub/Android-Image-Cropper/blob/main/CHANGELOG.md)
- [Commits](https://github.com/CanHub/Android-Image-Cropper/compare/4.3.0...4.3.1)

---
updated-dependencies:
- dependency-name: com.github.CanHub:Android-Image-Cropper
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-24 21:22:52 -05:00
dependabot[bot]
d3f5b438fa Bump kotlinx-coroutines-test from 1.6.3 to 1.6.4
Bumps [kotlinx-coroutines-test](https://github.com/Kotlin/kotlinx.coroutines) from 1.6.3 to 1.6.4.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.6.3...1.6.4)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-test
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-24 21:22:52 -05:00
dependabot[bot]
1522aa87dd Bump kotlin_version from 1.7.0 to 1.7.10
Bumps `kotlin_version` from 1.7.0 to 1.7.10.

Updates `kotlin-gradle-plugin` from 1.7.0 to 1.7.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

Updates `kotlin-stdlib` from 1.7.0 to 1.7.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

Updates `kotlin-reflect` from 1.7.0 to 1.7.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

Updates `kotlin-test` from 1.7.0 to 1.7.10
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/commits)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-gradle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin:kotlin-stdlib
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin:kotlin-reflect
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin:kotlin-test
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-24 21:22:52 -05:00
dependabot[bot]
bf7a5b5e36 Bump kotlinx-coroutines-test from 1.6.2 to 1.6.3
Bumps [kotlinx-coroutines-test](https://github.com/Kotlin/kotlinx.coroutines) from 1.6.2 to 1.6.3.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.6.2...1.6.3)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-test
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-24 21:22:52 -05:00
AnkiDroid Translations
b18a23dd10 Updated strings from Crowdin 2022-07-24 16:42:16 -05:00
Divyansh Kushwaha
7ff2a54f85 fixed automatic creation of deck with name 'All decks' 2022-07-24 14:41:35 -05:00
AnkiDroid Translations
3e2d495f6d Updated strings from Crowdin 2022-07-24 14:40:54 -05:00
Arthur Milchior
bc78279662 Remove splitFieldsShouldReturnNullWhenStringIsNull
This method do not take nullable value anymore. And it seems that even from
java's code, it can't be called with nullable value, since it's only called from
either literals or result of Cursor. I.e. strings that are not null by
assumption about the database.
2022-07-24 14:40:34 -05:00
Arthur Milchior
fb385b8647 Remove splitTagsShouldReturnNullWhenStringIsNull
This method do not take nullable value anymore. And it seems that even from
java's code, it can't be called with nullable value, since it's only called from
result of Cursor. I.e. strings that are not null by assumption about the database.
2022-07-24 14:40:34 -05:00
Arthur Milchior
2442dfc882 ApiUtilsTest: remove override ambiguity
This test failed to compile because it did not know whether to use (Object,
Object) or (long, long).
2022-07-24 14:40:34 -05:00
dorrin-sot
05bf9ffcce
[Kotlin Cleanup] Cardbrowser pt16 (#11473)
* onOptionsItemSelected action_reposition_cards new filter cleanup

* convert concat string to template

* remove unnecessary `ArrayList`s

* made dialogs in R.id.action_reposition_cards have named args

* bring back val selectedCardIds = selectedCardIds
2022-07-24 19:26:26 +02:00
Brayan Oliveira
5231c73381 Add Preference.setOnPreferenceChangeListener helper method
In order to reduce boilerplate of ignoring the first parameter and adding true to its end
2022-07-24 19:10:19 +02:00
Brayan Oliveira
33fc04b2d0 **Unify SettingsFragment with SpecificSettingsFragment
Possible now that the preferences are initialized on their respective screens

- Remove the repetition of `addPreferenceResource` on the start of every `initSubscreen()` and add it on `refreshScreen()`
- Inline `val screenName = analyticsScreenNameConstant`
2022-07-24 19:10:19 +02:00