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

8754 Commits

Author SHA1 Message Date
David Allison
2cadb48133 refactor: Convert Media to Kotlin
com.ichi2.libanki.Media

This adds functionality to allow nulls to be passed to DB's methods
2022-08-27 09:15:42 -05:00
David Allison
1dfde93ccc refactor: Rename Media.java to .kt
com.ichi2.libanki.Media
2022-08-27 09:15:42 -05:00
David Allison
d980933392 refactor: add MaterialDialog.iconAttr
Shortens repetitive code

Also removed a few unused parameters (required for compilation)

Fixes 11781
2022-08-27 08:05:17 -05:00
Divyansh Kushwaha
0a6c49f7b5 Deleted unused CollectionTask.AddNote
Last usage of this class has been removed in #11952. So it is being used no more.
2022-08-27 15:05:21 +03:00
Mike Hardy
233b88fe6f Bumped version to 2.16alpha82 2022-08-27 05:59:53 +00:00
David Allison
089eeef1f4 refactor: Convert Model to Kotlin
com.ichi2.libanki.Model
2022-08-27 00:29:02 -05:00
David Allison
f2e21130c5 refactor: Rename Model.java to .kt
com.ichi2.libanki.Model
2022-08-27 00:29:02 -05:00
David Allison
850e0fb2c1 refactor: Convert Decks to Kotlin
com.ichi2.libanki.Decks
2022-08-27 00:27:19 -05:00
David Allison
ef3fe1546a refactor: Rename Decks.java to .kt
com.ichi2.libanki.Decks
2022-08-27 00:27:19 -05:00
AnkiDroid Translations
2ab26312a4 Updated strings from Crowdin 2022-08-27 00:22:58 -05:00
David Allison
529bc11db7 feat: implement App Introduction System
* Displays the App Introduction System
* Handles only displaying it once
* Handles syncing if the app intro loads an existing AnkiWeb account
* (special case) Handles an upgrade from 2.15 -> 2.16 where
  the preference for the app intro was unset.
2022-08-26 23:39:35 -05:00
David Allison
b3a138035b feat: App Introduction System
A screen which appears on the first run of the application

Displaying:
* Get Started
* Sync from AnkiWeb

This aims to handle the use case of an existing user.
If they do not sync immediately, then they risk creating
two collections, which are incompatible and cause a sync conflict

Based on 9130 by Shridhar Goel
2022-08-26 23:39:35 -05:00
David Allison
fbe16e5df4 refactor: extract method 'wasFreshInstall'
Will be useful to call from 'DeckPicker'
2022-08-26 23:39:35 -05:00
David Allison
36a992cde0 design: backgrounds for 'introduction' activity
The Introduction activity is the first activity that users see
and therefore should be nicely designed.

* intro_gradient.xml
Contains a background gradient for the top of the introduction:
a blue to white/black gradient

* intro_ankidroid_logo:
Contains the AnkiDroid logo, encircled in a semi-transparent colour

* Due to bugs with `<aapt:attr>` in ankidroid_logo, in v21-23 this is
just the AnkiDroid logo with no transparent circle

Designed to go on top of intro_gradient
2022-08-26 23:39:35 -05:00
David Allison
c138dd5b7a feat: Activity to Login + Sync from AnkiWeb
We do not want to encourage a new AnkiDroid user to create an account

So this only allows a login, not a 'create account'
2022-08-26 23:39:35 -05:00
Brayan Oliveira
9f050a6041 Add option to enable the v3 sched 2022-08-26 23:38:09 -05:00
Brayan Oliveira
78f434e304 Add v3Enabled property to Collection
And override it on CollectionV16.kt
2022-08-26 23:38:09 -05:00
Brayan Oliveira
f67bb496cd Add "Allow sync on metered connections" preference
If disabled, auto-sync isn't triggered on metered connections and the user is asked if they want to continue if they trigger a manual sync

If enabled, sync occurs normally
2022-08-26 23:37:32 -05:00
Brayan Oliveira
100781df2f NF: make DeckPicker.automaticSync() more readable 2022-08-26 23:37:32 -05:00
Brayan Oliveira
e15e8191d4 Create an Advanced category under "Sync" preferences
for better organization
2022-08-26 23:37:32 -05:00
Brayan Oliveira
5d2c141ff8 NF: refactor isActiveNetworkMetered() 2022-08-26 23:37:32 -05:00
Brayan Oliveira
123cf288cf Extract isActiveNetworkMetered() 2022-08-26 23:37:32 -05:00
Brayan Oliveira
7bffd55f23 NF: remove more files from the legacy CSV importer implementation
which aren't used/useful anymore
2022-08-26 23:36:38 -05:00
AnkiDroid Translations
732ee4a80a Updated strings from Crowdin 2022-08-26 23:35:34 -05:00
Mike Hardy
40b4b750cc fix: type coercion fix in ContentProviderTest to fix build
this may not be the very best way, but it meets pre-Kotlin contracts,
and fixes the build now
2022-08-26 23:27:24 -05:00
David Allison
fa5c90eb21 refactor: Convert Utils to Kotlin
com.ichi2.libanki.Utils
2022-08-26 18:00:12 -05:00
David Allison
ad79bd7e66 refactor: Rename Utils.java to .kt
com.ichi2.libanki.Utils
2022-08-26 18:00:12 -05:00
David Allison
aec51a6a67 refactor: Convert Sound to Kotlin
com.ichi2.libanki.Sound

This introduced a bug in `removeFormattingFromMathjax`:

```
INSTANCE
java.lang.NoSuchFieldError: INSTANCE
	at com.ichi2.libanki.MathJaxClozeTest.removeFormattingFromMathjax(MathJaxClozeTest.kt:22)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.robolectric.RobolectricTestRunner$HelperTestRunner$1.evaluate(RobolectricTestRunner.java:591)
	at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$0(SandboxTestRunner.java:274)
	at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThread$0(Sandbox.java:88)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
	Suppressed: org.robolectric.android.internal.AndroidTestEnvironment$UnExecutedRunnablesException: Main looper has queued unexecuted runnables. This might be the cause of the test failure. You might need a shadowOf(Looper.getMainLooper()).idle() call.
```

Importing the method fixed this
2022-08-26 18:29:00 -03:00
David Allison
2c7832f4af refactor: Rename Sound.java to .kt
com.ichi2.libanki.Sound
2022-08-26 18:29:00 -03:00
David Allison
78ecb433cb refactor: Convert SchedTest to Kotlin
com.ichi2.libanki.sched.SchedTest
2022-08-26 13:01:34 -03:00
David Allison
8d8eeef893 refactor: Rename SchedTest.java to .kt
com.ichi2.libanki.sched.SchedTest
2022-08-26 13:01:34 -03:00
David Allison
236a0d63ab refactor: Convert ContentProviderTest to Kotlin
com.ichi2.anki.tests.ContentProviderTest
2022-08-26 12:56:14 -03:00
David Allison
b74b4a0fd0 refactor: Rename ContentProviderTest.java to .kt
com.ichi2.anki.tests.ContentProviderTest
2022-08-26 12:56:14 -03:00
David Allison
fab95690f2 refactor: Convert AnkiDroidApp to Kotlin
com.ichi2.anki.AnkiDroidApp
2022-08-26 17:28:25 +03:00
David Allison
2aab716452 refactor: Rename AnkiDroidApp.java to .kt
com.ichi2.anki.AnkiDroidApp
2022-08-26 17:28:25 +03:00
Arthur Milchior
26ae93b87b NF: factorize DeckPreferenceHack 2022-08-26 07:24:30 -05:00
David Allison
f1cc51008a refactor: Convert Models to Kotlin
com.ichi2.libanki.Models
2022-08-26 07:05:47 -05:00
David Allison
fa6ccb303d refactor: Rename Models.java to .kt
com.ichi2.libanki.Models
2022-08-26 07:05:47 -05:00
David Allison
456bad7d83 cleanup: make param non-null 2022-08-26 07:05:47 -05:00
lukstbit
f5a634ffbb Migrate CollectionTest.java to kotlin 2022-08-26 07:10:48 -03:00
lukstbit
0d66ebd9a5 Rename CollectionTest.java to .kt 2022-08-26 07:10:48 -03:00
lukstbit
9a3a89f3f5 Migrate Shared.java to kotlin 2022-08-26 06:03:46 -03:00
lukstbit
4abd985be7 Rename Shared.java to .kt 2022-08-26 06:03:46 -03:00
David Allison
d330cf39d9 refactor: KotlinCleanup - HandleEmptyCardListener 2022-08-26 08:55:47 +03:00
David Allison
5df3cc8fef refactor: KotlinCleanup - DeckPicker 2022-08-26 08:55:47 +03:00
Divyansh Kushwaha
632fa40a6b Early return in UpdateCardHandler 2022-08-26 04:39:18 +02:00
Divyansh Kushwaha
ee6908ae97 Simplified asynctask callbacks
When updating a single card, it is not required to show continuous progress since it a short task and user can be notified after the task has been finished. So instead of using onProgressUpdate callback, it is good to use onPostExecute for UI updates after the card has been updated.
2022-08-26 04:39:18 +02:00
AnkiDroid Translations
d3940212ad Updated strings from Crowdin 2022-08-25 20:31:06 -05:00
Brayan Oliveira
267255b3f2 Disable Statistics preferences if the new backend is enabled
They don't have an effect on the new Statistics page
2022-08-25 18:57:12 -05:00
Brayan Oliveira
11cfb9c9fc Add rust cleanups to remove Statistics and CardInfo 2022-08-25 18:57:12 -05:00