Skip to content

Commit

Permalink
update 2.3.3-beta04,modify the function to get the height of the bar
Browse files Browse the repository at this point in the history
  • Loading branch information
geyifeng committed Nov 21, 2018
1 parent 6774aed commit 029afd3
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 91 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- 2.3.1+版本 (由于之前账户密码忘记,所以只能重新更改依赖路径)
```groovy
implementation 'com.gyf.immersionbar:immersionbar:2.3.3-beta02'
implementation 'com.gyf.immersionbar:immersionbar:2.3.3-beta04'
```
- 2.3.0以下版本
```groovy
Expand All @@ -18,13 +18,13 @@

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

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

## 下载demo
### [点我下载immersionBar-2.3.3-beta02.apk](https://github.com/gyf-dev/ImmersionBar/blob/master/apk/immersionBar-2.3.3-beta02.apk)
### [点我下载immersionBar-2.3.3-beta04.apk](https://github.com/gyf-dev/ImmersionBar/blob/master/apk/immersionBar-2.3.3-beta04.apk)

## 关于全面屏与刘海
### 关于全面屏
Expand Down
Binary file removed apk/immersionBar-2.3.3-beta02.apk
Binary file not shown.
Binary file added apk/immersionBar-2.3.3-beta04.apk
Binary file not shown.
27 changes: 1 addition & 26 deletions barlibrary/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,7 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
Expand All @@ -29,29 +19,14 @@ android {
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compileOnly 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.12'
}

task makeJar(type: Copy) {
delete 'build/libs/immersionbar-2.3.3-beta01.jar'
from('build/intermediates/bundles/release/')
into('build/libs/')
include('classes.jar')
rename('classes.jar', 'immersionbar-2.3.3-beta02.jar')
}

makeJar.dependsOn(build)

publish {
userOrg = 'geyifeng'
groupId = 'com.gyf.immersionbar'
artifactId = 'immersionbar'
publishVersion = '2.3.3-beta02'
publishVersion = '2.3.3-beta04'
desc = 'Android bar management'
website = 'https://github.com/gyf-dev/ImmersionBar'
}

This file was deleted.

13 changes: 6 additions & 7 deletions barlibrary/src/main/java/com/gyf/barlibrary/BarConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class BarConfig {
Resources res = activity.getResources();
mInPortrait = (res.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT);
mSmallestWidthDp = getSmallestWidthDp(activity);
mStatusBarHeight = getInternalDimensionSize(activity, STATUS_BAR_HEIGHT_RES_NAME);
mStatusBarHeight = getInternalDimensionSize(STATUS_BAR_HEIGHT_RES_NAME);
mActionBarHeight = getActionBarHeight(activity);
mNavigationBarHeight = getNavigationBarHeight(activity);
mNavigationBarWidth = getNavigationBarWidth(activity);
Expand Down Expand Up @@ -76,7 +76,7 @@ private int getNavigationBarHeight(Context context) {
} else {
key = NAV_BAR_HEIGHT_LANDSCAPE_RES_NAME;
}
return getInternalDimensionSize(context, key);
return getInternalDimensionSize(key);
}
}
return result;
Expand All @@ -87,7 +87,7 @@ private int getNavigationBarWidth(Context context) {
int result = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
if (hasNavBar((Activity) context)) {
return getInternalDimensionSize(context, NAV_BAR_WIDTH_RES_NAME);
return getInternalDimensionSize(NAV_BAR_WIDTH_RES_NAME);
}
}
return result;
Expand Down Expand Up @@ -122,13 +122,12 @@ private boolean hasNavBar(Activity activity) {
return (realWidth - displayWidth) > 0 || (realHeight - displayHeight) > 0;
}

private int getInternalDimensionSize(Context context, String key) {
private int getInternalDimensionSize(String key) {
int result = 0;
try {
int resourceId = context.getResources().getIdentifier(key, "dimen", "android");
int resourceId = Resources.getSystem().getIdentifier(key, "dimen", "android");
if (resourceId > 0) {
result = Math.max(context.getResources().getDimensionPixelSize(resourceId),
Resources.getSystem().getDimensionPixelSize(resourceId));
result = Resources.getSystem().getDimensionPixelSize(resourceId);
}
} catch (Resources.NotFoundException ignored) {
return 0;
Expand Down
17 changes: 0 additions & 17 deletions barlibrary/src/test/java/com/gyf/barlibrary/ExampleUnitTest.java

This file was deleted.

16 changes: 7 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ buildscript {
}
dependencies {

classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.novoda:bintray-release:0.8.1'
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.novoda:bintray-release:0.9'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand All @@ -20,14 +20,12 @@ allprojects {
jcenter()
maven { url 'https://jitpack.io' }
}
// tasks.withType(Javadoc) {
// options {
// encoding "UTF-8"
// charSet 'UTF-8'
// links "http://docs.oracle.com/javase/7/docs/api"
// }
// }
tasks.withType(Javadoc) {
options {
encoding "UTF-8"
charSet 'UTF-8'
links "http://docs.oracle.com/javase/7/docs/api"
}
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Nov 17 20:41:45 CST 2018
#Thu Nov 22 01:06:43 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
Binary file added jar/immersionbar-2.3.3-beta04.aar
Binary file not shown.
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ android {
minSdkVersion 18
targetSdkVersion 28
versionCode 1
versionName "2.3.3-beta02"
versionName "2.3.3-beta04"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down

0 comments on commit 029afd3

Please sign in to comment.