|
@@ -7,6 +7,7 @@ import android.graphics.Color;
|
7
|
7
|
import android.os.Build;
|
8
|
8
|
import android.os.Bundle;
|
9
|
9
|
import android.support.v7.app.AppCompatActivity;
|
|
10
|
+import android.view.View;
|
10
|
11
|
import android.view.Window;
|
11
|
12
|
import android.widget.RelativeLayout;
|
12
|
13
|
|
|
@@ -23,6 +24,7 @@ import com.reactnativenavigation.params.BaseScreenParams;
|
23
|
24
|
import com.reactnativenavigation.params.ContextualMenuParams;
|
24
|
25
|
import com.reactnativenavigation.params.FabParams;
|
25
|
26
|
import com.reactnativenavigation.params.ScreenParams;
|
|
27
|
+import com.reactnativenavigation.params.StatusBarTextColorScheme;
|
26
|
28
|
import com.reactnativenavigation.params.StyleParams;
|
27
|
29
|
import com.reactnativenavigation.params.TitleBarButtonParams;
|
28
|
30
|
import com.reactnativenavigation.params.TitleBarLeftButtonParams;
|
|
@@ -104,6 +106,7 @@ public abstract class Screen extends RelativeLayout implements Subscriber {
|
104
|
106
|
|
105
|
107
|
public void setStyle() {
|
106
|
108
|
setStatusBarColor(styleParams.statusBarColor);
|
|
109
|
+ setStatusBarTextColorScheme(styleParams.statusBarTextColorScheme);
|
107
|
110
|
setNavigationBarColor(styleParams.navigationBarColor);
|
108
|
111
|
topBar.setStyle(styleParams);
|
109
|
112
|
if (styleParams.screenBackgroundColor.hasColor()) {
|
|
@@ -172,6 +175,25 @@ public abstract class Screen extends RelativeLayout implements Subscriber {
|
172
|
175
|
}
|
173
|
176
|
}
|
174
|
177
|
|
|
178
|
+ @TargetApi(Build.VERSION_CODES.M)
|
|
179
|
+ private void setStatusBarTextColorScheme(StatusBarTextColorScheme textColorScheme) {
|
|
180
|
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) return;
|
|
181
|
+ if (StatusBarTextColorScheme.Dark.equals(textColorScheme)) {
|
|
182
|
+ int flags = getSystemUiVisibility();
|
|
183
|
+ flags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
|
|
184
|
+ setSystemUiVisibility(flags);
|
|
185
|
+ } else {
|
|
186
|
+ clearLightStatusBar();
|
|
187
|
+ }
|
|
188
|
+ }
|
|
189
|
+
|
|
190
|
+ public void clearLightStatusBar() {
|
|
191
|
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) return;
|
|
192
|
+ int flags = getSystemUiVisibility();
|
|
193
|
+ flags &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
|
|
194
|
+ setSystemUiVisibility(flags);
|
|
195
|
+ }
|
|
196
|
+
|
175
|
197
|
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
176
|
198
|
public void setNavigationBarColor(StyleParams.Color navigationBarColor) {
|
177
|
199
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) return;
|