소스 검색

Fix BottomTabs background color changing to white background sometimes

For some reason, AHBottomNavigation has two background color properties - backgroundColor and defaultBackgroundColor. Sometimes the default background color is applied, which causes the BottomTabs to be colored white.

Closes #5533
Guy Carmeli 5 년 전
부모
커밋
57eb0db7da
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6
    0
      lib/android/app/src/main/java/com/reactnativenavigation/views/BottomTabs.java

+ 6
- 0
lib/android/app/src/main/java/com/reactnativenavigation/views/BottomTabs.java 파일 보기

@@ -64,6 +64,12 @@ public class BottomTabs extends AHBottomNavigation {
64 64
         if (getTitleState() != titleState) super.setTitleState(titleState);
65 65
     }
66 66
 
67
+    @Override
68
+    public void setBackgroundColor(int color) {
69
+        super.setBackgroundColor(color);
70
+        if (getDefaultBackgroundColor() != color) setDefaultBackgroundColor(color);
71
+    }
72
+
67 73
     public void setText(int index, String text) {
68 74
         AHBottomNavigationItem item = getItem(index);
69 75
         if (!item.getTitle(getContext()).equals(text)) {