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] Fix issues setting Shell TabBar appearance. #15734

Merged
merged 2 commits into from
Jul 4, 2023
Merged

Conversation

PureWeen
Copy link
Member

@PureWeen PureWeen commented Jun 19, 2023

Description of Change

Android portion of the following PR
#15447

Priority of how the colors are applied.

The APIs available to us are fairly limiting in scope. Ideally, we would make this all work through the VSM and just use two APIs (IconColor/TitleColor) but for now we are just making these APIs consistent between the platforms.

The three properties users have to influence the TabItem coloring are: TabBarUnselectedColor, TabBarTitleColor, and TabBarForegroundColor

  • If the user only sets Shell.TabBarTitleColor that will color the Title and Icon of the selected item. I realize this is a bit weird for TitleColor to change Icon color but this is currently how Android works and it's not really worth breaking this until we just introduce new APIs.
  • If Shell.TabBarTitleColor is not set then the TitleColor will match the TabBarForegroundColor
  • If TabBarForegroundColor is set and TabBarUnselectedColor isn't set then TabBarForegroundColor will be the color used for the text/icon of the selected TabItem
  • If TabBarUnselectedColor is the only thing set then that will be used for the text/icon color on the unselected Tab Item.

Examples

  • TabBarTitleColor: Green
    • Selected Icon is Green, Selected Text is Green, Unselected item matches system colors
  • TabBarForegroundColor: Blue
  • Selected Icon is Blue, Selected Text is Blue, Unselected item matches system colors
  • TabBarForegroundColor: Blue, TabBarTitleColor: Green
  • Selected Icon is Blue, Selected Text is Green, Unselected item matches system colors
  • Shell.ForegroundColor: Blue, TabBarTitleColor: Green (ForegroundColor propagates to TabBarForegroundColor).
  • Selected Icon is Blue, Selected Text is Green, Unselected item matches system colors
  • TabBarForegroundColor: Blue, TabBarTitleColor: Green, TabBarUnselectedColor: Pink
  • Selected Icon is Blue, Selected Text is Green, Unselected text and Icon is Pink

Breaking changes

  • Shell.ForegroundColor and Shell.TabBarForeGroundColor will now affect the android tab colors. If a user has ForegroundColor set, then the tab will match according to that color.

@jsuarezruiz jsuarezruiz added platform/android 🤖 t/bug Something isn't working area-controls-shell Shell Navigation, Routes, Tabs, Flyout labels Jun 20, 2023
@PureWeen PureWeen requested a review from jsuarezruiz June 20, 2023 07:59
@PureWeen PureWeen merged commit 327e162 into main Jul 4, 2023
@PureWeen PureWeen deleted the fix-12386-android branch July 4, 2023 07:45
@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2023
@samhouts samhouts added the fixed-in-8.0.0-preview.7.8842 Look for this fix in 8.0.0-preview.7.8842! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-shell Shell Navigation, Routes, Tabs, Flyout fixed-in-8.0.0-preview.7.8842 Look for this fix in 8.0.0-preview.7.8842! platform/android 🤖 t/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants