From f36c876c4e0414cfb8ce5afeaafec57eda520377 Mon Sep 17 00:00:00 2001 From: lany192 Date: Thu, 21 Dec 2017 10:49:52 +0800 Subject: [PATCH] update --- README.md | 4 ++-- app/build.gradle | 17 ++++++++--------- bintray.gradle | 2 +- build.gradle | 6 ++++-- gradle/wrapper/gradle-wrapper.properties | 4 ++-- library/build.gradle | 15 +++++++-------- .../github/lany192/blurdialog/BlurEngine.java | 14 ++++++-------- .../com/github/lany192/blurdialog/BlurView.java | 2 +- 8 files changed, 31 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index afb32ec..4a4258d 100644 --- a/README.md +++ b/README.md @@ -7,14 +7,14 @@ defaultConfig { ... - renderscriptTargetApi 25 + renderscriptTargetApi 27 renderscriptSupportModeEnabled true ... } dependencies { ... - compile 'com.github.lany192:BlurDialog:1.0.0' + compile 'com.github.lany192:BlurDialog:1.0.1' } ## usage diff --git a/app/build.gradle b/app/build.gradle index 6adff12..d342a50 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,16 +1,15 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 25 - buildToolsVersion "26.0.0" + compileSdkVersion 27 defaultConfig { applicationId "com.github.lany192.blurdialog.sample" minSdkVersion 14 - targetSdkVersion 25 + targetSdkVersion 27 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - renderscriptTargetApi 25 + renderscriptTargetApi 27 renderscriptSupportModeEnabled true } buildTypes { @@ -22,11 +21,11 @@ android { } dependencies { - compile fileTree(include: ['*.jar'], dir: 'libs') - androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { + 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' }) - compile 'com.android.support:appcompat-v7:25.3.1' - testCompile 'junit:junit:4.12' - compile project(':library') + implementation 'com.android.support:appcompat-v7:27.0.2' + testImplementation 'junit:junit:4.12' + implementation project(':library') } diff --git a/bintray.gradle b/bintray.gradle index e3a4d7b..f8da7c6 100644 --- a/bintray.gradle +++ b/bintray.gradle @@ -8,7 +8,7 @@ publish { userOrg = 'lany192' groupId = 'com.github.lany192' uploadName = 'BlurDialog' - publishVersion = '1.0.0' + publishVersion = '1.0.1' autoPublish = true dryRun = false desc = 'Library project to display Android Dialog with a blur effect.' diff --git a/build.gradle b/build.gradle index d7cb55d..338dede 100644 --- a/build.gradle +++ b/build.gradle @@ -3,16 +3,18 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.3' - classpath 'com.novoda:bintray-release:0.3.4' + classpath 'com.android.tools.build:gradle:3.0.1' + classpath 'com.novoda:bintray-release:0.5.0' } } allprojects { repositories { jcenter() + google() } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0f1cbc5..3bd9eca 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sat Jul 22 15:23:42 CST 2017 +#Thu Dec 21 10:36:36 CST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip diff --git a/library/build.gradle b/library/build.gradle index ec8cf3e..5d6e60c 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,18 +1,17 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 25 - buildToolsVersion "26.0.0" + compileSdkVersion 27 defaultConfig { minSdkVersion 14 - targetSdkVersion 22 + targetSdkVersion 27 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - renderscriptTargetApi 25 + renderscriptTargetApi 27 renderscriptSupportModeEnabled true } @@ -25,11 +24,11 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { + implementation fileTree(dir: 'libs', include: ['*.jar']) + androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) - testCompile 'junit:junit:4.12' - compile 'com.android.support:appcompat-v7:25.3.1' + testImplementation 'junit:junit:4.12' + implementation 'com.android.support:appcompat-v7:27.0.2' } apply from: '../bintray.gradle' \ No newline at end of file diff --git a/library/src/main/java/com/github/lany192/blurdialog/BlurEngine.java b/library/src/main/java/com/github/lany192/blurdialog/BlurEngine.java index e0e8bdc..97b01a2 100644 --- a/library/src/main/java/com/github/lany192/blurdialog/BlurEngine.java +++ b/library/src/main/java/com/github/lany192/blurdialog/BlurEngine.java @@ -6,7 +6,6 @@ import android.content.res.TypedArray; import android.os.Build; import android.support.v7.app.ActionBar; -import android.support.v7.app.ActionBarActivity; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.util.TypedValue; @@ -15,7 +14,7 @@ import android.view.ViewTreeObserver; import android.widget.FrameLayout; -class BlurEngine { +public class BlurEngine { static final float DEFAULT_BLUR_DOWN_SCALE_FACTOR = 8.0f; static final int DEFAULT_BLUR_RADIUS = 4; static final boolean DEFAULT_DIMMING_POLICY = false; @@ -103,7 +102,6 @@ private void blur() { } try { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB - || mActivity instanceof ActionBarActivity || mActivity instanceof AppCompatActivity) { //add offset as top margin since actionBar height must also considered when we display // the blurred background. Don't want to draw on the actionBar. @@ -123,11 +121,11 @@ private int getActionBarHeight() { try { if (mToolbar != null) { actionBarHeight = mToolbar.getHeight(); - } else if (mActivity instanceof ActionBarActivity) { - ActionBar supportActionBar = ((ActionBarActivity) mActivity).getSupportActionBar(); - if (supportActionBar != null) { - actionBarHeight = supportActionBar.getHeight(); - } +// } else if (mActivity instanceof ActionBarActivity) { +// ActionBar supportActionBar = ((ActionBarActivity) mActivity).getSupportActionBar(); +// if (supportActionBar != null) { +// actionBarHeight = supportActionBar.getHeight(); +// } } else if (mActivity instanceof AppCompatActivity) { ActionBar supportActionBar = ((AppCompatActivity) mActivity).getSupportActionBar(); if (supportActionBar != null) { diff --git a/library/src/main/java/com/github/lany192/blurdialog/BlurView.java b/library/src/main/java/com/github/lany192/blurdialog/BlurView.java index 6c08d10..a5c4698 100644 --- a/library/src/main/java/com/github/lany192/blurdialog/BlurView.java +++ b/library/src/main/java/com/github/lany192/blurdialog/BlurView.java @@ -17,7 +17,7 @@ import android.view.View; import android.view.ViewTreeObserver; -class BlurView extends View { +public class BlurView extends View { private static final String TAG = "BlurView"; private float mDownScaleFactor; // default 4 private int mOverlayColor; // default #aaffffff