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

17351 Commits

Author SHA1 Message Date
Mike Hardy
1c2d28af4d release: include universal build for each flavor in github releases
this should help storage migration testing as a play build will now be
available despite a general policy of "full builds on github releases"
2023-04-04 21:29:38 -05:00
BlaineOb
c33d6ad81a Make eligible functions and fields private
Android Studio code inspection suggested the following functions and fields in this file could be made private.
2023-04-04 08:40:08 +03:00
Sanjay Sargam
a31636b211
removed line which is written twice (#13537) 2023-04-03 07:39:24 -03:00
yellowjello
d2f40dfd75
Fix leech snackbar overlapping answer buttons (#13404)
* Fix leech snackbar overlapping answer buttons

* Update AnkiDroid/src/main/java/com/ichi2/anki/snackbar/Snackbars.kt

Co-authored-by: oakkitten <oakkitten@users.noreply.github.com>
2023-04-03 07:23:27 -03:00
jocoand
a94d957eef
Kotlincleanup DeckOptionsActivity (#13536)
* Kotlin cleanup

* Remove annotation
2023-04-03 07:20:39 -03:00
dependabot[bot]
6199e4a8ee build(deps): bump webfactory/ssh-agent from 0.7.0 to 0.8.0
Bumps [webfactory/ssh-agent](https://github.com/webfactory/ssh-agent) from 0.7.0 to 0.8.0.
- [Release notes](https://github.com/webfactory/ssh-agent/releases)
- [Changelog](https://github.com/webfactory/ssh-agent/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webfactory/ssh-agent/compare/v0.7.0...v0.8.0)

---
updated-dependencies:
- dependency-name: webfactory/ssh-agent
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-01 07:51:23 -05:00
Sanjay Sargam
915c26601a
Showing Snackbar instead of Toast in Reviewer.kt (#13488)
* Showing Snackbar instead of Toast in Reviewer,kt

* requested changes addded

* changes requested added
2023-03-30 07:29:52 +03:00
Arthur Milchior
0d2863098d NF: rename DeleteOnUninstall
As noted in
https://github.com/ankidroid/Anki-Android/pull/13261/files#r1133165143 ,
"DeleteOnUninstall", while true, is not a description of a kind of folder.
Renaming it make it easier to grasp.
2023-03-29 17:55:06 -05:00
Brayan Oliveira
905d456890 Don't finish activity after requesting all files access permission 2023-03-29 13:43:45 +01:00
Mike Hardy
90fd87dab2 Bumped version to 2.16alpha95 2023-03-28 23:19:53 +00:00
Mike Hardy
2d9f82e347 temporarily disable publish of alpha to google 2023-03-28 18:17:18 -05:00
Robozinho
6c65f41e6f
Fix bundle.get deprecation (#13510)
* fix bundle.get() deprecation

* fix bundle.get() deprecation

* fix getParcelable deprecation

* fix Bundle.get deprecation
2023-03-28 05:51:05 -03:00
Robozinho
2e11eeb33e Replace MaterialDialog with AlertDialog 2023-03-28 06:46:43 +03:00
David Allison
8f9d5c4f66 refactor: toggleStylus - Kotlin Cleanup
A review comment of mine on 13475 which wasn't worth blocking the PR over
2023-03-27 20:44:27 -03:00
Robozinho
d03d544c6e fix deprecation and unchecked cast 2023-03-27 19:59:51 -03:00
naong
66ba7b1f2a
Whiteboard - Stylus Only Mode (#13475)
* NF: Whiteboard - Stylus Only Mode

This function allows you to write with only the stylus pen when using a stylus pen such as the S-Pen. Finger gestures use scroll and button controls only.
This function have a toggle action button and a menu.

Implemented remembering stylus mode state function by adding stylus column in whiteboardState table.
Fixed meta db bug.

---------

Co-authored-by: Brayan Oliveira <69634269+BrayanDSO@users.noreply.github.com>
2023-03-27 23:49:11 +01:00
Brayan Oliveira
194b4ec92f
Use "full" flavor on all github release builds: arch+universal+parallel (#13514) 2023-03-27 17:40:26 -05:00
Robozinho
3578675a4a
Fix some activityResult deprecations (#13495)
* Fix deck options activityResult deprecation

* Fix activityResult deprecation

request code wasn't used

* Add log

* add requested changes
2023-03-27 23:23:06 +01:00
Robozinho
5b5e82a765
Use snackbar instead of toast on note editor add note (#13515) 2023-03-27 19:15:56 -03:00
Robozinho
7ab289a0ee Remove unused method 2023-03-27 21:46:26 +01:00
Arthur Milchior
2e5ef904c8 NF: Rename handleStoragePermissionsCheckForCheckMedia
As @oakkitten noted, the name is misleading, since the function does not handle
anything.
2023-03-27 12:40:52 -05:00
David Allison
8f1984d6bd build: 'full' build with no manifest restrictions
A default build ('play') is not allowed MANAGE_EXTERNAL_STORAGE

We want a build with this permission so we can distribute it.

`amazon` removes the camera permission, so it is not appropriate

So add a new flavor: 'full' which has BOTH camera & storage permissions

Related: 13431
2023-03-27 06:32:30 -03:00
Ashish Yadav
f83f19004d fixed check for condition 2023-03-26 21:17:18 +01:00
AnkiDroid Translations
c7a9042822 Updated strings from Crowdin 2023-03-26 11:24:23 -05:00
Mike Hardy
9c950f4e17 Fix dnagling reference to removed string 2023-03-25 21:58:08 -05:00
snowtimeglass
f8f0146287 Rewrite the string for Debug info toast
old: about_ankidroid_successfully_copied_debug
new: about_ankidroid_successfully_copied_debug_info
2023-03-25 19:19:00 -05:00
snowtimeglass
6555264de1 For Reviewer actions, reuse Anki Desktop strings
- For feedback-toast message to Reviewer actions, reuse strings of Anki Desktop
- Use new strings instead of ones of Anki Desktop, as needed
2023-03-25 19:19:00 -05:00
snowtimeglass
629d878b12 Reconstruct strings for Reviewer-actions' feedback
Reconstruct the strings for the feedback-toast message to Reviewer actions

Basically, use strings on Anki Desktop instead of the current ones. Create new ones as needed.
For Bury and Suspend, I set the style described in the following comment as a goal:
  https://github.com/ankidroid/Anki-Android/pull/12446#issuecomment-1279763351

------------------------------

- Replace `<string name="buried_card">Card buried</string>`
        with `<string name="card_buried">Card buried.</string>`

- Remove `<string name="buried_note">Note buried</string>`
   (Instead of the string, its counterpart on Anki Desktop will work on the toast.)

- Remove `<string name="deleted_note">Note deleted</string>`
   (Instead of the string, its counterpart on Anki Desktop will work on the toast.)

- Remove `<string name="suspended_card">Card suspended</string>`
   (Instead of the string, its counterpart on Anki Desktop will work on the toast.)

- Replace `<string name="suspended_note">Note suspended</string>`
        with the following code:
                `<plurals name="note_suspended"
                        <item quantity="one">%d card suspended.</item>
                        <item quantity="other">%d cards suspended.</item>
                 </plurals>`

------------------------------
2023-03-25 19:19:00 -05:00
snowtimeglass
44bff3d75b Change the word order the toast messages
Change the word order of some of the toast messages

"[Subject] (omission of [be Verb]) [Past participle]" word order is used in Anki Desktop and AnkiDroid, but it isn't on some strings of AnkiDroid

before change  -->   after change
-------------------------------------------------
"Buried card" --> "Card buried"
"Buried note" --> "Note buried"
"Deleted note" --> "Note deleted"
"Suspended card" --> "Card suspended"
"Suspended note" --> "Note suspended"
"Created deck"  --> "Deck created"
"Renamed deck"  --> "Deck renamed"
"Copied debug information to clipboard" --> "Debug information was copied to clipboard" (no omission of be Verb)
-------------------------------------------------
2023-03-25 19:19:00 -05:00
Ashish Yadav
94dae55672 exit application on delete collection click to restart all activities. 2023-03-25 19:18:42 -05:00
David Allison
56e0a24f54 Storage: Restore From Backup if uninstalled
If a user has uninstalled the app, one of the options should
be to restore from a .colpkg

Use `ankiDroidDirectoryOverride` as code uses the location in
 CollectionHelper rather than `col.path`. Defining a temporary
 collection in `CollectionManager` was deemed to be too challenging

Tested with 'Don't keep activities' and failures in the import copy

Issue 5304
2023-03-25 19:18:16 -05:00
David Allison
7cb432c4c1 fix: showDialogFragment
Exception: java.lang.IllegalStateException: Must be called from main thread of fragment host
2023-03-25 19:18:16 -05:00
David Allison
e43d38ecde fix: ImportReplace - use current collection path
`getCollectionPath` should be used when the collection is closed
2023-03-25 19:18:16 -05:00
David Allison
4d7eb1ea57 refactor: extract 'Import' from DeckPicker 2023-03-25 19:18:16 -05:00
David Allison
136cfb3f8a Scoped Storage: Handle storage being revoked
If a user uninstalls AnkiDroid, `preserveLegacyStorage` no longer
works

This means they have a deckPath of `/storage/emulated/0/AnkiDroid`
which can no longer be accessed.

Their data exists, but cannot be accessed unless:
* They restore from AnkiWeb
* They have a colpkg
* They manually copy the folder over
* They install a non-Google-Play copy

Options:
* Restore from AnkiWeb
* Restore folder access
   (https://github.com/ankidroid/Anki-Android/wiki/Full-Storage-Access)
* Restore backup (Hidden - Not Implemented)
* Get Help (Link to: Google Group)
* Delete collection and create a new one

Issue 5304
2023-03-25 19:18:16 -05:00
AnkiDroid Translations
5c06c1806f Updated strings from Crowdin 2023-03-25 19:17:38 -05:00
AnkiDroid Translations
92c42cc825 Updated strings from Crowdin 2023-03-24 14:52:31 -05:00
David Allison
be62538feb fix: Errors migrating from a notification
If a migration requires a sync, and a sync completes when the app is
 paused, a notification occurs prompting the user to migrate.

This is handled by `DialogHandler`, which runs in AnkiActivity.onResume
BEFORE `loadDeckCounts`.

This races with closing the collection for a storage migration.

Instead, start the task and allow it to be stopped.

Issue 5304
2023-03-24 11:12:48 -05:00
David Allison
d385361a25 fix: Remove sync col access from renderPage
Caused bugs when performing a storage migration after syncing
2023-03-24 11:12:48 -05:00
David Allison
4dab1b2f8e Dialog: 'media sync unavailable' before migration
We need a media sync before a storage migration.

If this has been disabled, it is the user's responsibility
to perform a sync before this migration occurs

There are currently two reasons:

Fetch media on Sync is set to:
* 'Only if unmetered' & connection is metered
* Never

Issue 5304
2023-03-24 11:12:48 -05:00
David Allison
3b3e1fcdc7 Scoped Storage: Enforce Media Sync Before Migration
We need to move the user's data to /Android/ to handle scoped storage
changes. Before we perform this migration, we should ensure that users
data is safe. To do this, we enforce a sync.

A user should have completed a full media sync before the migration
occurs.

This ensures that their data is up to date and can be restored if
anything goes awry with the migration

Dialog wording as discussed on the Figma, with the exception of
changing 'sync' to 'media sync'

Issue 5304
2023-03-24 11:12:48 -05:00
David Allison
60fa3261c9 Add Async Operation for 'Migrate'
Displays a notification if the app is paused
otherwise performs the operation

Similar to 'DialogHandler', but doesn't require a dialog
2023-03-24 11:12:48 -05:00
David Allison
705949d831 DeckPicker: Add 'migrateStorageAfterMediaSyncCompleted' 2023-03-24 11:12:48 -05:00
David Allison
fab82bc262 DeckPicker: Add 'onMediaSyncCompleted' 2023-03-24 11:12:48 -05:00
Sanjay Sargam
a89502c9fb
Show warning on reset to default button in AppBar (#13476) 2023-03-24 09:05:09 -05:00
Prince kushwaha
c96e2eff9e
Changed Material Dialog with Alert Dialog for Toolbar.kt (#13467)
* Changed Material Dialog with Alert Dialog for Toolbar.kt

* fix minor issues
2023-03-24 11:57:27 +02:00
snowtimeglass
2198f6e840 Increase snackbar maximum lines from 2 to 4 2023-03-24 06:05:22 -03:00
dependabot[bot]
d34241355f build(deps): bump actions/stale from 7 to 8
Bumps [actions/stale](https://github.com/actions/stale) from 7 to 8.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-23 22:15:23 -05:00
David Allison
aa34a6f8b7 Allow user to disable 'storage migration' reminder
Checkbox to disable permanently if `timesStorageMigrationPostponed > 1`

+ Warning that uninstalling the app will delete/make storage inaccessible

Issue 5304
2023-03-23 21:38:09 -05:00
David Allison
aaedfb53da feat: Add checkBoxPrompt to AlertDialog
This differs from the async prompt as it does not
remove the 'message' parameter
2023-03-23 21:38:09 -05:00