Browse Source

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

* Fixed lightbox status bar color override on Android

* Added missing imports
Brendon Sled 7 years ago
parent
commit
c8af4fdf07

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

8
 import android.content.Context;
8
 import android.content.Context;
9
 import android.content.DialogInterface;
9
 import android.content.DialogInterface;
10
 import android.graphics.Color;
10
 import android.graphics.Color;
11
+import android.os.Build;
11
 import android.support.v4.view.animation.FastOutSlowInInterpolator;
12
 import android.support.v4.view.animation.FastOutSlowInInterpolator;
12
 import android.support.v7.app.AppCompatActivity;
13
 import android.support.v7.app.AppCompatActivity;
13
 import android.view.View;
14
 import android.view.View;
14
 import android.view.ViewGroup;
15
 import android.view.ViewGroup;
15
 import android.view.Window;
16
 import android.view.Window;
17
+import android.view.WindowManager;
16
 import android.widget.RelativeLayout;
18
 import android.widget.RelativeLayout;
17
-
18
 import com.reactnativenavigation.R;
19
 import com.reactnativenavigation.R;
19
 import com.reactnativenavigation.params.LightBoxParams;
20
 import com.reactnativenavigation.params.LightBoxParams;
20
 import com.reactnativenavigation.screens.Screen;
21
 import com.reactnativenavigation.screens.Screen;
36
         requestWindowFeature(Window.FEATURE_NO_TITLE);
37
         requestWindowFeature(Window.FEATURE_NO_TITLE);
37
         createContent(activity, params);
38
         createContent(activity, params);
38
         getWindow().setWindowAnimations(android.R.style.Animation);
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
     private void createContent(final Context context, LightBoxParams params) {
46
     private void createContent(final Context context, LightBoxParams params) {

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

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