Skip to content

Commit

Permalink
added bintray stuff, fixed a compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
fennifith committed Mar 14, 2018
1 parent 8ac6eac commit 539be31
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion attribouter/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
apply plugin: 'com.android.library'

ext {
PUBLISH_GROUP_ID = 'me.jfenn'
PUBLISH_ARTIFACT_ID = 'attribouter'
PUBLISH_VERSION = '0.0.1'
}

android {
compileSdkVersion 27

defaultConfig {
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
versionName "0.0.1"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand All @@ -34,3 +40,5 @@ dependencies {
implementation 'com.github.bumptech.glide:glide:4.6.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
}

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 @@ -7,14 +7,15 @@
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.VectorDrawable;
import android.os.Build;
import android.support.graphics.drawable.VectorDrawableCompat;

public class ImageUtils {

public static Bitmap drawableToBitmap(Drawable drawable) {
if (drawable == null) drawable = new ColorDrawable(Color.TRANSPARENT);
if (drawable instanceof BitmapDrawable) return ((BitmapDrawable) drawable).getBitmap();
if (drawable instanceof VectorDrawableCompat || drawable instanceof VectorDrawable) {
if (drawable instanceof VectorDrawableCompat || (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && drawable instanceof VectorDrawable)) {
Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
Expand Down

0 comments on commit 539be31

Please sign in to comment.