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: Modernize theming system #10608

Merged
merged 1 commit into from
May 8, 2022
Merged

Android: Modernize theming system #10608

merged 1 commit into from
May 8, 2022

Conversation

t895
Copy link
Contributor

@t895 t895 commented Apr 24, 2022

themes.xml now contains a collection of colors, attributes, and styles. No visuals have changed, but this will allow for a more flexible theming system in the future for custom day/night/etc themes. This also removes a bunch of redundant code that is now written as global styles and inherited themes.

@JosJuice
Copy link
Member

JosJuice commented Apr 24, 2022

As a part of this PR, you are effectively reverting PR #8718. Have you tested that this doesn't break TvMainActivity?

@t895
Copy link
Contributor Author

t895 commented Apr 24, 2022

I have not. I've actually had trouble getting dolphin working on an android tv emulator (even before this commit). Would you mind sharing a way to test that so I'm not creating a regression?

@JosJuice
Copy link
Member

What I do is I run TvMainActivity on my phone. In Android Studio, go to Edit Configurations, set Launch to the option Specified Activity, and enter org.dolphinemu.dolphinemu.TvMainActivity as the activity name.

@t895
Copy link
Contributor Author

t895 commented Apr 24, 2022

OH, that's really cool. It does crash, but I found a fix.

@JosJuice
Copy link
Member

JosJuice commented Apr 24, 2022

Ah, nice to see that there's a simpler solution than what I went with! But is there a particular reason why it's using FilePickerAlertDialogTheme? I suppose FilePickerAlertDialogTheme and DolphinDialogBase are very similar, but just naming-wise it feels weird... If you want to use FilePickerAlertDialogTheme for things other than the file picker, maybe rename it to DolphinDialogBase and remove the old DolphinDialogBase?

@t895
Copy link
Contributor Author

t895 commented Apr 24, 2022

I could actually just get rid of the FilePickerAlertDialogTheme by extending the definition for DolphinDialogBase with colorPrimaryDark and colorAccent. Then everything could use DolphinDialogBase and work the same.

Copy link
Member

@JosJuice JosJuice left a comment

Choose a reason for hiding this comment

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

Seems reasonable. But I'd say let's wait with merging this until after the next beta, just in case there are other surprises like that Android TV crash.

By the way, I've sent you an invite that will let your pull requests get built automatically. It should be in your emails by now.

@t895
Copy link
Contributor Author

t895 commented Apr 24, 2022

Oh wow, thank you. I just accepted it.

I'll squash my commits and wait until after the upcoming beta for a merge.

themes.xml now contains a collection of colors, attributes, and styles. No visuals have changed, but this will allow for a more flexible theming system in the future for custom day/night/etc themes. This also removes a bunch of redundant code that can now be written as global styles and inherited themes.
@JosJuice JosJuice merged commit 31232f8 into dolphin-emu:master May 8, 2022
@t895 t895 deleted the theme-refactor branch May 12, 2022 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants