Преглед на файлове

Switch to tab only if it is not the currently selected tab

Guy Carmeli преди 7 години
родител
ревизия
ab44102f0c
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3
    1
      android/app/src/main/java/com/reactnativenavigation/layouts/BottomTabsLayout.java

+ 3
- 1
android/app/src/main/java/com/reactnativenavigation/layouts/BottomTabsLayout.java Целия файл

@@ -343,7 +343,9 @@ public class BottomTabsLayout extends BaseLayout implements AHBottomNavigation.O
343 343
     }
344 344
 
345 345
     public void selectBottomTabByTabIndex(Integer index) {
346
-        bottomTabs.setCurrentItem(index);
346
+        if (bottomTabs.getCurrentItem() != index) {
347
+            bottomTabs.setCurrentItem(index);
348
+        }
347 349
     }
348 350
 
349 351
     public void selectBottomTabByNavigatorId(final String navigatorId) {