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

Material3 Migration & Misc. Improvements #1476

Closed
wants to merge 11 commits into from

Conversation

theimpulson
Copy link
Contributor

@theimpulson theimpulson commented Oct 19, 2023

Summary

This PR migrates the theme setup to use Material3 themes and does misc—improvements to the overall setup.

  • Switch to Material3 theme
  • Drop custom attributes altogether (resources are now accessed directly, tint and colors are accessed from standard public APIs)
  • Switch to MaterialAlertDialog everywhere possible
  • Switch to MaterialDatePicker for "Goto" feature

Dependent PRs

@Gitsaibot
Copy link
Contributor

Wow thanks for working on this. I had a quick look and I think the edit event page needs some work to look like it did before. To better evaluate all the changes, screenshots before/after would be good too. Is it still possible to change the view between light dark and black with your changes? For me, the view no longer changes when I choose between light and black, for example.

Before After
EditEvent_Before EditEvent_After

@theimpulson
Copy link
Contributor Author

Is it still possible to change the view between light dark and black with your changes? For me, the view no longer changes when I choose between light and black, for example.

Still working on that, but will try to keep it possible.

I had a quick look and I think the edit event page needs some work to look like it did before.

Fixed, thanks for checking. I assume there are more areas that need fixes as I can see multiple activities that still have old themes and behavior.

@Gitsaibot
Copy link
Contributor

Is it ok if I mention here already things that catch my eye or only when the design is ready?

Before After
Reminder_Before Reminder_After

I have marked the differences in yellow. The distance between the notifications should be a little smaller as before. The slider is purple when activated. And there is a crash when you want to change the timezone.

@Bnyro
Copy link

Bnyro commented Nov 10, 2023

This looks pretty cool, nice work!

I have some suggestions for minor additional changes that would make everything look a bit more MD3 :)

  1. Perhaps we want to use the new MaterialSwitch instead of the old MD3 one (it's possible to just replace the import everywhere to the one of the material design library, it's a drop-in replacement).
  2. The "Add reminder" button doesn't look very well in place in my opinion. I'd suppose using a normal MaterialButton with the OutlinedButton style to make it fit in better.
  3. The color picker dialog is still using Material Design 2 (I guess that's just because the app uses an external library for that, I'm not familiar with the code unfortunately. If so, this point can be ignored).
  4. The preference dialogs can be migrated to MD3 without much efforts too, I've implemented this for another app here.

If you have any questions let me know. I'm very excited to see this ongoing effort to move the MD3 :)

Cheers and keep on the good work ^)

@theimpulson
Copy link
Contributor Author

theimpulson commented Jan 16, 2024

@Gitsaibot a new review would be appreciated

@Gitsaibot
Copy link
Contributor

event_creation
slider
edit

@Gitsaibot
Copy link
Contributor

The "Primary color" setting does not work.

@Gitsaibot
Copy link
Contributor

Timezone_white_bg
vertical arrangement

@theimpulson theimpulson force-pushed the material3_re branch 3 times, most recently from dd9eac6 to ef8e741 Compare February 12, 2024 11:59
@theimpulson
Copy link
Contributor Author

The "Primary color" setting does not work.

@Gitsaibot where is this setting? Do you mean Themes?

@Gitsaibot
Copy link
Contributor

Yes, it is the third setting under general settings. There you can choose the primary color

@theimpulson
Copy link
Contributor Author

One of the issues I am not sure why is happening is that MaterialAlertDialogs are not visible unless they are made visible by calling show explicitly on the dialog instance (not the dialog fragment instance) which is weird. Seems to be only happening on Picker classes though.

@theimpulson
Copy link
Contributor Author

theimpulson commented Apr 3, 2024

@Gitsaibot is Black theme and pure black color setting same thing?

Edit 1:
The themes and pure black color setting should be now fixed. Looking into the primary color setting.

@theimpulson theimpulson force-pushed the material3_re branch 4 times, most recently from 3afa5b3 to 20ad486 Compare April 3, 2024 12:04
@Gitsaibot
Copy link
Contributor

is Black theme and pure black color setting same thing?

Yes, it's practically the same. If you select "System theme" in the theme settings and then activate the pure black setting, etar uses the black theme internally.

@theimpulson
Copy link
Contributor Author

I feel this PR is good to be merged as a base work. Not everything is pixel-perfect for sure but I feel they are minimal points and can be fixed in separate PRs now to avoid blocking this work.

What do you think @Gitsaibot @jspricke?

@Gitsaibot
Copy link
Contributor

Before we merge this one, I would suggest creating a new version first so that we can fully concentrate on this one. And I'd like to take another look at it.

@Gitsaibot
Copy link
Contributor

The question has nothing to do with the PR but I get this error in the Manifest.xml. Do you get that too?

foregroundServiceType:dataSync requires permission:[android.permission.FOREGROUND_SERVICE_DATA_SYNC]

@theimpulson
Copy link
Contributor Author

The question has nothing to do with the PR but I get this error in the Manifest.xml. Do you get that too?

foregroundServiceType:dataSync requires permission:[android.permission.FOREGROUND_SERVICE_DATA_SYNC]

Nope, I assume this is happening as I missed the permission here. Not related to this PR and very weird for it to happen now. Probably some new dependency added some check.

@Gitsaibot
Copy link
Contributor

Gitsaibot commented Apr 4, 2024

PureBlack setting does not work.

Before (old theme) After (old theme)
systemtheme pureblack
Before (new theme) After (new theme)
newtheme1 newtheme

If it is possible, the setting "pureBlack" should only be visible if system theme has been selected.

@theimpulson
Copy link
Contributor Author

@Gitsaibot I have restricted pure black to only apply if you select the dark or black theme. Maybe you selected theme first then enabled pure black setting?

@Gitsaibot
Copy link
Contributor

I don't quite understand that. The "pureBlack" setting should only has an effect if "System standard" is selected as the theme.

Step 1 choose systemtheme as theme
Step 2 activate pureBlack setting

This is what I wanted to show with the screenshots

@Gitsaibot
Copy link
Contributor

I also noticed:

  1. The vertical alignment in "EditEvent" of "Repeat Event" does not yet fit.
  2. The purple switch see screenshot(Comment 16 January) above. It is still purple.

@theimpulson
Copy link
Contributor Author

I don't quite understand that. The "pureBlack" setting should only has an effect if "System standard" is selected as the theme.

Step 1 choose systemtheme as theme Step 2 activate pureBlack setting

This is what I wanted to show with the screenshots

Got it, I was confused about when it should apply. I will fix it shortly.

@theimpulson
Copy link
Contributor Author

Rebased and fixed the pure black theme issue.

@theimpulson
Copy link
Contributor Author

2. The purple switch see screenshot(Comment 16 January) above. It is still purple.

I would like to fix dialogs in other PRs as they seem to be behaving weirdly for some unknown reason. I assume they will need a bit of work and cleanup.

@Gitsaibot
Copy link
Contributor

Rebased and fixed the pure black theme issue.

Now the black theme has the same background as the dark theme. Or am I wrong ?

@theimpulson
Copy link
Contributor Author

Rebased and fixed the pure black theme issue.

Now the black theme has the same background as the dark theme. Or am I wrong ?

My bad, fixed

@Gitsaibot
Copy link
Contributor

Gitsaibot commented Apr 4, 2024

Have you tested with an old version? Strange things happen to me when I change the themes or primary color.
Tested with Emulator Nexus 6 Api 22
strange behavior

edit: The pure black setting should not be visible at all on devices that do not support systemtheme.

@Gitsaibot
Copy link
Contributor

Some of the views also have completely wrong colors.

whiteDays
week

@theimpulson
Copy link
Contributor Author

I wasn't expecting these many issues. Let's hold the PR for now then. I will rework and open it again once ready.

@theimpulson theimpulson closed this Apr 4, 2024
@Gitsaibot
Copy link
Contributor

Okay, maybe we should also increase minSdk to at least 23 if it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants