@@ -49,7 +49,7 @@ public StatusBarView(Context context) {
49
49
* @param activity 需要设置的 activity
50
50
* @param color 状态栏颜色值
51
51
*/
52
- public static void setColor (Activity activity , @ ColorInt int color ) {
52
+ public static void setColor (Activity activity , int color ) {
53
53
setColor (activity , color , DEFAULT_STATUS_BAR_ALPHA );
54
54
}
55
55
@@ -61,7 +61,7 @@ public static void setColor(Activity activity, @ColorInt int color) {
61
61
* @param statusBarAlpha 状态栏透明度
62
62
*/
63
63
64
- public static void setColor (Activity activity , @ ColorInt int color , int statusBarAlpha ) {
64
+ public static void setColor (Activity activity , int color , int statusBarAlpha ) {
65
65
if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .LOLLIPOP ) {
66
66
activity .getWindow ().addFlags (WindowManager .LayoutParams .FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS );
67
67
activity .getWindow ().clearFlags (WindowManager .LayoutParams .FLAG_TRANSLUCENT_STATUS );
@@ -86,7 +86,7 @@ public static void setColor(Activity activity, @ColorInt int color, int statusBa
86
86
* @param activity 需要设置的activity
87
87
* @param color 状态栏颜色值
88
88
*/
89
- public static void setColorForSwipeBack (Activity activity , @ ColorInt int color ) {
89
+ public static void setColorForSwipeBack (Activity activity , int color ) {
90
90
setColorForSwipeBack (activity , color , DEFAULT_STATUS_BAR_ALPHA );
91
91
}
92
92
@@ -97,7 +97,7 @@ public static void setColorForSwipeBack(Activity activity, @ColorInt int color)
97
97
* @param color 状态栏颜色值
98
98
* @param statusBarAlpha 状态栏透明度
99
99
*/
100
- public static void setColorForSwipeBack (Activity activity , @ ColorInt int color , int statusBarAlpha ) {
100
+ public static void setColorForSwipeBack (Activity activity , int color , int statusBarAlpha ) {
101
101
if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .KITKAT ) {
102
102
ViewGroup contentView = ((ViewGroup ) activity .findViewById (android .R .id .content ));
103
103
contentView .setPadding (0 , getStatusBarHeight (activity ), 0 , 0 );
@@ -112,7 +112,7 @@ public static void setColorForSwipeBack(Activity activity, @ColorInt int color,
112
112
* @param activity 需要设置的 activity
113
113
* @param color 状态栏颜色值
114
114
*/
115
- public static void setColorNoTranslucent (Activity activity , @ ColorInt int color ) {
115
+ public static void setColorNoTranslucent (Activity activity , int color ) {
116
116
setColor (activity , color , 0 );
117
117
}
118
118
@@ -123,7 +123,7 @@ public static void setColorNoTranslucent(Activity activity, @ColorInt int color)
123
123
* @param color 状态栏颜色值
124
124
*/
125
125
@ Deprecated
126
- public static void setColorDiff (Activity activity , @ ColorInt int color ) {
126
+ public static void setColorDiff (Activity activity , int color ) {
127
127
if (Build .VERSION .SDK_INT < Build .VERSION_CODES .KITKAT ) {
128
128
return ;
129
129
}
@@ -219,7 +219,7 @@ public static void setTranslucentDiff(Activity activity) {
219
219
* @param drawerLayout DrawerLayout
220
220
* @param color 状态栏颜色值
221
221
*/
222
- public static void setColorForDrawerLayout (Activity activity , DrawerLayout drawerLayout , @ ColorInt int color ) {
222
+ public static void setColorForDrawerLayout (Activity activity , DrawerLayout drawerLayout , int color ) {
223
223
setColorForDrawerLayout (activity , drawerLayout , color , DEFAULT_STATUS_BAR_ALPHA );
224
224
}
225
225
@@ -230,7 +230,7 @@ public static void setColorForDrawerLayout(Activity activity, DrawerLayout drawe
230
230
* @param drawerLayout DrawerLayout
231
231
* @param color 状态栏颜色值
232
232
*/
233
- public static void setColorNoTranslucentForDrawerLayout (Activity activity , DrawerLayout drawerLayout , @ ColorInt int color ) {
233
+ public static void setColorNoTranslucentForDrawerLayout (Activity activity , DrawerLayout drawerLayout , int color ) {
234
234
setColorForDrawerLayout (activity , drawerLayout , color , 0 );
235
235
}
236
236
@@ -242,7 +242,7 @@ public static void setColorNoTranslucentForDrawerLayout(Activity activity, Drawe
242
242
* @param color 状态栏颜色值
243
243
* @param statusBarAlpha 状态栏透明度
244
244
*/
245
- public static void setColorForDrawerLayout (Activity activity , DrawerLayout drawerLayout , @ ColorInt int color ,
245
+ public static void setColorForDrawerLayout (Activity activity , DrawerLayout drawerLayout , int color ,
246
246
int statusBarAlpha ) {
247
247
if (Build .VERSION .SDK_INT < Build .VERSION_CODES .KITKAT ) {
248
248
return ;
@@ -287,7 +287,7 @@ public static void setColorForDrawerLayout(Activity activity, DrawerLayout drawe
287
287
* @param color 状态栏颜色值
288
288
*/
289
289
@ Deprecated
290
- public static void setColorForDrawerLayoutDiff (Activity activity , DrawerLayout drawerLayout , @ ColorInt int color ) {
290
+ public static void setColorForDrawerLayoutDiff (Activity activity , DrawerLayout drawerLayout , int color ) {
291
291
if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .KITKAT ) {
292
292
activity .getWindow ().addFlags (WindowManager .LayoutParams .FLAG_TRANSLUCENT_STATUS );
293
293
// 生成一个状态栏大小的矩形
@@ -517,7 +517,7 @@ private static StatusBarView createStatusBarView(Activity activity, int color) {
517
517
* @param alpha 透明值
518
518
* @return 状态栏矩形条
519
519
*/
520
- private static StatusBarView createStatusBarView (Activity activity , @ ColorInt int color , int alpha ) {
520
+ private static StatusBarView createStatusBarView (Activity activity , int color , int alpha ) {
521
521
// 绘制一个和状态栏一样高的矩形
522
522
StatusBarView statusBarView = new StatusBarView (activity );
523
523
LinearLayout .LayoutParams params =
@@ -616,6 +616,7 @@ private static int calculateStatusColor(int color, int alpha) {
616
616
return 0xff << 24 | red << 16 | green << 8 | blue ;
617
617
}
618
618
619
+ /*--------------------------------old--------------------------------*/
619
620
620
621
/**
621
622
* 设置透明状态栏(api大于19方可使用)
0 commit comments