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

19394 Commits

Author SHA1 Message Date
AnkiDroid Translations
b01fdd3a45 Updated strings from Crowdin 2024-06-05 16:31:20 +00:00
Robozinho
149116c45b Productionise webview ≥ 77 check
fixes 15855

Co-authored-by: aayush-tripathi <112811133+aayush-tripathi@users.noreply.github.com>
2024-06-05 16:27:16 +00:00
Sumit Singh
5c89baba40 lint to avoid using android.app.AlertDialog 2024-06-05 15:04:40 +00:00
Moreno
8e1c71a54c use appcompat AlertDialog 2024-06-05 13:26:45 +00:00
David Allison
de409a5b96 fix(tests): change subscription - flaky
This was caused because a WeakReference
to the lambda was used, which went out of scope.

This meant `changes` was not incremented

CardBrowserViewModel:
* suspend - notes - some cards suspended
* suspend - notes - all suspended
* etc...

Fixes 16541
2024-06-05 13:23:55 +00:00
David Allison
960951fb27 fix: close WorkManager test DB
A number of errors were produced
2024-06-05 08:59:08 +00:00
David Allison
b3e96fce88 chore(card-browser): logs
* moved setup higher in setUp to capture more

Diagnostics for https://redirect.github.com/ankidroid/Anki-Android/issues/16541
2024-06-05 08:59:08 +00:00
David Allison
aec1987ceb tests(card-browser-view-model): export data 2024-06-05 08:56:00 +00:00
David Allison
f2cca9332b test: improve 'getLatestAlertDialog' error
Previously this resulted in a `NullPointerException`

before:
```
java.lang.NullPointerException: null cannot be cast to non-null type androidx.appcompat.app.AlertDialog
```

after:
```
org.opentest4j.AssertionFailedError: A dialog should be displayed ==> expected: not <null>
```

Seen in https://redirect.github.com/ankidroid/Anki-Android/pull/16529
2024-06-04 16:54:00 +00:00
David Allison
812fd2cbc2 chore(card-browser): logs
Diagnostics for https://redirect.github.com/ankidroid/Anki-Android/issues/16541
2024-06-04 16:50:30 +00:00
David Allison
b5acdca0ab fix(note-editor): filtered card sent home after edit
If a card in a filtered deck was edited, it was
returned home

Cause: b455b7b135

Fixes 16522
2024-06-04 11:49:04 +00:00
Mike Hardy
8d5d3dac93 test(custom-scheduler): add retries, re-enable in CI
with appropriate retries it appears to work reliably
2024-06-03 18:12:35 +00:00
Mike Hardy
7030339ed8 test(reviewer): accept different view names for custom scheduler tests
without this, `./gradlew jacocoAndroidTestReport` would not work on the command
line, but the tests would work in Android Studio, which is quite bizarre
2024-06-03 18:12:35 +00:00
AnkiDroid Translations
c3da9b615f Updated strings from Crowdin 2024-06-03 18:09:21 +00:00
sargamgayatri0803@gmail.com
9c949d616e focus keyboard on RenameCardTemplateDialog 2024-06-03 18:08:11 +00:00
Ashish Yadav
dfe33b6b79 refactor: activity to use viewModel to set warning
* added TODOs to the viewModel and activity
2024-06-03 17:26:14 +00:00
Ashish Yadav
1481492b59 set the activity to dev only 2024-06-03 17:26:14 +00:00
Ashish Yadav
ba546f229e feature: Instant Note Editor to allow adding cloze card
* Activity to support adding notes without opening AnkiDroid
* Text surround helper to tap and turn to cloze
* unitTest: InstantEdtitorViewModel unit test
2024-06-03 17:26:14 +00:00
AnkiDroid Translations
98a40e77a0 Updated strings from Crowdin 2024-06-03 17:06:50 +00:00
David Allison
09b17d3ffc fix: <audio> elements didn't play
This appears to be due to us handling HTTP 206 incorrectly
('Partial Content')

`net::ERR_FAILED` was returned from subsequent calls
- this appears to be because we were pre-truncating
the stream to be the correct length

Although this worked in NanoHTTPD, returning the full
file stream provided a correct `Content-Length` header
implying that somewhere in the framework, truncation
was occurring

Approach
* provide the file stream rather than truncating it
* (non-fatal): fix 'Accept-Ranges' header
* remove: File.toInputStream

Fixes 16513
2024-06-03 16:45:47 +00:00
Mike Hardy
74feec0a3d fix(i18n): file 15-markettitle.txt is gone, remove remnants
Related to PR 16348 - the file is no longer needed as it was
for the special (now defunct) ChromeOS store. We stopped processing
it, but we were still uploading it for translation (and the file was
still up in crowdin so being downloaded...)
2024-06-03 12:02:52 +00:00
Shruti Gitte
4396544bfb
refactor: extract text/plain as constant (#16518)
* refactor: extract text/plain as constant

* remove extra constant

* refactor:constant location
2024-06-03 08:35:59 +01:00
David Allison
c848579ba7 test(card-browser-view-model): suspend 2024-06-02 23:20:08 +00:00
David Allison
f0578c4b0b chore(card-browser): refactor 'suspendCards'
* rename to toggleSuspendCards
* Add method description
* launch in viewModelScope
2024-06-02 23:20:08 +00:00
David Allison
b81948d806 test(card-browser-view-model): sort order 2024-06-02 23:20:08 +00:00
Ashish Yadav
f8784da930 feat: Display custom flag names
Anki's 'Browse' allows a user to rename flags

Support displaying these custom names
not setting them

Fixes 16204
2024-06-02 12:57:40 +00:00
Mike Hardy
a2a109caa8 Bumped version to 2.19alpha4 2024-06-02 02:52:20 +00:00
David Allison
8d04cc69db tests(card-browser-view-model): column indices
Add tests:
* changing column index 1
* changing column index 2

This does not handle checking for config
changes on init

To improve coverage
2024-06-01 23:19:36 +00:00
David Allison
dbd9cbcd6e fix(card-browser-view-model): column indices
* do not update config on init
2024-06-01 23:19:36 +00:00
David Allison
f688c1ce74 test(card-browser-view-model): selected ids
selected card and note ids

To improve coverage
2024-06-01 23:19:36 +00:00
David Allison
ee1dcd8571 test(card-browser-view-model): selected rows
This also introduces Turbine, a Google-recommended library for testing flows

https://github.com/cashapp/turbine

https://developer.android.com/kotlin/flow/test

Accessed 2024-05-27
2024-06-01 23:19:36 +00:00
David Allison
0acdba3359 fix(card-browser): incorrect 'notes' sort order
Issue: when moving to 'cards or notes'
We used 'sortType' instead of 'noteSortType'

Then when we loaded it from the collection, it caused problems

Caused:

```
com.ichi2.libanki.exception.InvalidSearchException: net.ankiweb.rsdroid.exceptions.BackendInvalidInputException: Can't sort Notes by Custom.
  	at com.ichi2.libanki.Collection.findNotes(Collection.kt:398)
```

Fixes 16514
2024-06-01 22:02:46 +00:00
David Allison
b903a1fd24 test(card-browser-view-model): handle manualInit
Due to threading with Robolectric, ignoreValuesFromViewModelLaunch
was not handled in the same way that it would in a real class

(config was updated, even though it should be unchanged)

This fixes the issue inside `runViewModelTest`
2024-06-01 22:02:46 +00:00
Robozinho
701b5582de remove chromeos release files 2024-06-01 16:48:01 -05:00
AnkiDroid Translations
2f3d1b3294 Updated strings from Crowdin 2024-06-01 14:43:05 +00:00
Ashish Yadav
cc6c8af57e init instant note editor activity
* setup the style and manifest file to make activity transparent and single instance
2024-06-01 13:31:29 +00:00
AnkiDroid Translations
6b6ec74d32 Updated strings from Crowdin 2024-06-01 13:11:20 +00:00
AnkiDroid Translations
149dad0acf Updated strings from Crowdin 2024-05-31 11:57:16 +00:00
Sumit Singh
b0de535d4c Replacing reschedule with Set due date 2024-05-30 17:03:27 +00:00
Shruti Gitte
10ae2012b3
UnitTest : String null test for note editor (#16480)
* UnitTest : String null test for note editor

* Updated Test
2024-05-30 11:58:55 -05:00
AnkiDroid Translations
dc232cec11 Updated strings from Crowdin 2024-05-30 16:31:12 +00:00
Mike Hardy
681bf82adb
Dependency updates 20240530 (#16505)
* build(deps): bump com.google.protobuf:protobuf-kotlin-lite

Bumps com.google.protobuf:protobuf-kotlin-lite from 4.26.1 to 4.27.0.

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

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump org.apache.commons:commons-compress

Bumps org.apache.commons:commons-compress from 1.26.1 to 1.26.2.

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-compress
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump androidx.appcompat:appcompat from 1.7.0-rc01 to 1.7.0

Bumps androidx.appcompat:appcompat from 1.7.0-rc01 to 1.7.0.

---
updated-dependencies:
- dependency-name: androidx.appcompat:appcompat
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-30 11:31:54 -05:00
Mike Hardy
31ecadfc18 test(ci, unit): add 5mins to allowable gradle setup and total time
occasionally a runner was taking a bit too long to complete adding
to the flake / false-negative signal taking away from the actual
signalling value of CI
2024-05-30 10:58:37 -05:00
David Allison
1928dd00ad fix(tags-dialog): fix UTFDataFormatException
`DataOutputStream.writeUTF` had an undocumented exception:
`java.io.UTFDataFormatException: encoded string too long`

Use `commons.io.FileUtils` to fix

https://stackoverflow.com/questions/22741556/dataoutputstream-purpose-of-the-encoded-string-too-long-restriction

Fixes 16490
2024-05-30 03:19:53 +00:00
Brayan Oliveira
c2bb60daca feat(new reviewer): handle custom scheduling
ReviewerFragmentTest is basically a copy of ReviewerTest
2024-05-28 18:38:50 +00:00
Brayan Oliveira
72bd555010 refactor: extract baseUrl to viewModel 2024-05-28 18:38:50 +00:00
Brayan Oliveira
a6d0772750 feat: start Reviewer port
the style and features are going to be implemented incrementally
2024-05-28 18:38:50 +00:00
Brayan Oliveira
7146af94e8 chore: add Flow utils 2024-05-28 18:38:50 +00:00
Brayan Oliveira
0029da5e39 feat: add new reviewer dev option
currently, it does nothing. This commit is just to simplify the reviewing process
2024-05-28 18:38:50 +00:00
Mike Hardy
77b02ec1b0 Bumped version to 2.19alpha3 2024-05-27 12:37:25 +00:00