Browse Source

Fix react-native-youtube support (#6220)

Support for the react-native-youtube package was added in #5999 but due to a faulty merge it wasn't complete.

Fixes #6214
Guy Carmeli 4 years ago
parent
commit
4d8d2ae40a
No account linked to committer's email address

+ 3
- 2
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/navigator/Navigator.java View File

1
 package com.reactnativenavigation.viewcontrollers.navigator;
1
 package com.reactnativenavigation.viewcontrollers.navigator;
2
 
2
 
3
 import android.app.Activity;
3
 import android.app.Activity;
4
+import android.view.View;
4
 import android.view.ViewGroup;
5
 import android.view.ViewGroup;
5
 
6
 
6
 import com.facebook.react.ReactInstanceManager;
7
 import com.facebook.react.ReactInstanceManager;
63
     public void setContentLayout(ViewGroup contentLayout) {
64
     public void setContentLayout(ViewGroup contentLayout) {
64
         this.contentLayout = contentLayout;
65
         this.contentLayout = contentLayout;
65
         contentLayout.addView(rootLayout);
66
         contentLayout.addView(rootLayout);
66
-        contentLayout.addView(modalsLayout);
67
-        contentLayout.addView(overlaysLayout);
67
+        modalsLayout.setVisibility(View.GONE); contentLayout.addView(modalsLayout);
68
+        overlaysLayout.setVisibility(View.GONE); contentLayout.addView(overlaysLayout);
68
     }
69
     }
69
 
70
 
70
     public Navigator(final Activity activity, ChildControllersRegistry childRegistry, ModalStack modalStack, OverlayManager overlayManager, RootPresenter rootPresenter) {
71
     public Navigator(final Activity activity, ChildControllersRegistry childRegistry, ModalStack modalStack, OverlayManager overlayManager, RootPresenter rootPresenter) {

+ 8
- 0
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/navigator/NavigatorTest.java View File

124
         uut.setContentLayout(contentLayout);
124
         uut.setContentLayout(contentLayout);
125
     }
125
     }
126
 
126
 
127
+    @Test
128
+    public void setContentLayout_modalAndOverlayLayoutsAreGONE() {
129
+        ViewGroup contentLayout = Mockito.mock(ViewGroup.class);
130
+        uut.setContentLayout(contentLayout);
131
+        assertThat(uut.getModalsLayout().getVisibility()).isEqualTo(View.GONE);
132
+        assertThat(uut.getOverlaysLayout().getVisibility()).isEqualTo(View.GONE);
133
+    }
134
+
127
     @Test
135
     @Test
128
     public void bindViews() {
136
     public void bindViews() {
129
         verify(rootPresenter).setRootContainer(uut.getRootLayout());
137
         verify(rootPresenter).setRootContainer(uut.getRootLayout());