Bläddra i källkod

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 år sedan
förälder
incheckning
d43c76ebdb

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

@@ -70,4 +70,9 @@ public class BottomTabsOptions {
70 70
         if (!backgroundColor.hasValue()) backgroundColor = defaultOptions.backgroundColor;
71 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 Visa fil

@@ -78,6 +78,8 @@ public class BottomTabsController extends ParentController implements AHBottomNa
78 78
         super.applyOptions(options);
79 79
         presenter.present(options);
80 80
         tabPresenter.present();
81
+        this.options.bottomTabsOptions.clearOneTimeOptions();
82
+        this.initialOptions.bottomTabsOptions.clearOneTimeOptions();
81 83
     }
82 84
 
83 85
     @Override