Improve alert dialog style
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?
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
@neeldoshii FYI
Thank you for contributing. I'll admit I am really new to material 3 so I maybe wrong. I have few questions.
- 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 {
-
<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 -
How does it support Android Version 12 below devices.
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?
How does it support Android Version 12 below devices.
the same way. added in the PR text. Thanks
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.
@lukstbit @BrayanDSO please take a look or tell me what to do do
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!