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
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
* 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
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
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
without this, `./gradlew jacocoAndroidTestReport` would not work on the command
line, but the tests would work in Android Studio, which is quite bizarre
* Activity to support adding notes without opening AnkiDroid
* Text surround helper to tap and turn to cloze
* unitTest: InstantEdtitorViewModel unit test
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
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...)