Browse Source

Recreate topBar background controller after it is destroyed

Guy Carmeli 6 years ago
parent
commit
be77d993b9

+ 5
- 0
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/topbar/TopBarBackgroundViewController.java View File

18
         this.viewCreator = viewCreator;
18
         this.viewCreator = viewCreator;
19
     }
19
     }
20
 
20
 
21
+    public TopBarBackgroundViewController(TopBarBackgroundViewController topBarBackgroundViewController) {
22
+        super(topBarBackgroundViewController.getActivity(), CompatUtils.generateViewId() + "", new Options());
23
+        this.viewCreator = topBarBackgroundViewController.viewCreator;
24
+    }
25
+
21
     @Override
26
     @Override
22
     protected TopBarBackgroundView createView() {
27
     protected TopBarBackgroundView createView() {
23
         return viewCreator.create(getActivity(), getId(), component);
28
         return viewCreator.create(getActivity(), getId(), component);

+ 1
- 0
lib/android/app/src/main/java/com/reactnativenavigation/views/topbar/TopBar.java View File

193
 
193
 
194
     public void clear() {
194
     public void clear() {
195
         topBarBackgroundViewController.destroy();
195
         topBarBackgroundViewController.destroy();
196
+        topBarBackgroundViewController = new TopBarBackgroundViewController(topBarBackgroundViewController);
196
         titleBar.clear();
197
         titleBar.clear();
197
     }
198
     }
198
 
199