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

[iOS] [Android] Fix for the FontImageSource color is not applied properly to the Tab Icon #26757

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Tamilarasan-Paranthaman
Copy link
Contributor

Root Cause of the issue

iOS

  • The regression occurred because a previous PR changed the UIImageRenderingMode to Automatic, causing the TabbedPage tab icon to ignore the FontImageSource.Color.

Android

  • In Android, setting the FontImageSource.Color does not apply to the TabbedPage icon.

Description of Change

iOS

I have resolved the issue by setting the UIImageRenderingMode to Automatic when the FontImageSource is null. If the color is already applied to the FontImageSource, the UIImageRenderingMode is set to AlwaysOriginal.

Android

I have fixed the TabIcon color issue for the default TabBar placement in the SetIconColorFilter method. If the FontImageSource color is specified in the sample, it returns null and no need to update the color. If the FontImageSource color is null, the method retrieves the color using GetItemIconTintColorState to apply the appropriate color based on SelectedTabColor and UnselectedTabColor.

Additionally, some common cases were broken in the GetItemIconTintColorState method. For example, if no SelectedTabColor, UnselectedTabColor, or ContentPage FontImageSource color is provided, the TabIcons should use the default color. However, the method was returning null prematurely, preventing the default color from being applied to the TabIcons.

I have also addressed these additional cases. For instance, if none of the SelectedTabColor, UnselectedTabColor, or ContentPage FontImageSource colors are specified, the TabIcons will now correctly use the default color.

Regressed PR

Revert PR

Issues Fixed

Fixes #26662

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Screenshot

Android

Before Issue Fix After Issue Fix

iOS

Before Issue Fix After Issue Fix

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Dec 20, 2024
Copy link
Contributor

Hey there @Tamilarasan-Paranthaman! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-tabbedpage TabbedPage community ✨ Community Contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to dynamically set unselected IconImageSource Color on Android
2 participants