pocket-casts-android
pocket-casts-android copied to clipboard
Incorrect cast icon color on Podcasts page with Classic Theme
This issue has been migrated from the old repository.
Message 1 Using the Classic theme, the cast icon on the Podcasts page is not properly getting the white color applied to it.

It appears that this occurs because we recently added a guard to prevent tinting that button with a color of -1
, which prevents true white (#FFFFFF
) from being applied since that resolves to -1
, but permits not-quite-white (#FFFFFE
) to be applied since that resolves to -2
. Removing the -1
check appears to fix this problem, but it's not clear to me why we added that check in the first place, so I wanted to see what your thoughts were here @geekygecko .
Message 2 It looks like the interface has a default of -1.
fun setupMediaRouterMenuButton(menu: Menu, buttonId: Int, tintColor: Int = -1)
I don't think in Kotlin you can define default values in an override method. Maybe we can just make that nullable, with a default of null.
Message 3
Maybe we can just make that nullable, with a default of null.
I like that idea. I did do a quick test of it and it worked well, so I opened #3376.
I am wondering if there is another issue lurking here with our themes though. It feels like the default color for the icon should be white, not black. This also crops up if you tap the podcast tab when you already have the podcast tab open—you'll briefly see the overflow dots (and the cast icon if your null
fix is applied) flip to black and before getting tinted to white. I haven't had a chance to look into that though.
In fact, on some themes the two icons switch to different colors:
Classic (both cast and overflow icons go black)
https://user-images.githubusercontent.com/4656348/166708864-5f9fd143-3a71-472f-af5d-30e80b8ae414.mp4
Electricity (cast goes white, overflow goes black)
https://user-images.githubusercontent.com/4656348/166708142-4631db61-f6df-4ea9-9b72-50d32bdf0741.mp4
Message 4 I think I might have found a way to fix this for the overflow icon.
Before is on the left and after the change is on the right.
If we know the icons are just being used in the toolbar we can apply the theme color attribute in the vector drawable like the following:
