Skip to content

Commit

Permalink
v1.0.3 fix nullpointerexception on some devices
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Mondon committed Oct 30, 2017
1 parent 4e0b0b4 commit d590619
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Download

```groovy
dependencies {
compile 'com.blunderer:easy-animated-vector-drawable:1.0.2'
compile 'com.blunderer:easy-animated-vector-drawable:1.0.3'
}
```

Expand Down
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.0.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -15,7 +16,7 @@ buildscript {
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
google()
}
}

Expand Down
10 changes: 5 additions & 5 deletions demo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
compileSdkVersion 27
buildToolsVersion "27.0.0"

defaultConfig {
applicationId "com.blunderer.easyanimatedvectordrawabledemo"
minSdkVersion 14
targetSdkVersion 26
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
Expand All @@ -23,7 +23,7 @@ android {
}

dependencies {
compile 'com.android.support:appcompat-v7:26.0.1'
implementation 'com.android.support:appcompat-v7:27.0.0'

compile project(':library')
implementation project(':library')
}
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 @@
#Thu Sep 28 10:46:06 CEST 2017
#Mon Oct 30 20:22:41 CET 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
16 changes: 8 additions & 8 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
compileSdkVersion 27
buildToolsVersion "27.0.0"

defaultConfig {
minSdkVersion 14
targetSdkVersion 26
versionCode 3
versionName "1.0.2"
targetSdkVersion 27
versionCode 4
versionName "1.0.3"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
Expand All @@ -23,14 +23,14 @@ android {
}

dependencies {
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.wnafee:vector-compat:1.0.5'
implementation 'com.android.support:appcompat-v7:27.0.0'
api 'com.wnafee:vector-compat:1.0.5'
}

ext {
PUBLISH_GROUP_ID = 'com.blunderer'
PUBLISH_ARTIFACT_ID = 'easy-animated-vector-drawable'
PUBLISH_VERSION = '1.0.2'
PUBLISH_VERSION = '1.0.3'
}

apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ private static void setImageDrawable(@NonNull ImageView imageView, @DrawableRes
return;
}
Drawable drawable = ResourcesCompat.getDrawable(imageView.getContext(), drawableResId);
if (drawable == null) {
Log.e(TAG, "The drawable with id " + drawableResId + " is null");
return;
}
if (Build.VERSION.SDK_INT != Build.VERSION_CODES.M) {
drawable = drawable.mutate();
}
Expand Down

0 comments on commit d590619

Please sign in to comment.