소스 검색

Fix multiple modal orientation issue (#1236)

Orientation was reverted to the app orientation each time modal was dismissed.
Guy Carmeli 7 년 전
부모
커밋
462ffcbb96

+ 1
- 2
android/app/src/main/java/com/reactnativenavigation/controllers/Modal.java 파일 보기

@@ -14,7 +14,6 @@ import com.reactnativenavigation.R;
14 14
 import com.reactnativenavigation.layouts.Layout;
15 15
 import com.reactnativenavigation.layouts.ModalScreenLayout;
16 16
 import com.reactnativenavigation.layouts.ScreenStackContainer;
17
-import com.reactnativenavigation.params.AppStyle;
18 17
 import com.reactnativenavigation.params.ContextualMenuParams;
19 18
 import com.reactnativenavigation.params.FabParams;
20 19
 import com.reactnativenavigation.params.Orientation;
@@ -190,11 +189,11 @@ public class Modal extends Dialog implements DialogInterface.OnDismissListener,
190 189
             return;
191 190
         }
192 191
         destroy();
193
-        setOrientation(AppStyle.appStyle.orientation);
194 192
         onModalDismissedListener.onModalDismissed(this);
195 193
     }
196 194
 
197 195
     void onModalDismissed() {
196
+        setOrientation(screenParams.styleParams.orientation);
198 197
         layout.onModalDismissed();
199 198
     }
200 199
 

+ 1
- 0
android/app/src/main/java/com/reactnativenavigation/controllers/NavigationActivity.java 파일 보기

@@ -413,6 +413,7 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
413 413
     private void handleModalDismissedEvent() {
414 414
         if (!modalController.isShowing()) {
415 415
             layout.onModalDismissed();
416
+            OrientationHelper.setOrientation(this, AppStyle.appStyle.orientation);
416 417
         }
417 418
     }
418 419