Skip to content

Comments

feat(Android, Tabs): Add support for selectedIcon on Android#3633

Open
t0maboro wants to merge 14 commits intomainfrom
@t0maboro/android-selected-icon-support
Open

feat(Android, Tabs): Add support for selectedIcon on Android#3633
t0maboro wants to merge 14 commits intomainfrom
@t0maboro/android-selected-icon-support

Conversation

@t0maboro
Copy link
Contributor

@t0maboro t0maboro commented Feb 11, 2026

Description

This PR adds support for the selectedIcon prop on Android. I'm not sure why it was omitted initially, but it's possible to implement it by checking whether the tab is focused. To maintain backward compatibility, I've extended the existing type with an alternative to support both current and previous behavior.

Caution

The type for selectedIcon was intentionally changed from PlatformIconIOS to PlatformIcon. Since tabs are still an experimental component, we want to avoid additional maintenance overhead. This change is shipped with a compatibility flag.

Closes: https://github.com/software-mansion/react-native-screens-labs/issues/954 (let me split the original issue 773 from labs to 2 separate sub-issues, as they touch completely different mechanisms)

Changes

  • Added props for native component on android.
  • Extended type definition for external API
  • Updated example

Before & after - visual documentation

(No before section, new API)

selectedIcon.mov

Test plan

I've updated TestBottomTabs to use selectedIcon of type PlatformIcon. All other examples using that prop were intentionally left unchanged for regression testing.

Checklist

  • Included code example that can be used to test this change.
  • Updated / created local changelog entries in relevant test files.
  • For visual changes, included screenshots / GIFs / recordings documenting the change.
  • For API changes, updated relevant public types.
  • Ensured that CI passes

@t0maboro t0maboro marked this pull request as ready for review February 12, 2026 09:06
@t0maboro t0maboro requested a review from kligarski February 16, 2026 08:50
Copy link
Contributor

@kligarski kligarski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that if you use image as an icon, you cannot clear the icon later in the runtime:

Screen.Recording.2026-02-17.at.16.28.22.mov

The same happens for regular icon (so it's probably not a regression introduced in this PR but selectedIcon suffers from the same problem -> not sure if we need to handle it in this PR or not).

@t0maboro t0maboro requested a review from kligarski February 17, 2026 15:37
@t0maboro
Copy link
Contributor Author

I noticed that if you use image as an icon, you cannot clear the icon later in the runtime:

Reproducible on main either, I'm creating a ticket for that, as it's unrelated to these changes. https://github.com/software-mansion/react-native-screens-labs/issues/975

@t0maboro t0maboro force-pushed the @t0maboro/android-selected-icon-support branch from d52420d to 3aacd08 Compare February 23, 2026 14:05
* for `selectedIcon` prop for BottomTabs on Android. To allow backward compatibility,
* we expose a way to check whether the new implementation is in use or not.
*/
isSelectedIconSupportedForAndroidBottomTabs: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: should be coordinated with #3672

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.

2 participants