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,6 +111,7 @@ public class CollapsingViewPagerScreen extends ViewPagerScreen {
111 111
                 ((CollapsingContentView) contentView).destroy();
112 112
             }
113 113
         }
114
+        topBar.destroy();
114 115
     }
115 116
 
116 117
     protected ContentView getCurrentPage() {

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

@@ -150,4 +150,8 @@ public class TopBar extends AppBarLayout {
150 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,6 +27,13 @@ public class CollapsingTopBar extends TopBar implements CollapsingView {
27 27
     private final ViewCollapser viewCollapser;
28 28
     private final int topBarHeight;
29 29
 
30
+    @Override
31
+    public void destroy() {
32
+        if (params.hasReactView()) {
33
+            header.unmountReactView();
34
+        }
35
+    }
36
+
30 37
     public CollapsingTopBar(Context context, final StyleParams params) {
31 38
         super(context);
32 39
         styleParams = params;