|
@@ -5,7 +5,6 @@ import android.app.Activity;
|
5
|
5
|
import android.content.Context;
|
6
|
6
|
import android.graphics.Color;
|
7
|
7
|
import android.os.Build;
|
8
|
|
-import android.support.annotation.ColorInt;
|
9
|
8
|
import android.view.Window;
|
10
|
9
|
import android.widget.LinearLayout;
|
11
|
10
|
|
|
@@ -64,36 +63,36 @@ public class ScreenLayout extends LinearLayout implements ScrollDirectionListene
|
64
|
63
|
}
|
65
|
64
|
|
66
|
65
|
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
67
|
|
- private void setStatusBarColor(@ColorInt int statusBarColor) {
|
|
66
|
+ private void setStatusBarColor(ScreenStyleParams.Color statusBarColor) {
|
68
|
67
|
if (!SdkSupports.lollipop()) {
|
69
|
68
|
return;
|
70
|
69
|
}
|
71
|
70
|
|
72
|
71
|
final Activity context = (Activity) getContext();
|
73
|
72
|
final Window window = context.getWindow();
|
74
|
|
- if (statusBarColor > 0) {
|
75
|
|
- window.setStatusBarColor(statusBarColor);
|
|
73
|
+ if (statusBarColor.hasColor()) {
|
|
74
|
+ window.setStatusBarColor(statusBarColor.getColor());
|
76
|
75
|
} else {
|
77
|
76
|
window.setStatusBarColor(Color.BLACK);
|
78
|
77
|
}
|
79
|
78
|
}
|
80
|
79
|
|
81
|
|
- private void setTopBarColor(@ColorInt int topBarColor) {
|
82
|
|
- if (topBarColor > 0) {
|
83
|
|
- topBar.setBackgroundColor(topBarColor);
|
|
80
|
+ private void setTopBarColor(ScreenStyleParams.Color topBarColor) {
|
|
81
|
+ if (topBarColor.hasColor()) {
|
|
82
|
+ topBar.setBackgroundColor(topBarColor.getColor());
|
84
|
83
|
}
|
85
|
84
|
}
|
86
|
85
|
|
87
|
86
|
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
88
|
|
- public void setNavigationBarColor(int navigationBarColor) {
|
|
87
|
+ public void setNavigationBarColor(ScreenStyleParams.Color navigationBarColor) {
|
89
|
88
|
if (!SdkSupports.lollipop()) {
|
90
|
89
|
return;
|
91
|
90
|
}
|
92
|
91
|
|
93
|
92
|
final Activity context = (Activity) getContext();
|
94
|
93
|
final Window window = context.getWindow();
|
95
|
|
- if (navigationBarColor > 0) {
|
96
|
|
- window.setNavigationBarColor(navigationBarColor);
|
|
94
|
+ if (navigationBarColor.hasColor()) {
|
|
95
|
+ window.setNavigationBarColor(navigationBarColor.getColor());
|
97
|
96
|
} else {
|
98
|
97
|
window.setNavigationBarColor(Color.BLACK);
|
99
|
98
|
}
|