Browse Source

Unmount react header on destroy

Guy Carmeli 7 years ago
parent
commit
7a2446a5de

+ 1
- 0
android/app/src/main/java/com/reactnativenavigation/screens/CollapsingViewPagerScreen.java View File

111
                 ((CollapsingContentView) contentView).destroy();
111
                 ((CollapsingContentView) contentView).destroy();
112
             }
112
             }
113
         }
113
         }
114
+        topBar.destroy();
114
     }
115
     }
115
 
116
 
116
     protected ContentView getCurrentPage() {
117
     protected ContentView getCurrentPage() {

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

150
             titleBar.show();
150
             titleBar.show();
151
         }
151
         }
152
     }
152
     }
153
+
154
+    public void destroy() {
155
+
156
+    }
153
 }
157
 }

+ 7
- 0
android/app/src/main/java/com/reactnativenavigation/views/collapsingToolbar/CollapsingTopBar.java View File

27
     private final ViewCollapser viewCollapser;
27
     private final ViewCollapser viewCollapser;
28
     private final int topBarHeight;
28
     private final int topBarHeight;
29
 
29
 
30
+    @Override
31
+    public void destroy() {
32
+        if (params.hasReactView()) {
33
+            header.unmountReactView();
34
+        }
35
+    }
36
+
30
     public CollapsingTopBar(Context context, final StyleParams params) {
37
     public CollapsingTopBar(Context context, final StyleParams params) {
31
         super(context);
38
         super(context);
32
         styleParams = params;
39
         styleParams = params;