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

19263 Commits

Author SHA1 Message Date
Ashish Yadav
32bf2c33b7 feature: use chipGroup instead of EditText
* enhancement: switch between modes using button
* unitTest: added unit tests for the viewmodel
* docs: viewmodel new methods documentation
2024-06-14 22:11:32 +00:00
Ashish Yadav
43d1e67f3e refactor: init deckspinner accept optional layout 2024-06-14 22:11:32 +00:00
AnkiDroid Translations
3921309d9e Updated strings from Crowdin 2024-06-12 17:26:55 +00:00
David Allison
7a48b84ffb refactor(card-browser): remove rowId references
CardBrowser will move to render using either
the card id or the note id

Our data is currently ALWAYS CardIds, which may be
transformed into NoteIds

We had code assuming that the CardId was always used
which needed to be modified to handle the case that
a DB call is needed to map NoteId <-> CardId

* selectedRowIds
* allCardIds
  * Now needs to be `suspend`
* get[Selected]CardIdAtPosition
  * Now needs to be `suspend`

Issue 11889
2024-06-12 15:09:49 +00:00
Sumit Singh
94de856406 Implement hold to record functionality 2024-06-10 17:15:13 +00:00
AnkiDroid Translations
de8aca2a7a Updated strings from Crowdin 2024-06-10 15:45:49 +00:00
Moreno
7072592247 add next card due message 2024-06-10 14:20:02 +00:00
AnkiDroid Translations
03fecf3732 Updated strings from Crowdin 2024-06-10 14:04:07 +00:00
AnkiDroid Translations
ba4808c1cf Updated strings from Crowdin 2024-06-09 18:39:09 +00:00
Robozinho
47ca03d1d4 improve media sync message 2024-06-09 17:34:59 +00:00
AnkiDroid Translations
41eea1e220 Updated strings from Crowdin 2024-06-09 17:16:35 +00:00
Robozinho
f99a288bf4 fix navbar color in reviewer 2024-06-09 09:10:44 +00:00
David Allison
79286aaad3 lint(collection): make non-open
Fixes a few warnings
2024-06-09 09:07:04 +00:00
David Allison
a8b22f6dd3 build: extract 'TestUtils' to 'common' module
A number of circular dependencies on 'compat' meant
that all functionality could not be extracted from 'AdaptionUtil'

* We need to extract 'isRobolectric'
* isRunningAsUnitTest is an easy extraction
  * added in 7ada532c5c
2024-06-07 20:23:17 +00:00
David Allison
eed9ca8b4d build: create 'common' module
* Defined as 'Android Library'
* Replaced junit reference with vintage engine
 * to match project
* Removed example unit tests
2024-06-07 20:23:17 +00:00
David Allison
20add73857
refactor(card-browser): updateSelectedCardsFlag (#16547)
* refactor(card-browser): Card param -> CardId

We're going to refactor `updateSelectedCardsFlag` to
return cids and these were all that is required

* refactor(card-browser): remove unused method

* searchWithFilterQuery

* refactor(card-browser-view-model): update flags

* onEach { load() } called collection.load
  * broken in 0d69cacde9
2024-06-06 08:12:35 -05:00
David Allison
e14aec6eec docs: ChangeManager.Subscriber - lambdas
Documented that lambdas should not be used

Issue 16541
2024-06-06 08:13:22 +00:00
sargamgayatri0803@gmail.com
2e634d0cc4 focus keyboard 2024-06-06 08:12:34 +00:00
AnkiDroid Translations
3675f72aba Updated strings from Crowdin 2024-06-05 17:25:06 +00:00
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