소스 검색

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) {