Anki-Android icon indicating copy to clipboard operation
Anki-Android copied to clipboard

Add Anki's new Deck Options page

Open BrayanDSO opened this issue 3 years ago • 8 comments

Purpose / Description

Free screen + spare a lot of work migrating DeckOptions.kt to use fragments and the androidx.Preference

Approach

  • Add the CollectionV16's deck options methods on BackendDeckOptions.kt
  • Add the new page
  • Use it if the new backend is enabled

How Has This Been Tested?

https://user-images.githubusercontent.com/69634269/186731680-548ff459-7c7d-46e3-a973-b12d6124a46f.mp4

Checklist

Please, go through these checks before submitting the PR.

  • [X] You have a descriptive commit message with a short title (first line, max 50 chars).
  • [X] You have commented your code, particularly in hard-to-understand areas
  • [X] You have performed a self-review of your own code
  • [X] UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • [ ] UI Changes: You have tested your change using the Google Accessibility Scanner

BrayanDSO avatar Aug 25 '22 17:08 BrayanDSO

Drafting because of some issues shown on the video.

  1. the restore option spins eternally
  2. "Remove preset" doesn't work
  3. There isn't any feedback after taping "Save"
  4. a big right margin shows up if you open one of the preset dialogs
    • image

I barely have explored/tested this screen, so some of these are probably my fault. Not sure when I'll be available to work on this

BrayanDSO avatar Aug 25 '22 17:08 BrayanDSO

Splendid! Thanks a lot for this work!

snowtimeglass avatar Aug 26 '22 11:08 snowtimeglass

  • The spinning is the same on the desktop when you hover over the option - I believe Henrik intended it to be that way, though the behaviour on mobile may have been unintentional.
  • The feedback on save should be provided by AnkiDroid when it processes the save request
  • Preset removal relies on the JavaScript confirm() and alert(), which AnkiDroid may have to add support for.

dae avatar Aug 29 '22 14:08 dae

Preset removal relies on the JavaScript confirm() and alert(), which AnkiDroid may have to add support for.

I believe that these come from here on upstream, which are QWebEnginePage methods and which I need to find the Android methods to intercept them

BrayanDSO avatar Sep 02 '22 23:09 BrayanDSO

Appears to be possible: https://stackoverflow.com/questions/2726377/how-to-handle-a-webview-confirm-dialog

dae avatar Sep 03 '22 01:09 dae

~~On top of/blocked by #12289~~

BrayanDSO avatar Sep 03 '22 09:09 BrayanDSO

Now that I noticed that if you tap "Restore this setting to its default value", it stops spinning. The spinning confused me a lot before, but that's something to solve on upstream.

https://user-images.githubusercontent.com/69634269/188265140-0dc78a22-33f9-4ff6-b16a-6cc352bede66.mp4

About the previous problems, only a big right margin shows up if you open one of the preset dialogs remains and this big margin:

image

As those aren't vital and I won't have time to investigate it any time soon, I think this can be reviewed.

BrayanDSO avatar Sep 03 '22 09:09 BrayanDSO

I just rebased to main and did git push --force-with-lease on the reomte fork/branch mostly to re-start CI really easily but also to make sure this is up to date. Hoping to review shortly and get this in

mikehardy avatar Sep 13 '22 12:09 mikehardy

This is getting dusty, but conflict-proof 😎

BrayanDSO avatar Oct 13 '22 23:10 BrayanDSO

focused on scoped storage right now but I do want to get this in (obviously, I even pull/pushed the branch myself ha), just have to prioritize those PR reviews, thanks for your patience

mikehardy avatar Oct 14 '22 20:10 mikehardy

I want to approve this but it is not working for me on an android 21 google-apis emulator?

Anki HTML pages need Chromium 77+, which means you need a updated version of WebView, and the WebView version that comes with the emulator is older (original discussion/testing here)

IIRC, SDK 21 devices can use WebView up to 96 or something near that. If you want to test it on emulator, you should update it

BrayanDSO avatar Oct 31 '22 01:10 BrayanDSO

Ah ha! I'll try a play store emulator for 21, it can update I think. Subtle, good info thank you

mikehardy avatar Oct 31 '22 01:10 mikehardy

Hi there @BrayanDSO! This is the OpenCollective Notice for PRs merged from 2022-10-01 through 2022-10-31

If you are interested in compensation for this work, the process with details is here:

https://github.com/ankidroid/Anki-Android/wiki/OpenCollective-Payment-Process#how-to-get-paid

We only post one comment per person per month to avoid spamming you, regardless of the number of PRs merged, but this note applies to all PRs merged for this month

Please note that GSoC contributions are okay for this process. Our philosophy is that our users have donated to AnkiDroid for all contributions. The only PRs that will not go through the OpenCollective process are ones directly related to am accepted GSoC project from a selected participant, since those receive a stipend from GSoC itself.

Please understand that our monthly budget is never guaranteed to cover all claims - the cap on payments-per-person may be lower, but we try to make our process as fair and transparent as possible, we just need your understanding.

Thanks!

github-actions[bot] avatar Nov 01 '22 16:11 github-actions[bot]

How nice. Now we can specify intervals with units of hours (e.g. 3h) and days (e.g. 3d) on AnkiDroid as well as Anki Desktop. It's so useful. Information icons beside each items are also so helpful. Thanks a lot.

snowtimeglass avatar Nov 03 '22 12:11 snowtimeglass