Sfoglia il codice sorgente

Fixed lightbox status bar color override on Android (#1396)

* Fixed lightbox status bar color override on Android

* Added missing imports
Brendon Sled 7 anni fa
parent
commit
c8af4fdf07

+ 6
- 1
android/app/src/main/java/com/reactnativenavigation/views/LightBox.java Vedi File

@@ -8,13 +8,14 @@ import android.app.Dialog;
8 8
 import android.content.Context;
9 9
 import android.content.DialogInterface;
10 10
 import android.graphics.Color;
11
+import android.os.Build;
11 12
 import android.support.v4.view.animation.FastOutSlowInInterpolator;
12 13
 import android.support.v7.app.AppCompatActivity;
13 14
 import android.view.View;
14 15
 import android.view.ViewGroup;
15 16
 import android.view.Window;
17
+import android.view.WindowManager;
16 18
 import android.widget.RelativeLayout;
17
-
18 19
 import com.reactnativenavigation.R;
19 20
 import com.reactnativenavigation.params.LightBoxParams;
20 21
 import com.reactnativenavigation.screens.Screen;
@@ -36,6 +37,10 @@ public class LightBox extends Dialog implements DialogInterface.OnDismissListene
36 37
         requestWindowFeature(Window.FEATURE_NO_TITLE);
37 38
         createContent(activity, params);
38 39
         getWindow().setWindowAnimations(android.R.style.Animation);
40
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
41
+            getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
42
+            getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
43
+        }
39 44
     }
40 45
 
41 46
     private void createContent(final Context context, LightBoxParams params) {

+ 1
- 0
android/app/src/main/res/values/styles.xml Vedi File

@@ -7,6 +7,7 @@
7 7
 
8 8
     <style name="LightBox" parent="@android:style/Theme.Translucent.NoTitleBar">
9 9
         <item name="android:windowAnimationStyle">@style/modalAnimations</item>
10
+        <item name="android:statusBarColor" tools:targetApi="lollipop">@android:color/transparent</item>
10 11
     </style>
11 12
 
12 13
     <style name="modalAnimations">