Skip to content

Commit

Permalink
upgrade gradle version
Browse files Browse the repository at this point in the history
  • Loading branch information
medyo committed Jul 26, 2017
1 parent eea74be commit 905f73c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
}
}

Expand Down
2 changes: 1 addition & 1 deletion fancybuttons_library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 25
buildToolsVersion '25.0.1'
buildToolsVersion '25.0.2'

defaultConfig {
minSdkVersion 8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.Outline;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
Expand All @@ -15,6 +16,7 @@
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
import android.view.ViewOutlineProvider;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
Expand Down Expand Up @@ -832,4 +834,37 @@ public ImageView getIconImageObject(){
return mIconView;
}

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private class CustomOutline extends ViewOutlineProvider {

int width;
int height;

CustomOutline(int width, int height) {
this.width = width;
this.height = height;
}

@Override
public void getOutline(View view, Outline outline) {

if (mRadius==0){
outline.setRect(0,10,width,height);
}
else {
outline.setRoundRect(0, 10, width, height, mRadius);
}

}
}

@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
setOutlineProvider(new CustomOutline(w, h));
}
}

}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https://services.gradle.org/distributions/gradle-3.5-all.zip

0 comments on commit 905f73c

Please sign in to comment.