Skip to content

Commit

Permalink
Modify the MD usage document
Browse files Browse the repository at this point in the history
  • Loading branch information
bravetou committed Jun 24, 2020
1 parent 797126b commit f8cbab3
Show file tree
Hide file tree
Showing 5 changed files with 207 additions and 29 deletions.
59 changes: 35 additions & 24 deletions README.en.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,47 @@
# SystemBarUtils
---
Android toolbar

#### Description
Android SystemBar Utils

#### Software Architecture
Software architecture description
# Dependency
---
```groovy
dependencies {
implementation 'com.brave.system.bar:library:1.0.1'
}
```

#### Installation

1. xxxx
2. xxxx
3. xxxx
# use
---

#### Instructions
1. Transparent

1. xxxx
2. xxxx
3. xxxx
```java
BarUtils.setTransparent(this);
```

#### Contribution
2. Transparent

1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request
```java
BarUtils.setTransparent(this);
```

3. set colors

#### Gitee Feature
```java
BarUtils.setSystemBarColor(this, Color.BLUE);
```

1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
4. Other

```java
BarUtils.setSystemBarColor(Window, View, boolean, boolean, boolean, boolean, boolean, boolean, int, int)
```

# notice

- BarUtils StatusBarUtils NavBarUtils have three types of mutual exclusion and can only be used one of them
- BarUtils status bar and virtual button bar will be changed together
- StatusBarUtils only changes the status bar
- NavBarUtils only changes the virtual button bar
46 changes: 43 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,47 @@
# SystemBarUtils
---
安卓系统栏工具

#### gradle导入

# 依赖
---
```groovy
implementation 'com.brave.system.bar:library:1.0.1'
```
dependencies {
implementation 'com.brave.system.bar:library:1.0.1'
}
```


# 使用
---

1. 半透明

```java
BarUtils.setTransparent(this);
```

2. 透明

```java
BarUtils.setTransparent(this);
```

3. 设置颜色

```java
BarUtils.setSystemBarColor(this, Color.BLUE);
```

4. 其他

```java
BarUtils.setSystemBarColor(Window, View, boolean, boolean, boolean, boolean, boolean, boolean, int, int)
```

# 注意

- BarUtils、StatusBarUtils、NavBarUtils三类互斥,只能使用其中一种
- BarUtils 状态栏与虚拟按键栏会一起改变
- StatusBarUtils 只改变状态栏
- NavBarUtils 只改变虚拟按键栏
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.brave.system.bar.library;

import android.app.Activity;
import android.graphics.Color;
import android.view.View;
import android.view.Window;

Expand Down Expand Up @@ -144,4 +145,64 @@ public static final void setColor(@NonNull Activity activity,
false,
color);
}

/**
* 设置虚拟按键栏半透明
*/
public static final void setTranslucent(@NonNull Window window,
@NonNull View rootView) {
BarUtils.setSystemBarColor(window,
rootView,
false,
true,
false,
true,
true,
Color.BLACK,
112);
}

/**
* 设置虚拟按键栏半透明
*/
public static final void setTranslucent(@NonNull Activity activity) {
BarUtils.setSystemBarColor(activity,
false,
true,
false,
true,
true,
Color.BLACK,
112);
}

/**
* 设置虚拟按键栏透明
*/
public static final void setTransparent(@NonNull Window window,
@NonNull View rootView) {
BarUtils.setSystemBarColor(window,
rootView,
false,
true,
false,
true,
true,
Color.BLACK,
0);
}

/**
* 设置虚拟按键栏透明
*/
public static final void setTransparent(@NonNull Activity activity) {
BarUtils.setSystemBarColor(activity,
false,
true,
false,
true,
true,
Color.BLACK,
0);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.brave.system.bar.library;

import android.app.Activity;
import android.graphics.Color;
import android.view.View;
import android.view.Window;

Expand Down Expand Up @@ -28,7 +29,7 @@ public final class StatusBarUtils {
* @param window 窗口
* @param rootView 根布局
* @param isBlack 深色字体
* @param fitSystemWindows 系统栏占位
* @param fitSystemWindows 状态栏占位
* @param clipToPadding 子View不能展示在Padding区域
* @param color 颜色
* @param alpha 透明度[0,255],值越小越透明
Expand Down Expand Up @@ -93,7 +94,7 @@ public static final void setColor(@NonNull Window window,
*
* @param activity 活动
* @param isBlack 深色字体
* @param fitSystemWindows 系统栏占位
* @param fitSystemWindows 状态栏占位
* @param clipToPadding 子View不能展示在Padding区域
* @param color 颜色
* @param alpha 透明度[0,255],值越小越透明
Expand Down Expand Up @@ -144,4 +145,64 @@ public static final void setColor(@NonNull Activity activity,
false,
color);
}

/**
* 设置状态栏半透明
*/
public static final void setTranslucent(@NonNull Window window,
@NonNull View rootView) {
BarUtils.setSystemBarColor(window,
rootView,
true,
false,
false,
true,
true,
Color.BLACK,
112);
}

/**
* 设置状态栏半透明
*/
public static final void setTranslucent(@NonNull Activity activity) {
BarUtils.setSystemBarColor(activity,
true,
false,
false,
true,
true,
Color.BLACK,
112);
}

/**
* 设置状态栏透明
*/
public static final void setTransparent(@NonNull Window window,
@NonNull View rootView) {
BarUtils.setSystemBarColor(window,
rootView,
true,
false,
false,
true,
true,
Color.BLACK,
0);
}

/**
* 设置状态栏透明
*/
public static final void setTransparent(@NonNull Activity activity) {
BarUtils.setSystemBarColor(activity,
true,
false,
false,
true,
true,
Color.BLACK,
0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import androidx.appcompat.app.AppCompatActivity;

import com.brave.system.bar.library.BarUtils;
import com.brave.system.bar.library.NavBarUtils;
import com.brave.system.bar.library.StatusBarUtils;

public class MainActivity extends AppCompatActivity {
private static final String TAG = "MainActivity";
Expand All @@ -26,6 +28,9 @@ protected void onCreate(Bundle savedInstanceState) {
true,
Color.BLUE,
255);
BarUtils.setTransparent(this);
StatusBarUtils.setTranslucent(this);
NavBarUtils.setTranslucent(this);
setRootView(this);
}

Expand Down

0 comments on commit f8cbab3

Please sign in to comment.