Skip to content

Commit

Permalink
update 2.3.2-beta03
Browse files Browse the repository at this point in the history
  • Loading branch information
geyifeng committed Nov 9, 2018
1 parent 3614c10 commit 9a62664
Show file tree
Hide file tree
Showing 86 changed files with 1,789 additions and 1,574 deletions.
25 changes: 14 additions & 11 deletions README.md
Expand Up @@ -9,7 +9,7 @@
- 2.3.1+版本 (由于之前账户密码忘记,所以只能重新更改依赖路径)
```groovy
implementation 'com.gyf.immersionbar:immersionbar:2.3.2-beta02'
implementation 'com.gyf.immersionbar:immersionbar:2.3.2-beta03'
```
- 2.3.0以下版本
```groovy
Expand All @@ -18,7 +18,7 @@

>eclipse
[immersionbar-2.3.2-beta02.jar](https://github.com/gyf-dev/ImmersionBar/blob/master/jar/immersionbar-2.3.2-beta02.jar)
[immersionbar-2.3.2-beta03.jar](https://github.com/gyf-dev/ImmersionBar/blob/master/jar/immersionbar-2.3.2-beta03.jar)

## 版本说明
### [点我](https://github.com/gyf-dev/ImmersionBar/wiki)
Expand Down Expand Up @@ -106,20 +106,24 @@
```java
public class BaseActivity extends AppCompatActivity {

private ImmersionBar mImmersionBar;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mImmersionBar = ImmersionBar.with(this);
mImmersionBar.init(); //所有子类都将继承这些相同的属性
ImmersionBar.with(this).init(); //所有子类都将继承这些相同的属性

}

@Override
protected void onDestroy() {
super.onDestroy();
if (mImmersionBar != null)
mImmersionBar.destroy(); //必须调用该方法,防止内存泄漏,不调用该方法,如果界面bar发生改变,在不关闭app的情况下,退出此界面再进入将记忆最后一次bar改变的状态
ImmersionBar.with(this).destroy(); //必须调用该方法,防止内存泄漏,不调用该方法,如果界面bar发生改变,在不关闭app的情况下,退出此界面再进入将记忆最后一次bar改变的状态
}

@Override
protected void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
// 如果你的app可以横竖屏切换,并且适配4.4或者emui3手机请务必在onConfigurationChanged方法里添加这句话
ImmersionBar.with(this).init();
}
}
```
Expand All @@ -138,8 +142,7 @@
@Override
protected void onDestroy() {
super.onDestroy();
if (mImmersionBar != null)
mImmersionBar.destroy();
ImmersionBar.with(this).destroy();
}
```
- 以show()和hide()方式控制Fragment显示隐藏,别忘了重写onHiddenChanged方法,如下
Expand All @@ -148,8 +151,8 @@
@Override
public void onHiddenChanged(boolean hidden) {
super.onHiddenChanged(hidden);
if (!hidden && mImmersionBar != null)
mImmersionBar.init();
if (!hidden)
ImmersionBar.with(this).init();
}
```
- 在Activity使用ImmersionBar
Expand Down
14 changes: 7 additions & 7 deletions barlibrary/build.gradle
Expand Up @@ -2,12 +2,12 @@ apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
compileSdkVersion 28
buildToolsVersion '28.0.3'

defaultConfig {
minSdkVersion 11
targetSdkVersion 27
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.0"

Expand All @@ -33,7 +33,7 @@ dependencies {
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.12'
}

Expand All @@ -42,7 +42,7 @@ task makeJar(type: Copy) {
from('build/intermediates/bundles/release/')
into('build/libs/')
include('classes.jar')
rename('classes.jar', 'immersionbar-2.3.2-beta02.jar')
rename('classes.jar', 'immersionbar-2.3.2-beta03.jar')
}

makeJar.dependsOn(build)
Expand All @@ -51,7 +51,7 @@ publish {
userOrg = 'geyifeng'
groupId = 'com.gyf.immersionbar'
artifactId = 'immersionbar'
publishVersion = '2.3.2-beta02'
publishVersion = '2.3.2-beta03'
desc = 'Android bar management'
website = 'https://github.com/gyf-dev/ImmersionBar'
}
14 changes: 7 additions & 7 deletions barlibrary/src/main/java/com/gyf/barlibrary/BarConfig.java
Expand Up @@ -35,7 +35,7 @@ class BarConfig {
private final float mSmallestWidthDp;


public BarConfig(Activity activity) {
BarConfig(Activity activity) {
Resources res = activity.getResources();
mInPortrait = (res.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT);
mSmallestWidthDp = getSmallestWidthDp(activity);
Expand Down Expand Up @@ -148,7 +148,7 @@ private float getSmallestWidthDp(Activity activity) {
*
* @return True if navigation should appear at the bottom of the screen, False otherwise.
*/
public boolean isNavigationAtBottom() {
boolean isNavigationAtBottom() {
return (mSmallestWidthDp >= 600 || mInPortrait);
}

Expand All @@ -157,7 +157,7 @@ public boolean isNavigationAtBottom() {
*
* @return The height of the status bar (in pixels).
*/
public int getStatusBarHeight() {
int getStatusBarHeight() {
return mStatusBarHeight;
}

Expand All @@ -166,7 +166,7 @@ public int getStatusBarHeight() {
*
* @return The height of the action bar (in pixels).
*/
public int getActionBarHeight() {
int getActionBarHeight() {
return mActionBarHeight;
}

Expand All @@ -175,7 +175,7 @@ public int getActionBarHeight() {
*
* @return True if this device uses soft key navigation, False otherwise.
*/
public boolean hasNavigationBar() {
boolean hasNavigationBar() {
return mHasNavigationBar;
}

Expand All @@ -185,7 +185,7 @@ public boolean hasNavigationBar() {
* @return The height of the navigation bar (in pixels). If the device does not have
* soft navigation keys, this will always return 0.
*/
public int getNavigationBarHeight() {
int getNavigationBarHeight() {
return mNavigationBarHeight;
}

Expand All @@ -195,7 +195,7 @@ public int getNavigationBarHeight() {
* @return The width of the navigation bar (in pixels). If the device does not have
* soft navigation keys, this will always return 0.
*/
public int getNavigationBarWidth() {
int getNavigationBarWidth() {
return mNavigationBarWidth;
}

Expand Down
30 changes: 24 additions & 6 deletions barlibrary/src/main/java/com/gyf/barlibrary/BarHide.java
@@ -1,12 +1,30 @@
package com.gyf.barlibrary;

/**
* Created by geyifeng on 2017/4/25.
* bar的状态
*
* @author geyifeng
* @date 2017/4/25
*/

public enum BarHide {
FLAG_HIDE_STATUS_BAR, //隐藏状态栏
FLAG_HIDE_NAVIGATION_BAR, //隐藏导航栏
FLAG_HIDE_BAR, //隐藏状态栏和导航栏
FLAG_SHOW_BAR //显示状态栏和导航栏
/**
* 隐藏状态栏
* Flag hide status bar bar hide.
*/
FLAG_HIDE_STATUS_BAR,
/**
* 隐藏导航栏
* Flag hide navigation bar bar hide.
*/
FLAG_HIDE_NAVIGATION_BAR,
/**
* 隐藏状态栏和导航栏
* Flag hide bar bar hide.
*/
FLAG_HIDE_BAR,
/**
* 显示状态栏和导航栏
* Flag show bar bar hide.
*/
FLAG_SHOW_BAR
}

0 comments on commit 9a62664

Please sign in to comment.