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

Fix inconsistent icons in the app toolbar. #7163

Merged

Conversation

flofriday
Copy link
Contributor

Description

Closes: #7128
The problem was that the icons have their own color they use (attr/action_icon_color) which is fine, except in the toolbar where they should use a different color.

The fix applies a style to all toolbars where in the style only adds a theme for the surface which remaps the attr/action_icon_color to the color the other icons in the toolbar use.

Checklist

The problem was that the icons have their own color they use
(`attr/action_icon_color`) which is fine, except in the toolbar where
they should use a different color.

The fix applies a style to all toolbars where in the style only adds
a theme for the surface which remaps the `attr/action_icon_color` to
the color the other icons in the toolbar use.
@ByteHamster
Copy link
Member

Hmm, I think this looks a bit weird with the black title and gray icons. It also seems that many other apps with white toolbars (WhatsApp, Signal, Firefox, Tasks, Material Files, even the Android Settings app) use full-black action icons. I think we should switch the overflow menu icon to black instead of switching all other icons to gray.

@flofriday
Copy link
Contributor Author

No problem, now that I know where the right knobs are it should be super easy to switch to that ;)

Before they were quite a gray color but now they are more black on light
theme and more white on the dark theme.
@flofriday
Copy link
Contributor Author

flofriday commented May 5, 2024

I made them now vibrant.

I also discovered an issue with my solution which required me to remove the android:theme="?attr/actionBarTheme" from some screens. Removing that didn't have any visual impact and made my fix work on all screens. But maybe I don't know enough here and there was a good reason this was there.

Moreover I also discovered that the fix currently doesn't apply to the preferences, but I will look into that now.

Screenshots:
image

@flofriday
Copy link
Contributor Author

I can't seem to figure out how to style the toolbar from the settings screen. It is a little bit difficult since we don't create it directly but PreferenceScreen creates it for us (at least I think that is what's happening).

@ByteHamster
Copy link
Member

which required me to remove the android:theme="?attr/actionBarTheme" from some screens

This means style name="Widget.AntennaPod.ActionBar" is no longer applied to all toolbars. Not sure if that's a problem or if the style was just there for legacy reasons. The "blame" button on GitHub (or git blame) might give a cue why this style was added in the first place. We should also do some testing on devices/emulators with different Android versions and with/without the "dynamic colors" checkbox ticked.

I think we should be consistent across all screens, either removing the style completely or keeping it everywhere.

@flofriday
Copy link
Contributor Author

flofriday commented May 6, 2024

I agree, about consitency. Tracking down the changes I found that in commit 7f4d43d you refactored the toolbar and added the theme as it wasn't there before.

However later we switched from androidx.appcompat.widget.Toolbar to com.google.android.material.appbar.MaterialToolbar in commit ac81143.
So maybe it was only needed for the old toolbar and the new one doesn't neeed it anymore.

Anyway, I will do some testing on older devices but so far I am leaning towards removing it everywhere. As for non dynamic themes, it looks great there and is quite similar to the dynamic themes which is why I didn't include it in the screenshots before. Maybe I should have explained that more.

@flofriday
Copy link
Contributor Author

flofriday commented May 6, 2024

I just tested it on Android 5 (API 21) which is our lowest android target and the app still looks great. There are very few screens with an ugly toolbar but they are also there in on develop so my changes don't seem to destroy anything. 🎉

Screenshot of my changes:
image

Screenshot of the weired toolbar:
Again, this is also on develop and since android 5 is so old and the screen is bareley used I don't think we should put too much effort into it.
Screenshot 2024-05-06 at 11 59 23

@ByteHamster ByteHamster merged commit 6f572fa into AntennaPod:develop May 6, 2024
6 checks passed
@ByteHamster
Copy link
Member

Thanks!

I sneaked in a fix for the toolbar having a weird shadow :)

@flofriday
Copy link
Contributor Author

@ByteHamster your fix also makes the toolbar in the settings page blue with elevation, which looks kinda odd as the statusbar is still white.

Screenshot_20240507_085508

@ByteHamster
Copy link
Member

Oops, thanks. Apparently I didn't test well enough. Fixed in #7169

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.

None yet

2 participants