Browse Source

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 years ago
parent
commit
57eb0db7da

+ 6
- 0
lib/android/app/src/main/java/com/reactnativenavigation/views/BottomTabs.java View File

64
         if (getTitleState() != titleState) super.setTitleState(titleState);
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
     public void setText(int index, String text) {
73
     public void setText(int index, String text) {
68
         AHBottomNavigationItem item = getItem(index);
74
         AHBottomNavigationItem item = getItem(index);
69
         if (!item.getTitle(getContext()).equals(text)) {
75
         if (!item.getTitle(getContext()).equals(text)) {