Skip to content
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

Better implementation of Material You #1595

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gcantoni
Copy link

@gcantoni gcantoni commented Feb 9, 2025

Hello,

I reopen a pull request with the changes made in the previous one and other new ones.

This commit include several changes to the core and non-core layouts of SD Maid. At present the app does not implement a good part of the colors defined in colors within its layouts. For example, the main backgrounds and card backgrounds are not used correctly.

Examples:

  • layout/dashboard_fragment.xml was missing attribute background
  • setup_shizuku_item.xml was missing both cardCornerRadius and cardBackgroundColor attributes
  • many layouts do not correctly implement colors in the correct way. As said by you, the attributes should be inherited from the Material3 dependency. This is correct. The problem is that they don't use the official colors of Material Design 3. Just inspect some Google apps to quickly understand that behind their software there is something more in terms of UI compared to the native libraries. This requires the implementation of various additional attributes to achieve full design guidelines.

To answer your other question regarding toolbar colors, I simply restyled it using the correct parent and correct attributes. See https://github.com/gcantoni/sdmaid-se/blob/main/app/src/main/res/values/styles.xml#L194

Furthermore, to achieve full compatibility with Material You's dynamic colors I had to add the color of the status bar and navigation bar programmatically. See https://github.com/gcantoni/sdmaid-se/blob/main/app/src/main/java/eu/darken/sdmse/common/theming/Theming.kt#L130

It is logically all divided by API. For APIs > 34 the colors are the correct ones. (Refer to Google documentation here https://github.com/material-components/material-components-android/blob/master/docs/theming/Color.md)

Regarding API 31 (https://github.com/gcantoni/sdmaid-se/blob/main/app/src/main/java/eu/darken/sdmse/common/theming/Theming.kt#L147) feel free to change the colors as you like (see https://github.com/gcantoni/sdmaid-se/blob/main/app/src/main/java/eu/darken/sdmse/common/theming/Theming.kt#L157). Help yourself with the documentation that I have attached so you can understand how the colors of the Material 3 library are linked to the Android system resources.

What needs to be improved / fixed?
I can't find the background colors of these pages in the XMLs (I think you set them programmatically because even having added the attribute it doesn't change the background). Check it out, for you who know the app better than me it's a 2 minute thing.
Screenshot_20250209-115220
Screenshot_20250209-115224
Screenshot_20250209-115228

Some screenshots

Screenshot_20250209-115114
Screenshot_20250209-115117
Screenshot_20250209-115122
Screenshot_20250209-115127
Screenshot_20250209-115134

@gcantoni
Copy link
Author

gcantoni commented Feb 9, 2025

@d4rken d4rken added enhancement New feature, request, improvement or optimization General UI labels Feb 9, 2025
@d4rken
Copy link
Member

d4rken commented Feb 9, 2025

Thanks for the PR, will review it this week ❤️

Ref #1469 #1579

@gcantoni
Copy link
Author

gcantoni commented Feb 9, 2025

You are welcome Matthias. Feel free to drop me an email if you have any doubts.

There would be other distinctive elements of Material Design 3 to implement, such as an expanding toolbar and some other small changes. However, these changes already integrate Material Design 3 very well, bringing SD Maid's UI to a decidedly higher level.

@gcantoni
Copy link
Author

gcantoni commented Feb 9, 2025

@d4rken please include also this commit: gcantoni@e320446

  1. I added padding to all the cards (example: gcantoni@e320446#diff-c22cff08a1c1a91e7b2aaf1b1c331262e7e599df9f8c7b9f0173b3cb0b84a8f2R27)
  2. I fixed a style that caused an unpleasant white color tone (gcantoni@e320446#diff-1e051f2b0330608e92eba8edc616403ec7bdaa76e29ce0cfb794700686715925L199)
  3. I replaced the compose switches with the material ones in the planner to stay consistent with the rest of the switches (gcantoni@e320446#diff-009f36bb3edf7a78a1f63364442e1610a6b5d1404e23add7bd2733ec6da9e460L69)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature, request, improvement or optimization General UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants