-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat(deck-description): 'Format as Markdown' support & various UX improvements #18748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(deck-description): 'Format as Markdown' support & various UX improvements #18748
Conversation
Important Maintainers: This PR contains Strings changes
|
df7a81b
to
c852c79
Compare
c852c79
to
380296b
Compare
Updated screenshots, added corners via Long string to prove that the checkbox remains on screen |
380296b
to
6626e0a
Compare
6626e0a
to
8beea87
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dialog expands to occupy full width of the screen(most obvious in tablets).
The user input is not saved if the app goes in the background and then comes back.
I know that I'm one of the people that approved the initial code but after looking at this the last couple of days I would recommend that we use a standard dialog with Cancel/Save buttons at the bottom instead of the current toolbar actions approach(used probably because the dialog doesn't play too well with very big content but I think we could get round this somehow).
Also, I'm surprised that you didn't use a ViewModel.
currentDescription = getDescription() | ||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | ||
this.dialogView = layoutInflater.inflate(R.layout.dialog_deck_description, null) | ||
return MaterialAlertDialogBuilder(requireContext()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing that MaterialAlertDialogBuilder doesn't produce an ui like AlertDialog does we should settle which one we use going forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's discuss:
AnkiDroid/src/main/java/com/ichi2/anki/dialogs/EditDeckDescriptionDialog.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/dialogs/EditDeckDescriptionDialog.kt
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/ui/DelegatedViewProperties.kt
Outdated
Show resolved
Hide resolved
71a3b4e
to
064d2cc
Compare
@lukstbit I have handled all requests ![]() |
53057d0
to
5ff75ea
Compare
Thanks for giving it a look again - it does seem like most (all?) items were addressed and, as ever, we can always do followups |
@david-allison merge queue caught a quiet conflict with refactorings and order of merge...
|
I'm not sure if we'll want to implement the setter, but the getter is useful https://redirect.github.com/ankitects/anki/commit/ded626f0b9685355e9856c352daf21c09382999e Issue 18749
* fix margins to be standard 24dp * add icon for save * add content description for 'close' Fixes Issue 18528
* touch outside -> no-op
* fixes saved state restoration
Note that this option has unintended consequences. * `<img>` tags, are now stripped, although they work with the option disabled * It does not work on old versions of Anki https://redirect.github.com/ankitects/anki/commit/ded626f0b9685355e9856c352daf21c09382999e Issue 18749
Adds rounded corners Issue 18528
Requested in review, instead of icons Issue 18749
Didn't look good on tablets
e55be13
to
e312461
Compare
Maintainers: Please Sync Translations to produce a commit with only the automated changes from this PR. Read more about updating strings on the wiki, |
Purpose / Description
I was looking into #18528. While I was making improvements to the screen, I found that the 'Anki 2.1.41+ handling' checkbox upstream enabled markdown support (but disabled
<img>
), so I added support for itFormat as Markdown
is enabledFixes
Approach
md
property ofdeck
md
viaEditDeckDescriptionDialog
EditDeckDescriptionDialog
How Has This Been Tested?
new

older
Learning (optional, can help others)
ankitects/anki@ded626f
Checklist