Skip to content

Commit

Permalink
update 2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gyf-dev committed Jun 5, 2017
1 parent 66e89bc commit 6fb52f7
Show file tree
Hide file tree
Showing 56 changed files with 1,349 additions and 195 deletions.
31 changes: 18 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
> android studio
```groovy
compile 'com.gyf.barlibrary:barlibrary:2.2.1'
compile 'com.gyf.barlibrary:barlibrary:2.2.2'
```

>eclipse
[barlibrary-2.2.1.jar](https://github.com/gyf-dev/ImmersionBar/blob/master/jar/barlibrary-2.2.1.jar)
[barlibrary-2.2.2.jar](https://github.com/gyf-dev/ImmersionBar/blob/master/jar/barlibrary-2.2.2.jar)

## 版本说明
### [点我](https://github.com/gyf-dev/ImmersionBar/wiki)

## 下载demo
### [下载](https://github.com/gyf-dev/ImmersionBar/blob/master/apk/sample-2.2.1.apk)
### [下载](https://github.com/gyf-dev/ImmersionBar/blob/master/apk/sample-2.2.2.apk)

## 用法
### 初始化
Expand Down Expand Up @@ -46,6 +46,7 @@
.hideBar(BarHide.FLAG_HIDE_BAR) //隐藏状态栏或导航栏或两者,不写默认不隐藏
.setViewSupportTransformColor(toolbar) //设置支持view变色,支持一个view,不指定颜色,默认和状态栏同色,还有两个重载方法
.addViewSupportTransformColor(toolbar) //设置支持view变色,可以添加多个view,不指定颜色,默认和状态栏同色,还有两个重载方法
.titleBar(toolBar) //解决状态栏和布局重叠问题
.statusBarView(view) //解决状态栏和布局重叠问题
.fitsSystemWindows(false) //解决状态栏和布局重叠问题,默认为false,当为true时一定要指定statusBarColor(),不然状态栏为透明色
.statusBarColorTransform(R.color.orange) //状态栏变色后的颜色
Expand Down Expand Up @@ -140,15 +141,15 @@
}
@Override
protected void immersionInit() {
ImmersionBar.with(getActivity())
ImmersionBar.with(this)
.statusBarDarkFont(false)
.navigationBarColor(R.color.btn4)
.init();
}
}
```

## 状态栏与布局顶部重叠解决方案,四种方案任选其一
## 状态栏与布局顶部重叠解决方案,五种方案任选其一
- ① 使用dimen自定义状态栏高度

在values-v19/dimens.xml文件下
Expand Down Expand Up @@ -240,7 +241,13 @@
.statusBarView(view)
.init();
```

- ⑤ 使用ImmersionBar的titleBar(View view)方法
```java
ImmersionBar.with(this)
.titleBar(view) //指定标题栏view
.init();
```

## 解决EditText和软键盘的问题
```java
KeyboardPatch.patch(this, linearLayout).enable(); //解决底部EditText和软键盘的问题,linearLayout指的是当前布局的根节点
Expand All @@ -250,13 +257,11 @@

## 当白色背景状态栏遇到不能改变状态栏字体为深色的设备时,解决方案
```java
if(ImmersionBar.isSupportStatusBarDarkFont()){ //判断当前设备支不支持状态栏字体变色
//处理状态栏字体为黑色
}else {
//处理状态栏有透明度
}
ImmersionBar.with(this)
.statusBarDarkFont(true, 0.2f)
.init();
```
<img width="300" src="https://cloud.githubusercontent.com/assets/23047875/26274357/bc92f83a-3d7a-11e7-94f7-f75052e91c42.png"/>
<img width="300" src="https://github.com/gyf-dev/Screenshots/blob/master/ImmersionBar/whiteStatusBar.png"/>

## 状态栏和导航栏其它方法

Expand Down Expand Up @@ -304,6 +309,6 @@
* 感谢[zhangzhen92](https://github.com/zhangzhen92)远程协助测试

## 联系我 ##
- QQ 969565471
- QQ群 314360549(沉浸式交流)
- WeChat(微信)
<img width="300" src="https://github.com/gyf-dev/Screenshots/blob/master/ImmersionBar/wechat.JPG"/>
Binary file removed apk/sample-2.2.1.apk
Binary file not shown.
Binary file added apk/sample-2.2.2.apk
Binary file not shown.
8 changes: 4 additions & 4 deletions barlibrary/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ dependencies {
}

task makeJar(type: Copy) {
delete 'build/libs/barlibrary-2.2.0.jar'
from('build/intermediates/bundles/release/')
delete 'build/libs/barlibrary-2.2.1.jar'
from('build/intermediates/bundles/default/')
into('build/libs/')
include('classes.jar')
rename('classes.jar', 'barlibrary-2.2.1.jar')
rename('classes.jar', 'barlibrary-2.2.2.jar')
}

makeJar.dependsOn(build)
Expand All @@ -51,7 +51,7 @@ publish {
userOrg = 'magic-dev'
groupId = 'com.gyf.barlibrary'
artifactId = 'barlibrary'
publishVersion = '2.2.1'
publishVersion = '2.2.2'
desc = 'Android bar management'
website = 'https://github.com/gyf-dev/ImmersionBar'
}
1 change: 0 additions & 1 deletion barlibrary/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
android:allowBackup="true"
android:label="@string/app_name"
android:supportsRtl="true">

</application>

</manifest>
20 changes: 19 additions & 1 deletion barlibrary/src/main/java/com/gyf/barlibrary/BarParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
import java.util.Map;

/**
* 沉浸式参数信息
* Created by geyifeng on 2017/5/9.
*/
public class BarParams {
public class BarParams implements Cloneable {
@ColorInt
public int statusBarColor = Color.TRANSPARENT; //状态栏颜色
@ColorInt
Expand All @@ -26,6 +27,7 @@ public class BarParams {
public boolean fullScreenTemp = fullScreen;
public BarHide barHide = BarHide.FLAG_SHOW_BAR; //隐藏Bar
public boolean darkFont = false; //状态栏字体深色与亮色标志位
public boolean statusBarFlag = false; //是否可以修改状态栏颜色
@ColorInt
public int statusBarColorTransform = Color.BLACK; //状态栏变换后的颜色
@ColorInt
Expand All @@ -36,11 +38,27 @@ public class BarParams {
public int viewColorBeforeTransform = statusBarColor; //view变色前的颜色
@ColorInt
public int viewColorAfterTransform = statusBarColorTransform; //view变色后的颜色
@FloatRange(from = 0f, to = 1f)
public float viewAlpha = 0.0f;
public boolean fits = false; //解决标题栏与状态栏重叠问题
public int navigationBarColorTem = navigationBarColor;
public View statusBarView; //4.4自定义一个状态栏
public View navigationBarView; //4.4自定义一个导航栏
public View statusBarViewByHeight; //解决标题栏与状态栏重叠问题
@ColorInt
public int flymeOSStatusBarFontColor; //flymeOS状态栏字体变色
public boolean isSupportActionBar = false; //结合actionBar使用
public View titleBarView; //标题栏view
public int titleBarHeight; //标题栏的高度

@Override
protected BarParams clone() {
BarParams barParams = null;
try {
barParams = (BarParams) super.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return barParams;
}
}
Loading

0 comments on commit 6fb52f7

Please sign in to comment.