0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-19 19:42:17 +02:00
Commit Graph

11668 Commits

Author SHA1 Message Date
David Allison
5bf4326bb0 tests: ensure Widget Config initialized properly
The following classes required a non-empty collection:
* `CardAnalysisWidgetConfig`
* `DeckPickerWidgetConfig`

Previously this was not handled in tests, and instead a
second call to `initializeUIComponents` was made

To fix this:

* define `initTask` and check for completion in tests

Prep for fixing flaky tests due to async collection access:
Issue 17010
2024-09-18 17:44:48 +00:00
David Allison
3fd1c69ea8 tests: fix flake in updateViewWithSavedPreferences
We did not wait for `updateViewWithSavedPreferences` correctly in
`DeckPickerWidgetConfigTest.testLoadSavedPreferences`

Because we updated this in `DeckPickerWidgetConfig`,
also update the method in `CardAnalysisWidgetConfig`

Issue 17010
2024-09-18 17:44:48 +00:00
David Allison
c123be3631 improvement: log on close when collection is empty 2024-09-18 17:44:48 +00:00
David Allison
63d527e5c6 refactor: remove unnecessary 'lifecycleScope.launch' 2024-09-18 17:44:48 +00:00
David Allison
43262eafef tests: standardize activity cleanup
`startActivityNormallyOpenCollectionWithIntent` calls
`saveControllerForCleanup`, previously:

**DeckPickerWidgetConfigTest**
Did not perform cleanup

**CardAnalysisWidgetConfigTest**
Manually performed cleanup

This may fix Issue 17010: `testLoadSavedPreferences` was flaky
2024-09-18 17:44:48 +00:00
Ashish Yadav
c1fbbad516 feat: Allow deck selection in statistics screen
A Spinner was introduced in the statistics screen top bar which can be
used by the user to change the current selected deck and update the
WebView with the statistics for the new selected deck.

Note: the deck selection mechanism is decoupled from the general
DeckSpinnerSelection/DeckSelectionDialog system so changing the deck
in the statistics screen doesn't modify the selected deck for other parts
of the app.
2024-09-16 16:43:09 +00:00
Mike Hardy
2dab92e521 Bumped version to 2.19beta2 2024-09-16 16:23:44 +00:00
AnkiDroid Translations
c67a0650da Updated strings from Crowdin 2024-09-16 15:37:44 +00:00
leobugeja
c2b2ef3e5e fix: Single review activity via shortcuts 2024-09-16 14:31:12 +00:00
Moreno
2ac565a4e3 set ic_warning color to colorError
it was purple in dark mode

tested by showing the delete note dialog in the reviewer
2024-09-16 14:30:18 +00:00
Moreno
6a61e21fa4 set ic_warning color to onSurface
it was purple in dark mode

tested by showing the delete note dialog in the reviewer
2024-09-16 14:30:18 +00:00
Moreno
f77ae346f3 remove useless checkbox style
not necessary
2024-09-16 14:30:18 +00:00
Moreno
793ac94891 Improve alert dialog style 2024-09-16 14:30:18 +00:00
Ashish Yadav
e7b312eb5e fix: nullable getCurrentMultimediaEditableNote 2024-09-16 14:24:00 +00:00
Ashish Yadav
7cc16f7940 fix: NoteEditor flaky test
* chore: segregate the show bottom sheet logic
2024-09-16 14:24:00 +00:00
Arthur Milchior
2bbcf6b004 Note editor: sticky field don't stop the back button. 2024-09-16 14:19:34 +00:00
Arthur Milchior
1fe3e46150 NF: toggleStickyButton is non null 2024-09-16 14:19:34 +00:00
Arthur Milchior
1b09ab915a NF: editFields's content is non null
It was never set to a nullable value
2024-09-16 14:19:34 +00:00
Robozinho
d7d9a7c697 remove all cards count subtitle 2024-09-16 13:42:59 +00:00
AnkiDroid Translations
f65934b1b1 Updated strings from Crowdin 2024-09-16 13:17:39 +00:00
Mike Hardy
49a7651791
Dependency updates 20240916 (#17071)
* build(deps): `yarn upgrade --latest` in tools/localization

* chore(deps): bump org.jetbrains.kotlinx:kotlinx-coroutines-test

Bumps [org.jetbrains.kotlinx:kotlinx-coroutines-test](https://github.com/Kotlin/kotlinx.coroutines) from 1.8.1 to 1.9.0.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.8.1...1.9.0)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-test
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

* Update Gradle Wrapper from 8.10 to 8.10.1.

Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>

---------

Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2024-09-16 07:59:28 -05:00
AnkiDroid Translations
83ed107806 Updated strings from Crowdin 2024-09-15 08:55:24 +00:00
AnkiDroid Translations
63cfcd2f12 Updated strings from Crowdin 2024-09-10 07:05:24 +00:00
Rohanraj123
1a1e138cdc feat: enable troubleshooting dialog box for user guidance
Added a dialog box to provide users with troubleshooting guidance during critical operations.
This dialog appears when the user encounters common errors and offers solutions or next steps.

Key changes include:
- Integrated the new troubleshooting dialog into the main user interface.
- Implemented logic to trigger the dialog based on specific error codes.
- Updated the UI to support the dialog's appearance and behavior.
- Refined error-handling flow to ensure that appropriate guidance is displayed.

This feature aims to improve user experience by helping users resolve issues without leaving the app.
2024-09-10 06:30:56 +00:00
Rohanraj123
6a3dd81aa7 refactor(tts-voices): add context to errors
When handling `MissingVoiceError`, knowing the voice
we searched for enables better error resolution

Adding context required moving from an enum to
a class, which caused code churn
2024-09-10 06:30:56 +00:00
AnkiDroid Translations
e846b350c7 Updated strings from Crowdin 2024-09-10 06:09:35 +00:00
MorenoTropical
b504e389f8 fix filtered decks not appearing in browser
7a65160e0e
2024-09-09 06:26:53 -03:00
MorenoTropical
9498a3f578 fix export menu item
cause: aabd99dc4e
2024-09-09 08:05:27 +00:00
AnkiDroid Translations
6bd0114daf Updated strings from Crowdin 2024-09-08 21:55:49 +00:00
Anoop
6d3d0ca728 Refactor DeckUtils and CardAnalysisWidget for Improved Deck Handling 2024-09-08 18:47:20 +00:00
Anoop
4499c84afb Added Cancel button in configuration screen and empty collection handling in CardAnalysisWidget. 2024-09-08 18:47:20 +00:00
Anoop
b9be27f168 Refactor isCollectionEmpty method to DeckUtils for reuse in multiple classes 2024-09-08 18:47:20 +00:00
Anoop
9d3cb64a5b Refactor CardAnalysisWidget to handle single deck selection and update logic; adjust DeckNameAndStats to support changes 2024-09-08 18:47:20 +00:00
Anoop
fc0f4fe03a Refactor widget configuration and layout for improved deck selection and empty state handling
- Added new string resource `empty_widget` to denote when a widget is empty and requires reconfiguration.
- Enhanced `CardAnalysisWidgetConfig` to automatically display the deck selection dialog upon initialization.
- Refactored `CardAnalysisWidget` to handle empty state visibility, allowing users to reconfigure the widget by clicking the empty state message.
2024-09-08 18:47:20 +00:00
Anoop
c829c3dfd7 Implementation of Card Analysis Widget to display deck statistics for a particular deck.
This commit introduces the Card Analysis Extra Widget, which displays a deck with the number of cards that are new, in learning, due for review and deck name.
Features:
- Displays deck names and statistics (new, learning, and review counts).
- Updates every minute using a recurring alarm.
2024-09-08 18:47:20 +00:00
AnkiDroid Translations
a77d5bbebf Updated strings from Crowdin 2024-09-08 18:29:53 +00:00
AnkiDroid Translations
64e36b55bf Updated strings from Crowdin 2024-09-06 13:10:30 +00:00
David Allison
8947ee26d7 refactor: remove dead code
Remaining code used in AddonData
2024-09-05 20:34:36 +00:00
AnkiDroid Translations
eaa0463fd6 Updated strings from Crowdin 2024-09-03 05:42:48 +00:00
Arthur Milchior
25d7246251 Notify the UI that a sync was done
In this case, I really don't think it's realistic to expect an
OpChange from the backend. The backend already sends informations that
are relevant for the sync process. Given that "sync" does not uses the
processes uses for undoable change (indeed, it should not be
undoable), no OpChange is generated.

It seems reasonable in this place at least to directly notify the
observers.

Given that the observers expect an OpChanges, I create one, and simply
assume everything may be changed. This seems reasonable in case of
sync, and it's sufficiently rare that the cost won't be prohibitive
anyway.

Fixed: #16943
Fixed: #16942
2024-09-03 04:59:41 +00:00
MorenoTropical
fa53c16fc2 add filtered deck option to browser 2024-09-02 17:32:02 +00:00
Robozinho
733cecac82 fix menu in template editor
this was very hard to do because CardTemplateEditor is tightly coupled with CardTemplateFragment, so most changes break something even if not related
2024-09-02 09:40:40 +00:00
Sumit Singh
9c9018b049 Fix: Ensure Media Sync Aborted Message Displays Correctly After Canceling Media Sync 2024-09-02 09:39:01 +00:00
Robozinho
941be0ce2a change donate icon to heart 2024-09-01 17:15:15 +00:00
AnkiDroid Translations
bc30d753a8 Updated strings from Crowdin 2024-09-01 08:54:19 +00:00
lukstbit
e7eee16a39 Fix can't delete search input in CardBrowser after an initial search
The DEL KeyEvent was previously declared to act as a keyboard shortcut
to delete the selected notes. After an initial search which registered
a search query entering DEL attempted to delete the current selected
notes which also resulted in another search(same input) being executed.

The fix registers the DEL keys as a delete notes shortcut ONLY if the
search box of the CardBrowser is not currently available(isIconified
returning true).
2024-08-31 15:48:23 +00:00
lukstbit
83def3fad3 Fix E key event handling in CardBrowser
The previous code was showing the edit note screen every time the
E key was pressed, this was changed to only handle the E key event
as a shortcut only if the searchbox isn't currently available(
isIconified returning true).
2024-08-31 15:48:23 +00:00
lukstbit
7f783473d4 Fix T key event handling in CardBrowser
The previous code was showing the tags filter dialog every time the
T key was pressed, this was changed to also introduce Ctrl as a
modifier like the documentation for the onKeyUp method recommends.
2024-08-31 15:48:23 +00:00
lukstbit
1d27d54738 Fix improper keys events handling in CardTemplateEditor
The onKepUp should return true only when the event is consumed.
2024-08-31 15:48:23 +00:00
Ashish Yadav
6b78e45f0d feat: use CropImageView to crop images
* Replaced the use of CropImageContract with CropImageView to ensure continued compatibility and adherence to best practices, updated related logic and UI.
* The decision to follow this migration path was influenced by the library's intent to depracte the CropImageContract see : https://redirect.github.com/CanHub/Android-Image-Cropper/pull/637
2024-08-31 00:00:03 +00:00