|
|
|
|
1
|
package com.reactnativenavigation.screens;
|
1
|
package com.reactnativenavigation.screens;
|
2
|
|
2
|
|
3
|
import android.annotation.TargetApi;
|
3
|
import android.annotation.TargetApi;
|
4
|
-import android.app.Activity;
|
|
|
5
|
import android.content.res.Configuration;
|
4
|
import android.content.res.Configuration;
|
6
|
import android.graphics.Color;
|
5
|
import android.graphics.Color;
|
7
|
import android.os.Build;
|
6
|
import android.os.Build;
|
|
|
|
|
198
|
public void setNavigationBarColor(StyleParams.Color navigationBarColor) {
|
197
|
public void setNavigationBarColor(StyleParams.Color navigationBarColor) {
|
199
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) return;
|
198
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) return;
|
200
|
|
199
|
|
201
|
- final Activity context = (Activity) getContext();
|
|
|
202
|
- final Window window = context.getWindow();
|
|
|
|
|
200
|
+ final Window window = ((NavigationActivity) activity).getScreenWindow();
|
203
|
if (navigationBarColor.hasColor()) {
|
201
|
if (navigationBarColor.hasColor()) {
|
204
|
window.setNavigationBarColor(navigationBarColor.getColor());
|
202
|
window.setNavigationBarColor(navigationBarColor.getColor());
|
205
|
} else {
|
203
|
} else {
|