From a84fa8508d12e32cb2437423e5a7558cf486ee4d Mon Sep 17 00:00:00 2001
From: Michael Gangolf <migamiga@web.de>
Date: Tue, 20 Aug 2024 15:49:50 +0200
Subject: [PATCH] more functions

---
 .../modules/titanium/ui/widget/TiUITabbedBar.java   | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUITabbedBar.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUITabbedBar.java
index 67acbfb529a..8ca71d59e4b 100644
--- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUITabbedBar.java
+++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUITabbedBar.java
@@ -409,11 +409,8 @@ private void onTabIndexChangedTo(int index)
 			// First, update the proxy's "index" property.
 			proxy.setProperty(TiC.PROPERTY_INDEX, index);
 
-			if (this.tabLayout.getTabAt(index).getIcon() != null
-				&& proxy.hasPropertyAndNotNull(TiC.PROPERTY_ACTIVE_TINT_COLOR)) {
-				this.tabLayout.getTabAt(index).getIcon().setColorFilter(
-					TiConvert.toColor(proxy.getProperty(TiC.PROPERTY_ACTIVE_TINT_COLOR),
-						TiApplication.getAppCurrentActivity()), PorterDuff.Mode.SRC_IN);
+			if (proxy.hasPropertyAndNotNull(TiC.PROPERTY_ACTIVE_TINT_COLOR)) {
+				setTintColor(this.tabLayout.getTabAt(index), TiC.PROPERTY_ACTIVE_TINT_COLOR);
 			}
 
 			// Last, fire a "click" event.
@@ -429,10 +426,8 @@ private void onTabIndexChangedTo(int index)
 	public void onTabUnselected(TabLayout.Tab tab)
 	{
 		// set old tint color again
-		if (tab.getIcon() != null && proxy.hasPropertyAndNotNull(TiC.PROPERTY_TINT_COLOR)) {
-			tab.getIcon().setColorFilter(
-				TiConvert.toColor(proxy.getProperty(TiC.PROPERTY_TINT_COLOR), TiApplication.getAppCurrentActivity()),
-				PorterDuff.Mode.SRC_IN);
+		if (proxy.hasPropertyAndNotNull(TiC.PROPERTY_TINT_COLOR)) {
+			setTintColor(tab, TiC.PROPERTY_TINT_COLOR);
 		}
 	}