-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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] Top bar item colors - fix #26964
base: main
Are you sure you want to change the base?
Conversation
Hey there @kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
90bf31b
to
3831a77
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
@kubaflo, I believe removing SetIconColorFilter is not appropriate, as it could cause issues in certain scenarios involving FontImageSource color. Recently, I fixed the FontImageSource color issue on the TabbedPage icon. The PR can be found here: [iOS] [Android] Fix for the FontImageSource color is not applied properly to the Tab Icon by Tamilarasan-Paranthaman · Pull Request #26757 · dotnet/maui For instance, if there are two ContentPage instances as children of a TabbedPage, setting SelectedTabColor to red while applying different FontImageSource colors to each page may not work as expected. The SetIconColorFilter method handles the Icon.InvalidateSelf call, ensuring that the icon is updated correctly. |
Hi @Tamilarasan-Paranthaman this pr actually fixes the issue in your PR. And there's no need for Screen.Recording.2025-01-06.at.18.09.05.mov |
Azure Pipelines successfully started running 3 pipeline(s). |
Can we make sure adding a menu item and disable and enable it with have the correct colors? |
@kubaflo, can you please fully utilize my test sample? I have added the SelectedTabColor and UnSelectedTabColor, but no FontImageSource color is specified for the first page. Only the second and third pages have the FontImageSource color defined. With your fix, the FontImageSource color is not applied to the second and third pages. I have handled the FontImageSource color for different scenarios by using combinations of SelectedTabColor, UnSelectedTabColor, and the FontImageSource color in my PR. It works properly. |
Description
Android docs: https://developer.android.com/reference/com/google/android/material/tabs/TabLayout#setTabIconTint(android.content.res.ColorStateList)
An easy fix is to just add
_tabLayout.TabIconTint = colors;
I did it in the first commit. However, I've noticed that thanks to it there's no longer need to haveSetIconColorFilter()
method, and, thereby, significantly reduce the size and complexity of this class. But maybe I'm missing something 🤔Issues Fixed
Fixes #26905
Fixes #26662
Screen.Recording.2025-01-05.at.19.53.17.mov
Screen.Recording.2025-01-05.at.19.54.38.mov
@jsuarezruiz what do you think?