ソースを参照

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
     }
343
     }
344
 
344
 
345
     public void selectBottomTabByTabIndex(Integer index) {
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
     public void selectBottomTabByNavigatorId(final String navigatorId) {
351
     public void selectBottomTabByNavigatorId(final String navigatorId) {