Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lany192 committed Dec 21, 2017
1 parent 484f942 commit f36c876
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 33 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 8 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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')
}
2 changes: 1 addition & 1 deletion bintray.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand Down
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

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 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
15 changes: 7 additions & 8 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -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

}
Expand All @@ -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'
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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.
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f36c876

Please sign in to comment.