From c3380f911cca2b431ccd0d0774ed615ffe743d4d Mon Sep 17 00:00:00 2001 From: Michael Gangolf Date: Fri, 12 Jul 2024 14:55:23 +0200 Subject: [PATCH] fix(android): keep Tab tintColor when changing icons --- .../ui/widget/tabgroup/TiUIBottomNavigationTabGroup.java | 2 +- .../titanium/ui/widget/tabgroup/TiUITabLayoutTabGroup.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigationTabGroup.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigationTabGroup.java index f63c4790757..2066bddbac2 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigationTabGroup.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigationTabGroup.java @@ -498,9 +498,9 @@ public void updateTabIcon(int index) if (tabProxy == null) { return; } - final Drawable drawable = TiUIHelper.getResourceDrawable(tabProxy.getProperty(TiC.PROPERTY_ICON)); this.mBottomNavigationView.getMenu().getItem(index).setIcon(drawable); + updateIconTint(); } @Override diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUITabLayoutTabGroup.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUITabLayoutTabGroup.java index 4023d321162..a4d35f234a3 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUITabLayoutTabGroup.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUITabLayoutTabGroup.java @@ -361,6 +361,7 @@ public void updateTabIcon(int index) TabLayout.Tab tab = this.mTabLayout.getTabAt(index); tab.setIcon(TiUIHelper.getResourceDrawable(tabProxy.getProperty(TiC.PROPERTY_ICON))); scaleIconToFit(tab); + updateIconTint(); } @Override