|
@@ -1,5 +1,6 @@
|
1
|
1
|
/*
|
2
|
|
- * Copyright @ 2018-present Atlassian Pty Ltd
|
|
2
|
+ * Copyright @ 2018-present 8x8, Inc.
|
|
3
|
+ * Copyright @ 2018 Atlassian Pty Ltd
|
3
|
4
|
*
|
4
|
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -21,7 +22,6 @@ import android.content.Context;
|
21
|
22
|
import android.os.Bundle;
|
22
|
23
|
import android.support.annotation.NonNull;
|
23
|
24
|
import android.support.annotation.Nullable;
|
24
|
|
-import android.util.Log;
|
25
|
25
|
import android.widget.FrameLayout;
|
26
|
26
|
|
27
|
27
|
import com.facebook.react.ReactRootView;
|
|
@@ -194,29 +194,10 @@ public abstract class BaseReactView<ListenerT>
|
194
|
194
|
super.onWindowFocusChanged(hasFocus);
|
195
|
195
|
|
196
|
196
|
// https://github.com/mockingbot/react-native-immersive#restore-immersive-state
|
197
|
|
-
|
198
|
|
- // FIXME The singleton pattern employed by RNImmersiveModule is not
|
199
|
|
- // advisable because a react-native mobule is consumable only after its
|
200
|
|
- // BaseJavaModule#initialize() has completed and here we have no
|
201
|
|
- // knowledge of whether the precondition is really met.
|
202
|
197
|
RNImmersiveModule immersive = RNImmersiveModule.getInstance();
|
203
|
198
|
|
204
|
199
|
if (hasFocus && immersive != null) {
|
205
|
|
- try {
|
206
|
|
- immersive.emitImmersiveStateChangeEvent();
|
207
|
|
- } catch (RuntimeException re) {
|
208
|
|
- // FIXME I don't know how to check myself whether
|
209
|
|
- // BaseJavaModule#initialize() has been invoked and thus
|
210
|
|
- // RNImmersiveModule is consumable. A safe workaround is to
|
211
|
|
- // swallow the failure because the whole full-screen/immersive
|
212
|
|
- // functionality is brittle anyway, akin to the icing on the
|
213
|
|
- // cake, and has been working without onWindowFocusChanged for a
|
214
|
|
- // very long time.
|
215
|
|
- Log.e(
|
216
|
|
- "RNImmersiveModule",
|
217
|
|
- "emitImmersiveStateChangeEvent() failed!",
|
218
|
|
- re);
|
219
|
|
- }
|
|
200
|
+ immersive.emitImmersiveStateChangeEvent();
|
220
|
201
|
}
|
221
|
202
|
}
|
222
|
203
|
|