Browse Source

Fix multiple modal orientation issue (#1236)

Orientation was reverted to the app orientation each time modal was dismissed.
Guy Carmeli 7 years ago
parent
commit
462ffcbb96

+ 1
- 2
android/app/src/main/java/com/reactnativenavigation/controllers/Modal.java View File

14
 import com.reactnativenavigation.layouts.Layout;
14
 import com.reactnativenavigation.layouts.Layout;
15
 import com.reactnativenavigation.layouts.ModalScreenLayout;
15
 import com.reactnativenavigation.layouts.ModalScreenLayout;
16
 import com.reactnativenavigation.layouts.ScreenStackContainer;
16
 import com.reactnativenavigation.layouts.ScreenStackContainer;
17
-import com.reactnativenavigation.params.AppStyle;
18
 import com.reactnativenavigation.params.ContextualMenuParams;
17
 import com.reactnativenavigation.params.ContextualMenuParams;
19
 import com.reactnativenavigation.params.FabParams;
18
 import com.reactnativenavigation.params.FabParams;
20
 import com.reactnativenavigation.params.Orientation;
19
 import com.reactnativenavigation.params.Orientation;
190
             return;
189
             return;
191
         }
190
         }
192
         destroy();
191
         destroy();
193
-        setOrientation(AppStyle.appStyle.orientation);
194
         onModalDismissedListener.onModalDismissed(this);
192
         onModalDismissedListener.onModalDismissed(this);
195
     }
193
     }
196
 
194
 
197
     void onModalDismissed() {
195
     void onModalDismissed() {
196
+        setOrientation(screenParams.styleParams.orientation);
198
         layout.onModalDismissed();
197
         layout.onModalDismissed();
199
     }
198
     }
200
 
199
 

+ 1
- 0
android/app/src/main/java/com/reactnativenavigation/controllers/NavigationActivity.java View File

413
     private void handleModalDismissedEvent() {
413
     private void handleModalDismissedEvent() {
414
         if (!modalController.isShowing()) {
414
         if (!modalController.isShowing()) {
415
             layout.onModalDismissed();
415
             layout.onModalDismissed();
416
+            OrientationHelper.setOrientation(this, AppStyle.appStyle.orientation);
416
         }
417
         }
417
     }
418
     }
418
 
419