Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mmm-rain
AndroidUtilCode
提交
f63ca151
A
AndroidUtilCode
项目概览
mmm-rain
/
AndroidUtilCode
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
AndroidUtilCode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
f63ca151
编写于
10月 31, 2016
作者:
C
cmj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
see 10/31 log
上级
3a703602
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
18 addition
and
14 deletion
+18
-14
utilcode/src/main/java/com/blankj/utilcode/utils/BarUtils.java
...ode/src/main/java/com/blankj/utilcode/utils/BarUtils.java
+12
-11
utilcode/src/main/java/com/blankj/utilcode/utils/NetworkUtils.java
...src/main/java/com/blankj/utilcode/utils/NetworkUtils.java
+1
-1
utilcode/src/main/java/com/blankj/utilcode/utils/ProcessUtils.java
...src/main/java/com/blankj/utilcode/utils/ProcessUtils.java
+1
-1
utilcode/src/main/java/com/blankj/utilcode/utils/SnackbarUtils.java
...rc/main/java/com/blankj/utilcode/utils/SnackbarUtils.java
+3
-0
utilcode/src/main/java/com/blankj/utilcode/utils/StringUtils.java
.../src/main/java/com/blankj/utilcode/utils/StringUtils.java
+1
-1
未找到文件。
utilcode/src/main/java/com/blankj/utilcode/utils/BarUtils.java
浏览文件 @
f63ca151
...
...
@@ -49,7 +49,7 @@ public class BarUtils {
* @param activity 需要设置的 activity
* @param color 状态栏颜色值
*/
public
static
void
setColor
(
Activity
activity
,
@ColorInt
int
color
)
{
public
static
void
setColor
(
Activity
activity
,
int
color
)
{
setColor
(
activity
,
color
,
DEFAULT_STATUS_BAR_ALPHA
);
}
...
...
@@ -61,7 +61,7 @@ public class BarUtils {
* @param statusBarAlpha 状态栏透明度
*/
public
static
void
setColor
(
Activity
activity
,
@ColorInt
int
color
,
int
statusBarAlpha
)
{
public
static
void
setColor
(
Activity
activity
,
int
color
,
int
statusBarAlpha
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
activity
.
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
);
activity
.
getWindow
().
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
...
...
@@ -86,7 +86,7 @@ public class BarUtils {
* @param activity 需要设置的activity
* @param color 状态栏颜色值
*/
public
static
void
setColorForSwipeBack
(
Activity
activity
,
@ColorInt
int
color
)
{
public
static
void
setColorForSwipeBack
(
Activity
activity
,
int
color
)
{
setColorForSwipeBack
(
activity
,
color
,
DEFAULT_STATUS_BAR_ALPHA
);
}
...
...
@@ -97,7 +97,7 @@ public class BarUtils {
* @param color 状态栏颜色值
* @param statusBarAlpha 状态栏透明度
*/
public
static
void
setColorForSwipeBack
(
Activity
activity
,
@ColorInt
int
color
,
int
statusBarAlpha
)
{
public
static
void
setColorForSwipeBack
(
Activity
activity
,
int
color
,
int
statusBarAlpha
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
ViewGroup
contentView
=
((
ViewGroup
)
activity
.
findViewById
(
android
.
R
.
id
.
content
));
contentView
.
setPadding
(
0
,
getStatusBarHeight
(
activity
),
0
,
0
);
...
...
@@ -112,7 +112,7 @@ public class BarUtils {
* @param activity 需要设置的 activity
* @param color 状态栏颜色值
*/
public
static
void
setColorNoTranslucent
(
Activity
activity
,
@ColorInt
int
color
)
{
public
static
void
setColorNoTranslucent
(
Activity
activity
,
int
color
)
{
setColor
(
activity
,
color
,
0
);
}
...
...
@@ -123,7 +123,7 @@ public class BarUtils {
* @param color 状态栏颜色值
*/
@Deprecated
public
static
void
setColorDiff
(
Activity
activity
,
@ColorInt
int
color
)
{
public
static
void
setColorDiff
(
Activity
activity
,
int
color
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
{
return
;
}
...
...
@@ -219,7 +219,7 @@ public class BarUtils {
* @param drawerLayout DrawerLayout
* @param color 状态栏颜色值
*/
public
static
void
setColorForDrawerLayout
(
Activity
activity
,
DrawerLayout
drawerLayout
,
@ColorInt
int
color
)
{
public
static
void
setColorForDrawerLayout
(
Activity
activity
,
DrawerLayout
drawerLayout
,
int
color
)
{
setColorForDrawerLayout
(
activity
,
drawerLayout
,
color
,
DEFAULT_STATUS_BAR_ALPHA
);
}
...
...
@@ -230,7 +230,7 @@ public class BarUtils {
* @param drawerLayout DrawerLayout
* @param color 状态栏颜色值
*/
public
static
void
setColorNoTranslucentForDrawerLayout
(
Activity
activity
,
DrawerLayout
drawerLayout
,
@ColorInt
int
color
)
{
public
static
void
setColorNoTranslucentForDrawerLayout
(
Activity
activity
,
DrawerLayout
drawerLayout
,
int
color
)
{
setColorForDrawerLayout
(
activity
,
drawerLayout
,
color
,
0
);
}
...
...
@@ -242,7 +242,7 @@ public class BarUtils {
* @param color 状态栏颜色值
* @param statusBarAlpha 状态栏透明度
*/
public
static
void
setColorForDrawerLayout
(
Activity
activity
,
DrawerLayout
drawerLayout
,
@ColorInt
int
color
,
public
static
void
setColorForDrawerLayout
(
Activity
activity
,
DrawerLayout
drawerLayout
,
int
color
,
int
statusBarAlpha
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
{
return
;
...
...
@@ -287,7 +287,7 @@ public class BarUtils {
* @param color 状态栏颜色值
*/
@Deprecated
public
static
void
setColorForDrawerLayoutDiff
(
Activity
activity
,
DrawerLayout
drawerLayout
,
@ColorInt
int
color
)
{
public
static
void
setColorForDrawerLayoutDiff
(
Activity
activity
,
DrawerLayout
drawerLayout
,
int
color
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
activity
.
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
// 生成一个状态栏大小的矩形
...
...
@@ -517,7 +517,7 @@ public class BarUtils {
* @param alpha 透明值
* @return 状态栏矩形条
*/
private
static
StatusBarView
createStatusBarView
(
Activity
activity
,
@ColorInt
int
color
,
int
alpha
)
{
private
static
StatusBarView
createStatusBarView
(
Activity
activity
,
int
color
,
int
alpha
)
{
// 绘制一个和状态栏一样高的矩形
StatusBarView
statusBarView
=
new
StatusBarView
(
activity
);
LinearLayout
.
LayoutParams
params
=
...
...
@@ -616,6 +616,7 @@ public class BarUtils {
return
0xff
<<
24
|
red
<<
16
|
green
<<
8
|
blue
;
}
/*--------------------------------old--------------------------------*/
/**
* 设置透明状态栏(api大于19方可使用)
...
...
utilcode/src/main/java/com/blankj/utilcode/utils/NetworkUtils.java
浏览文件 @
f63ca151
...
...
@@ -170,7 +170,7 @@ public class NetworkUtils {
/**
* 打开或关闭wifi
* <p>需添加权限 { <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>}</p>
* <p>需添加权限 {
@code
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>}</p>
*
* @param context 上下文
* @param enabled {@code true}: 打开<br>{@code false}: 关闭
...
...
utilcode/src/main/java/com/blankj/utilcode/utils/ProcessUtils.java
浏览文件 @
f63ca151
...
...
@@ -32,7 +32,7 @@ public class ProcessUtils {
/**
* 获取前台线程包名
* <p>当不是查看当前App,且SDK
>= 22
时,
* <p>当不是查看当前App,且SDK
大于21
时,
* 需添加权限 {@code <uses-permission android:name="android.permission.PACKAGE_USAGE_STATS"/>}</p>
*
* @param context 上下文
...
...
utilcode/src/main/java/com/blankj/utilcode/utils/SnackbarUtils.java
浏览文件 @
f63ca151
...
...
@@ -73,6 +73,9 @@ public class SnackbarUtils {
* @param text 文本
* @param textColor 文本颜色
* @param bgColor 背景色
* @param actionText 事件文本
* @param actionTextColor 事件文本颜色
* @param listener 监听器
*/
public
static
void
showLongSnackbar
(
View
parent
,
CharSequence
text
,
int
textColor
,
int
bgColor
,
CharSequence
actionText
,
int
actionTextColor
,
View
.
OnClickListener
listener
)
{
...
...
utilcode/src/main/java/com/blankj/utilcode/utils/StringUtils.java
浏览文件 @
f63ca151
...
...
@@ -41,7 +41,7 @@ public class StringUtils {
*
* @param a 待校验字符串a
* @param b 待校验字符串b
* @return
@return
{@code true}: 相等<br>{@code false}: 不相等
* @return {@code true}: 相等<br>{@code false}: 不相等
*/
public
static
boolean
equals
(
CharSequence
a
,
CharSequence
b
)
{
if
(
a
==
b
)
return
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录