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

android: Add static color theme option #350

Merged
merged 22 commits into from
Aug 20, 2024

Conversation

kleidis
Copy link
Contributor

@kleidis kleidis commented Aug 12, 2024

This PR adds a new option on the Theme section with a list of pre-set colors

This might be useful for people stuck on Android 11 or earlier version of android and people who don't want to use Material You for whatever reason

What is left to do

  • Set proper theme color hex values

  • The ones i added are just generated placeholders and some of them don't look good at all
    ( help is needed for this as i am not sure how to approach this)

  • Test the new changes, especially on older Android versions

  • I only had the chance to test on Android 14 and a virtual Android 11 device. More testing is needed

Video showcase:

Settings:

Screen_Recording_20240812_173851_Lime3DS.mp4

colors: Fix names for the blue theme

strings: Update stirngs and names to actually lol
It is needed because the black theme was having issues needing a app retsart for the activity to fully chnage colors
The hex codes were quickly generated so some of them look awful and i'm not  sure how to go about on fixing them
Now the pop up has 2 steps

1 - Asking you for the preferred static theme color you would want
2 - Asking you if you want to enable material you / black backgrounds

Than it recreates the activity if the user hits ok

Also had to tweak the listener on ThemeUtil for this chnage
@OpenSauce04 OpenSauce04 added this to the 2118 milestone Aug 12, 2024
@OpenSauce04 OpenSauce04 added the enhancement New feature or request label Aug 12, 2024
@BlurrySquire BlurrySquire self-requested a review August 12, 2024 17:57
@BlurrySquire
Copy link
Contributor

  • Set proper theme color hex values
  • The ones i added are just generated placeholders and some of them don't look good at all
    ( help is needed for this as i am not sure how to approach this)

Testing before this has been implemented. The current themes work fine and don't bug out even when rapidly swapping between them. Also the Lime Green theme actually looks pretty good currently. I tested on Android 14.

@BlurrySquire BlurrySquire removed their request for review August 12, 2024 18:00
I ended up removing Indigo, as it was too similar to Blue
Also removed some useless duplicates
@kleidis
Copy link
Contributor Author

kleidis commented Aug 13, 2024

I ended up just copying the tone of default blue theme for all new themes i added, it results on a bit more of muted tone for the themes in dark mode.

I also tested the feature more on a virtual A11 device and it seems to work fine on my end

Now the PR is ready for review

@kleidis kleidis marked this pull request as ready for review August 13, 2024 11:36
@kleidis kleidis changed the title android: Add static color theme option support android: Add static color theme option & new setup page for theming Aug 13, 2024
@BlurrySquire BlurrySquire self-requested a review August 13, 2024 21:53
Copy link
Contributor

@BlurrySquire BlurrySquire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything works fine. I can switch between themes without lag or crashes. The theme menu on the config screen also works well. The code is also well-implemented.

@kleidis
Copy link
Contributor Author

kleidis commented Aug 14, 2024

There is a bug i missed

If the user updates from a previous version, the listener of ThemeUtil.kt never gets called meaning theme switching gets broken

Good one

You can also get the same effect by skipping the theme setup menu

@kleidis
Copy link
Contributor Author

kleidis commented Aug 16, 2024

Fixed that

Nothing left to do as far as I'm concerned

@kleidis kleidis requested a review from OpenSauce04 August 17, 2024 07:44
@OpenSauce04 OpenSauce04 added the squash This pull request should be squashed if approved label Aug 17, 2024
@kleidis kleidis changed the title android: Add static color theme option & new setup page for theming android: Add static color theme option Aug 19, 2024
@OpenSauce04 OpenSauce04 self-requested a review August 20, 2024 16:44
@OpenSauce04
Copy link
Member

OpenSauce04 commented Aug 20, 2024

Upon testing this PR, I've realized that this code appears to cause an instant crash on Android 9. I will continue to investigate the issue.

@kleidis
Copy link
Contributor Author

kleidis commented Aug 20, 2024

Upon testing this PR, I've realized that this code appears to cause an instant crash on Android 9. I will continue to investigate the issue.

I could spin up an Android 9 virtual device , weird that it even crashes in the first place

@OpenSauce04
Copy link
Member

OpenSauce04 commented Aug 20, 2024

Fixed it, it was caused by a typo.
You may want to push that fix to Mandarine, as they seemed to merge in a hurry.

@kleidis
Copy link
Contributor Author

kleidis commented Aug 20, 2024

Fixed it, it was caused by a typo.
You may want to push that fix to Mandarine, as they seemed to merge in a hurry.

Ah fucking classic by me, sorry
Ill tell the G to merge it as well

@OpenSauce04
Copy link
Member

The Lime theme doesn't seem to be very... Lime.
It's nearly identical to the Green theme, just slightly more yellow.
Given that it's so similar to an existing theme and the name kind of stands out in the list of primary colours, should we just drop it?

Copy link
Member

@OpenSauce04 OpenSauce04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me outside of the prior comment.
Outstanding license header warnings are to be ignored.

@kleidis
Copy link
Contributor Author

kleidis commented Aug 20, 2024

The Lime theme doesn't seem to be very... Lime.
It's nearly identical to the Green theme, just slightly more yellow.
Given that it's so similar to an existing theme and the name kind of stands out in the list of primary colours, should we just drop it?

White or Dark Mode?

@OpenSauce04
Copy link
Member

White or Dark Mode?

I tested using Dark Mode

@OpenSauce04
Copy link
Member

OpenSauce04 commented Aug 20, 2024

Actually now that I look at it again, the Green theme seems to be a little more blue than you would expect?

I would perhaps suggest dropping the Green theme and renaming the Lime theme to Green to replace it.

@kleidis
Copy link
Contributor Author

kleidis commented Aug 20, 2024

White or Dark Mode?

I tested using Dark Mode

Screenshot_20240820_205115_Lime3DS.jpg

Screenshot_20240820_205121_Lime3DS.jpg

On white mode, the difference is more noticitable, at least on my screen

But yeah, on dark mode, i feel like it's almost tue same

You can try to tweak the hex values of the dark lime theme, but if it ends up looking bad , just drop it.

@kleidis
Copy link
Contributor Author

kleidis commented Aug 20, 2024

Actually now that I look at it again, the Green theme seems to be a little more blue than you would expect?

I would perhaps suggest dropping the Green theme and renaming the Lime theme to Green to replace it.

Ok, then I'll do it tomorrow

@OpenSauce04
Copy link
Member

OpenSauce04 commented Aug 20, 2024

Ok, then I'll do it tomorrow

No need, I'll do it now. Just wanted your confirmation

@OpenSauce04 OpenSauce04 merged commit c2462e4 into azahar-emu:master Aug 20, 2024
9 of 10 checks passed
@OpenSauce04
Copy link
Member

OpenSauce04 commented Aug 20, 2024

Oops, meant to rebase the branch, not rebase and merge. 😜
Code was ready anyway, was just about to merge manually.

@OpenSauce04 OpenSauce04 added manual merge and removed squash This pull request should be squashed if approved labels Aug 20, 2024
@kleidis kleidis mentioned this pull request Sep 17, 2024
@kleidis kleidis deleted the material-me branch October 14, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants