1
0
mirror of https://github.com/wasabeef/glide-transformations.git synced 2025-06-08 15:34:04 +08:00

Merge pull request #38 from wasabeef/v2.0.1

V2.0.1
This commit is contained in:
Daichi Furiya 2016-04-21 15:29:01 +09:00
commit c3f09cdd0d
11 changed files with 78 additions and 70 deletions

View File

@ -1,6 +1,13 @@
Change Log Change Log
========== ==========
Version 2.0.1 *(2016-04-21)*
----------------------------
Fix:
[#35](https://github.com/wasabeef/glide-transformations/issues/35)
RSInvalidStateException
Version 2.0.0 *(2016-03-02)* Version 2.0.0 *(2016-03-02)*
---------------------------- ----------------------------

View File

@ -33,7 +33,7 @@ repositories {
} }
dependencies { dependencies {
compile 'jp.wasabeef:glide-transformations:2.0.0' compile 'jp.wasabeef:glide-transformations:2.0.1'
// If you want to use the GPU Filters // If you want to use the GPU Filters
compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.3.0' compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.3.0'
} }

View File

@ -5,7 +5,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-beta6' classpath 'com.android.tools.build:gradle:2.0.0'
classpath 'com.novoda:bintray-release:0.3.4' classpath 'com.novoda:bintray-release:0.3.4'
} }
} }

View File

@ -1,58 +1,58 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
android { android {
compileSdkVersion COMPILE_SDK_VERSION as int compileSdkVersion COMPILE_SDK_VERSION as int
buildToolsVersion BUILD_TOOLS_VERSION buildToolsVersion BUILD_TOOLS_VERSION
defaultConfig { defaultConfig {
minSdkVersion MIN_SDK_VERSION as int minSdkVersion MIN_SDK_VERSION as int
targetSdkVersion TARGET_SDK_VERSION as int targetSdkVersion TARGET_SDK_VERSION as int
versionCode "git rev-list origin/master --count".execute().text.toInteger() versionCode "git rev-list origin/master --count".execute().text.toInteger()
versionName VERSION_NAME versionName VERSION_NAME
} }
signingConfigs { signingConfigs {
release { release {
storeFile file(keyStoreProperty) storeFile file(keyStoreProperty)
keyAlias keyAliasProperty keyAlias keyAliasProperty
storePassword keyStorePasswordProperty storePassword keyStorePasswordProperty
keyPassword keyAliasPasswordProperty keyPassword keyAliasPasswordProperty
}
} }
}
buildTypes { buildTypes {
debug { debug {
debuggable true debuggable true
zipAlignEnabled true zipAlignEnabled true
}
release {
debuggable false
zipAlignEnabled true
signingConfig signingConfigs.release
}
} }
release {
debuggable false
zipAlignEnabled true
signingConfig signingConfigs.release
}
}
} }
def getKeyStoreProperty() { def getKeyStoreProperty() {
return hasProperty('WASABEEF_KEYSTORE') ? WASABEEF_KEYSTORE : "debug.keystore" return hasProperty('WASABEEF_KEYSTORE') ? WASABEEF_KEYSTORE : "debug.keystore"
} }
def getKeyAliasProperty() { def getKeyAliasProperty() {
return hasProperty('WASABEEF_KEYALIAS') ? WASABEEF_KEYALIAS : "android" return hasProperty('WASABEEF_KEYALIAS') ? WASABEEF_KEYALIAS : "android"
} }
def getKeyStorePasswordProperty() { def getKeyStorePasswordProperty() {
return hasProperty('WASABEEF_KEYSTOREPASSWORD') ? WASABEEF_KEYSTOREPASSWORD : "androiddebugkey" return hasProperty('WASABEEF_KEYSTOREPASSWORD') ? WASABEEF_KEYSTOREPASSWORD : "androiddebugkey"
} }
def getKeyAliasPasswordProperty() { def getKeyAliasPasswordProperty() {
return hasProperty('WASABEEF_KEYALIASPASSWORD') ? WASABEEF_KEYALIASPASSWORD : "android" return hasProperty('WASABEEF_KEYALIASPASSWORD') ? WASABEEF_KEYALIASPASSWORD : "android"
} }
dependencies { dependencies {
compile project(':transformations') compile project(':transformations')
compile "com.github.bumptech.glide:glide:${GLIDE_VERSION}" compile "com.github.bumptech.glide:glide:${GLIDE_VERSION}"
compile "jp.co.cyberagent.android.gpuimage:gpuimage-library:${GPUIMAGE_VERSION}" compile "jp.co.cyberagent.android.gpuimage:gpuimage-library:${GPUIMAGE_VERSION}"
compile "com.android.support:appcompat-v7:${SUPPORT_PACKAGE_VERSION}" compile "com.android.support:appcompat-v7:${SUPPORT_PACKAGE_VERSION}"
compile "com.android.support:recyclerview-v7:${SUPPORT_PACKAGE_VERSION}" compile "com.android.support:recyclerview-v7:${SUPPORT_PACKAGE_VERSION}"
} }

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:padding="5dp" android:padding="5dp"
> >

View File

@ -1,4 +1,4 @@
VERSION_NAME=2.0.0 VERSION_NAME=2.0.1
GROUP=jp.wasabeef GROUP=jp.wasabeef
ARTIFACT_ID=glide-transformations ARTIFACT_ID=glide-transformations
@ -21,6 +21,6 @@ POM_DEVELOPER_EMAIL=dadadada.chop@gmail.com
POM_DEVELOPER_URL=wasabeef.jp POM_DEVELOPER_URL=wasabeef.jp
ISSUE_URL=https://github.com/wasabeef/glide-transformations/issues ISSUE_URL=https://github.com/wasabeef/glide-transformations/issues
SUPPORT_PACKAGE_VERSION=23.1.1 SUPPORT_PACKAGE_VERSION=23.2.1
GLIDE_VERSION=3.7.0 GLIDE_VERSION=3.7.0
GPUIMAGE_VERSION=1.3.0 GPUIMAGE_VERSION=1.3.0

View File

@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip

View File

@ -2,49 +2,49 @@ apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release' apply plugin: 'com.novoda.bintray-release'
android { android {
compileSdkVersion COMPILE_SDK_VERSION as int compileSdkVersion COMPILE_SDK_VERSION as int
buildToolsVersion BUILD_TOOLS_VERSION buildToolsVersion BUILD_TOOLS_VERSION
defaultConfig { defaultConfig {
minSdkVersion MIN_SDK_VERSION as int minSdkVersion MIN_SDK_VERSION as int
targetSdkVersion TARGET_SDK_VERSION as int targetSdkVersion TARGET_SDK_VERSION as int
versionCode "git rev-list origin/master --count".execute().text.toInteger() versionCode "git rev-list origin/master --count".execute().text.toInteger()
versionName VERSION_NAME versionName VERSION_NAME
consumerProguardFiles 'proguard-rules.txt' consumerProguardFiles 'proguard-rules.txt'
} }
} }
dependencies { dependencies {
compile "com.github.bumptech.glide:glide:${GLIDE_VERSION}" compile "com.github.bumptech.glide:glide:${GLIDE_VERSION}"
provided "jp.co.cyberagent.android.gpuimage:gpuimage-library:${GPUIMAGE_VERSION}" provided "jp.co.cyberagent.android.gpuimage:gpuimage-library:${GPUIMAGE_VERSION}"
} }
task androidJavadocs(type: Javadoc) { task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
} }
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc' classifier = 'javadoc'
from androidJavadocs.destinationDir from androidJavadocs.destinationDir
} }
task androidSourcesJar(type: Jar) { task androidSourcesJar(type: Jar) {
classifier = 'sources' classifier = 'sources'
from android.sourceSets.main.java.srcDirs from android.sourceSets.main.java.srcDirs
} }
artifacts { artifacts {
archives androidSourcesJar archives androidSourcesJar
archives androidJavadocsJar archives androidJavadocsJar
} }
publish { publish {
userOrg = POM_DEVELOPER_ID userOrg = POM_DEVELOPER_ID
groupId = GROUP groupId = GROUP
artifactId = ARTIFACT_ID artifactId = ARTIFACT_ID
publishVersion = VERSION_NAME publishVersion = VERSION_NAME
desc = POM_DESCRIPTION desc = POM_DESCRIPTION
website = POM_URL website = POM_URL
} }

View File

@ -8,7 +8,7 @@ import android.test.ApplicationTestCase;
*/ */
public class ApplicationTest extends ApplicationTestCase<Application> { public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() { public ApplicationTest() {
super(Application.class); super(Application.class);
} }
} }

View File

@ -88,7 +88,7 @@ public class BlurTransformation implements Transformation<Bitmap> {
paint.setFlags(Paint.FILTER_BITMAP_FLAG); paint.setFlags(Paint.FILTER_BITMAP_FLAG);
canvas.drawBitmap(source, 0, 0, paint); canvas.drawBitmap(source, 0, 0, paint);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
try { try {
bitmap = RSBlur.blur(mContext, bitmap, mRadius); bitmap = RSBlur.blur(mContext, bitmap, mRadius);
} catch (RSRuntimeException e) { } catch (RSRuntimeException e) {

View File

@ -28,11 +28,12 @@ import android.renderscript.ScriptIntrinsicBlur;
public class RSBlur { public class RSBlur {
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
public static Bitmap blur(Context context, Bitmap bitmap, int radius) throws RSRuntimeException { public static Bitmap blur(Context context, Bitmap bitmap, int radius) throws RSRuntimeException {
RenderScript rs = null; RenderScript rs = null;
try { try {
rs = RenderScript.create(context); rs = RenderScript.create(context);
rs.setMessageHandler(new RenderScript.RSMessageHandler());
Allocation input = Allocation input =
Allocation.createFromBitmap(rs, bitmap, Allocation.MipmapControl.MIPMAP_NONE, Allocation.createFromBitmap(rs, bitmap, Allocation.MipmapControl.MIPMAP_NONE,
Allocation.USAGE_SCRIPT); Allocation.USAGE_SCRIPT);