Browse Source

Clear onetime BottomTabs options after applying options

Now that BottomTabs options are applied on self, they need to be cleared after applying initial options.
Guy Carmeli 6 years ago
parent
commit
d43c76ebdb

+ 5
- 0
lib/android/app/src/main/java/com/reactnativenavigation/parse/BottomTabsOptions.java View File

70
         if (!backgroundColor.hasValue()) backgroundColor = defaultOptions.backgroundColor;
70
         if (!backgroundColor.hasValue()) backgroundColor = defaultOptions.backgroundColor;
71
         if (!titleDisplayMode.hasValue()) titleDisplayMode = defaultOptions.titleDisplayMode;
71
         if (!titleDisplayMode.hasValue()) titleDisplayMode = defaultOptions.titleDisplayMode;
72
     }
72
     }
73
+
74
+    public void clearOneTimeOptions() {
75
+        currentTabId = new NullText();
76
+        currentTabIndex = new NullNumber();
77
+    }
73
 }
78
 }

+ 2
- 0
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsController.java View File

78
         super.applyOptions(options);
78
         super.applyOptions(options);
79
         presenter.present(options);
79
         presenter.present(options);
80
         tabPresenter.present();
80
         tabPresenter.present();
81
+        this.options.bottomTabsOptions.clearOneTimeOptions();
82
+        this.initialOptions.bottomTabsOptions.clearOneTimeOptions();
81
     }
83
     }
82
 
84
 
83
     @Override
85
     @Override