Skip to content

Commit

Permalink
adapt support library version 27.1.1 and clean useless dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
xyczero committed Apr 23, 2018
1 parent 5a8a967 commit 063b7ca
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
11 changes: 6 additions & 5 deletions build.gradle
Expand Up @@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0"
// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -17,6 +17,7 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}

Expand All @@ -25,11 +26,11 @@ task clean(type: Delete) {
}

ext {
buildToolsVersion = '26.0.2'
targetSdkVersion = 25
compileSdkVersion = 25
buildToolsVersion = '27.0.3'
targetSdkVersion = 27
compileSdkVersion = 27
minSdkVersion = 15
supportVersion = '25.3.1'
supportVersion = '27.1.1'
constraintVersion = '1.0.2'
}

6 changes: 2 additions & 4 deletions magicasakura/build.gradle
Expand Up @@ -97,9 +97,7 @@ bintray {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])

compile "com.android.support:appcompat-v7:${rootProject.ext.supportVersion}"
compile "com.android.support:design:${rootProject.ext.supportVersion}"
compile "com.android.support:gridlayout-v7:${rootProject.ext.supportVersion}"
compile "com.android.support.constraint:constraint-layout:${rootProject.ext.constraintVersion}"
implementation "com.android.support:design:${rootProject.ext.supportVersion}"
implementation "com.android.support.constraint:constraint-layout:${rootProject.ext.constraintVersion}"

}
Expand Up @@ -16,6 +16,7 @@

package com.bilibili.magicasakura.utils;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.ContextWrapper;
Expand Down Expand Up @@ -266,9 +267,10 @@ public static boolean containsNinePatch(Drawable drawable) {
return false;
}

@SuppressLint("RestrictedApi")
public static Drawable getWrapperDrawable(Drawable drawable) {
if (drawable instanceof android.support.v4.graphics.drawable.DrawableWrapper) {
return ((android.support.v4.graphics.drawable.DrawableWrapper) drawable).getWrappedDrawable();
if (drawable instanceof android.support.v4.graphics.drawable.WrappedDrawable) {
return ((android.support.v4.graphics.drawable.WrappedDrawable) drawable).getWrappedDrawable();
} else if (drawable instanceof android.support.v7.graphics.drawable.DrawableWrapper) {
return ((android.support.v7.graphics.drawable.DrawableWrapper) drawable).getWrappedDrawable();
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && drawable instanceof android.graphics.drawable.DrawableWrapper) {
Expand Down
Expand Up @@ -19,8 +19,8 @@
import android.content.Context;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.GridLayout;
import android.util.AttributeSet;
import android.widget.GridLayout;

import com.bilibili.magicasakura.utils.TintManager;

Expand Down

0 comments on commit 063b7ca

Please sign in to comment.