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

16270 Commits

Author SHA1 Message Date
David Allison
2080c22c9a refactor: simplify showSimpleMessageDialog
* remove overrides
* make title non-null
* make NotificationChannel non-null
2022-08-23 20:56:54 -05:00
David Allison
fb480329f1 lint: Kotlin Cleanup 2022-08-23 20:56:54 -05:00
David Allison
997482b70a lint: fix IDE warnings
We couldn't remove the .toInt() call as we get a compiler
error about an ambiguous call, so extract to a constant
2022-08-23 20:56:54 -05:00
David Allison
5d08edb88c refactor: startActivity uses default animation
This means `requireActivity().finish()` will work on e-ink screens

See: https://github.com/ankidroid/Anki-Android/pull/11699
2022-08-23 20:56:54 -05:00
David Allison
28c82ef5c0 lint: AnkiActivity 2022-08-23 20:56:54 -05:00
David Allison
0c89553592 refactor: convert Finder to Kotlin
com.ichi2.libanki.Finder

Note: migrate.sh failed on this one
2022-08-23 20:47:16 -05:00
David Allison
b5706047c8 refactor: Rename Finder.java to .kt
com.ichi2.libanki.Finder
2022-08-23 20:47:16 -05:00
David Allison
b0f99d1b9a refactor: Convert Stats to Kotlin
com.ichi2.libanki.stats.Stats
2022-08-23 20:36:35 -05:00
David Allison
fff942cc01 refactor: Rename Stats.java to .kt
com.ichi2.libanki.stats.Stats
2022-08-23 20:36:35 -05:00
David Allison
1c7c042696 refactor: Convert Tokenizer to Kotlin
com.ichi2.libanki.template.Tokenizer

No KotlinCleanup as it'll be removed soon
2022-08-23 20:25:19 -05:00
David Allison
b59207279c refactor: Rename Tokenizer.java to .kt
com.ichi2.libanki.template.Tokenizer
2022-08-23 20:25:19 -05:00
David Allison
b74db7abea
refactor: Convert Note to Kotlin
com.ichi2.libanki.Note
2022-08-23 20:07:34 -05:00
David Allison
e51de07621 refactor: Rename Note.java to .kt
com.ichi2.libanki.Note
2022-08-23 19:51:05 -05:00
Arthur Milchior
c762f1af25 NF: browser use two columns explicitly
This should help #11460. Since there is exactly two occurrences, most of the
time, arrays obfuscate instead of improving readability. I believe this version
is more readable.
2022-08-23 19:48:28 -05:00
oakkitten
b290b4c0fd Show simple summaries for Sync url & Media sync url 2022-08-23 19:37:11 -05:00
oakkitten
f9fb22f7a3 Allow unsetting Sync url & Media sync url
When either of the settings is unset, AnkiWeb sync server is used. But
if you change any of these settings, you can't clear them.

This allows clearing the settings by inputting empty string.
This will save a string, not a null; however,
CustomSyncServer.getCollectionSyncUrlIfSetAndEnabledOrNull() will
return null for an empty string as well as for a null.
2022-08-23 19:37:11 -05:00
oakkitten
08cc851847 V16: Don't sync media if Fetch media on sync is off 2022-08-23 19:37:11 -05:00
oakkitten
0289859da7 V16: Use custom sync servers 2022-08-23 19:37:11 -05:00
oakkitten
184fa6a9d8 Do not hardcode /sync/ suffix in Sync url preference
Currently the preference Custom sync server -> Sync url must be
specified without the full endpoint path, e.g. http://foo:8080,
not http://foo:8080/sync/. The /sync/ path is hardcoded.
This is not optimal as:

* It's inconsistent with the preference Media sync url below;
* Anki uses the full URL in its --syncserver output, and expect the
  full URL in SYNC_ENDPOINT;
* Power users may want to use something other than /sync/ for security
  or other reasons.

This changes the preference to take arbitrary path, and migrates the
old preference.

In HttpSyncer.kt and RemoteMediaServer.kt I opted for creating
overridable methods getDefaultSyncUrl() and getCustomSyncUrlOrNull()
instead of putting everything into syncURL(). This is a tad un-pretty,
but it allows solving a slight issue with parseUrl() in a simple way.
parseUrl() used to called the now deleted isUsingCustomSyncServer()
to determine whether a custom URL was used; this was incorrect.
The latter would yield the state of the Use custom sync server switch
preference, however, even if the switch is on, the custom sync server--
collection or media--is not used if it is not set; instead, the default
AnkiWeb URL is used instead. This is confusing both in the code and
in the UI, and I hope it is eventually simplified.
2022-08-23 19:37:11 -05:00
Arthur Milchior
33e87964f9 NF: StorageTest's function parameters are non null 2022-08-24 02:26:40 +02:00
Arthur Milchior
06b513d85b NF: put storageTest strings as lateinit 2022-08-24 02:26:40 +02:00
Brayan Oliveira
8107a9c057 Use snackbars instead of toasts on the reviewer's actions 2022-08-23 22:09:31 +01:00
Brayan Oliveira
4c1e786d79 Adapt showSnackbarAboveAnswerButtons()
So it's easier to use it on different contexts
2022-08-23 22:09:31 +01:00
David Allison
1e7a8bcb1f refactor: extract 'showedActivityFailedScreen'
To be used in the App Intro which can't inherit from AnkiActivity

So we need this functionality extracted.
2022-08-23 17:14:58 -03:00
AnkiDroid Translations
d9b8064d00 Updated strings from Crowdin 2022-08-23 13:37:52 -05:00
Pratyaksh_Khurana
f8b029a8c9
remove method name from translatable string "import_error_copy_file_to_cache" (#12109) 2022-08-23 09:39:38 -05:00
AnkiDroid Translations
ec80ecde46 Updated strings from Crowdin 2022-08-23 09:39:09 -05:00
David Allison
f6c97cb7cf refactor: Convert PlotSheet to Kotlin
com.wildplot.android.rendering.PlotSheet

No KotlinCleanup annotation as this class will be removed soon
2022-08-23 08:25:44 +03:00
David Allison
eb1b3d7339 refactor: Rename PlotSheet.java to .kt
com.wildplot.android.rendering.PlotSheet
2022-08-23 08:25:44 +03:00
David Allison
d67c287685 refactor: Convert TextNoteExporterTest to Kotlin
com.ichi2.libanki.TextNoteExporterTest
2022-08-22 06:32:49 -03:00
David Allison
0a8262c7aa refactor: Rename TextNoteExporterTest.java to .kt
com.ichi2.libanki.TextNoteExporterTest
2022-08-22 06:32:49 -03:00
criticalAY
c0661fe56a Updated finishActivityWithFade
UP-FADE, changed
2022-08-21 15:49:30 -05:00
David Allison
894857d22c refactor: Convert Pow to Kotlin
com.wildplot.android.parsing.Pow
2022-08-21 13:45:05 -03:00
David Allison
b38c2b05ae refactor: Rename Pow.java to .kt
com.wildplot.android.parsing.Pow
2022-08-21 13:45:05 -03:00
David Allison
be7dd9f754
NF: Kotlin cleanup (#12126)
* lint: remove KotlinCleanup on deprecated classes

wildplot will go away once Statistics is moved to Rust.

No need to waste effort with Kotlin here.

* lint: Kotlin Cleanup - TextCardExporter

* lint: Kotlin Cleanup - FieldEditLineTest

* lint: Kotlin Cleanup - FieldData

* lint: Kotlin Cleanup - Collection

* lint: IDE Lint - RetryRule

* lint: Kotlin Cleanup - FieldEditLine
2022-08-21 19:44:29 +03:00
David Allison
acdc570d85 refactor: Convert AnkiActivity to Kotlin
com.ichi2.anki.AnkiActivity

Please note the changes to DeckPickerTest and SchedTest

Now .col will throw instead of returning null
2022-08-21 19:13:10 +03:00
David Allison
eb4d8c5f9a refactor: Rename AnkiActivity.java to .kt
com.ichi2.anki.AnkiActivity
2022-08-21 19:13:10 +03:00
David Allison
c85d7dea6a refactor: Convert ImportTest to Kotlin
com.ichi2.anki.tests.libanki.ImportTest
2022-08-21 15:42:46 +03:00
David Allison
62b4b95372 refactor: Rename ImportTest.java to .kt
com.ichi2.anki.tests.libanki.ImportTest
2022-08-21 15:42:46 +03:00
David Allison
42eb47f0d2 refactor: Convert AnkiPackageExporterTest to Kotlin
com.ichi2.libanki.AnkiPackageExporterTest
2022-08-21 11:36:20 +03:00
David Allison
1f375b425c refactor: Rename AnkiPackageExporterTest.java to .kt
com.ichi2.libanki.AnkiPackageExporterTest
2022-08-21 11:36:20 +03:00
David Allison
3ab56ff522 refactor: Convert StatsTest to Kotlin
com.ichi2.libanki.StatsTest
2022-08-21 10:40:55 +03:00
David Allison
bf7a6e12cf refactor: Rename StatsTest.java to .kt
com.ichi2.libanki.StatsTest
2022-08-21 10:40:55 +03:00
Damien Elmes
bbdbfaf9f9 Fix speed regression in browse screen with new schema
46c4f4d501 changed a single doProgress()
call to multiple ones. I suspect the speed improvements in that PR
came from checking cancellation at the top, and the other change was
not necessary.

Things got worse with the introduction of #11849, as the progress listener
is called it a hot loop, and it invokes colIsOpen() each time.

This change puts performance back on par with the legacy path; further
improvements should be possible in the future by switching to a recycler
view and another backend method: https://github.com/ankidroid/Anki-Android/issues/11889
2022-08-20 17:15:37 -05:00
Damien Elmes
70b1c15d72 Fix failing test when new schema enabled
a2eef40136 switched to using the backend
to find notes, but findDupes() was passing in an invalid search string
(single quotes are not supported)
2022-08-20 17:15:37 -05:00
fred-sab
f116f6537b
fix: close previous dialog after full sync dialog (#11862)
The sync check when adding a card should be the same as the sync check when removing a card. Therefore factor the code to fix the differences (and prevent future ones).
2022-08-20 16:34:06 -05:00
lukstbit
e4c7d9c2b6 Fix Rate menu item availability
In this PR:
- removed code related to rate menu item for help menu(this menu item is not shown in this dialog!)
- fix the rate menu visibility in the support help menu
- fix and improve tests related to the help/support menus
- add a test to check if the rate option is shown when device has app that can handle it
2022-08-20 11:28:23 -05:00
Mike Hardy
f59fe0ab87 fix emulator OutOfMemory by forcing zygote init race win via warm reboot
https://github.com/ankidroid/Anki-Android/issues/11091#issuecomment-1221325800
2022-08-20 10:47:31 -05:00
Mani
5c72117ff1
open card browser and search using ankimobile-style deep links (#11899) 2022-08-20 09:28:35 -05:00
David Allison
eeb59af652 refactor: Convert TemplateFilters to Kotlin
com.ichi2.libanki.template.TemplateFilters
2022-08-20 14:24:48 +05:30