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

Improve alert dialog style

Open MorenoTropical opened this issue 1 year ago • 4 comments

Purpose / Description

The dialogs didn't look much like material dialogs, so I applied the overlay theme to get animations, round corners and material style

Fixes

  • Fixes #15174

Approach

I used Material Dialog Theme Overlay and did a fix with the text color

I was going to remove AlertDialogStyle as well but someone else is doing something with it

How Has This Been Tested?

image

image

image

dialog.webm

light.webm

API 25.webm

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

MorenoTropical avatar Jun 04 '24 20:06 MorenoTropical

@neeldoshii FYI

david-allison avatar Jun 05 '24 06:06 david-allison

Thank you for contributing. I'll admit I am really new to material 3 so I maybe wrong. I have few questions.

  1. Is it really important to convert the style of AlertDialog to M3 instead directly use M3 MaterialAlertDialog and style it as per the theme like this.
-  dialog = AlertDialog.Builder(requireActivity()).create {
+  val dialog = MaterialAlertDialogBuilder(requireActivity()).create {
  1. <item name="dialogCornerRadius">@dimen/m3_alert_dialog_corner_size</item> As said by luskbit is this really needed? In material 3 (MaterialAlertDialog) it is inherited by default the corner radius. Check https://github.com/ankidroid/Anki-Android/pull/16515#issuecomment-2147384397

  2. How does it support Android Version 12 below devices.

neeldoshii avatar Jun 05 '24 14:06 neeldoshii

Is it really important to convert the style of AlertDialog to M3 instead directly use M3 MaterialAlertDialog and style it as per the theme like this.

Yes, it is. Changing the style applies it to all the dialogs, including the ones that you can't convert to a MaterialAlertDialog, like the Preferences' dialogs.

Also, it is way easier and more correct to do that in the styles

Also also, the only thing that MaterialAlertDialog does is use a different style. The class itself isn't necessary to make a dialog material.

As said by luskbit is this really needed?

image

How does it support Android Version 12 below devices.

the same way. added in the PR text. Thanks

MorenoTropical avatar Jun 05 '24 15:06 MorenoTropical

The code changes themselves are fine, but it needs a manual check of the other dialogs. The app has many of them and some are relatively complex or not follow some of the best practices for styling.

An automated screenshot tool would really help here.

BrayanDSO avatar Jun 07 '24 11:06 BrayanDSO

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

MorenoTropical avatar Sep 08 '24 23:09 MorenoTropical

@lukstbit @BrayanDSO please take a look or tell me what to do do

MorenoTropical avatar Sep 08 '24 23:09 MorenoTropical

Hi there @MorenoTropical! This is the OpenCollective Notice for PRs merged from 2024-09-01 through 2024-09-30

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

[!IMPORTANT] PLEASE NOTE: The process was updated in August 2024. Re-read the Payment Process page if you have not already.

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 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 Oct 01 '24 19:10 github-actions[bot]