Skip to content

Commit

Permalink
chore(gradle): Updated gradle version and libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
booncol committed Sep 2, 2016
2 parents 89c034d + 5d1e0e0 commit 2001c2d
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 82 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Expand Up @@ -5,9 +5,9 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
}
}

Expand Down
4 changes: 2 additions & 2 deletions demo/build.gradle
Expand Up @@ -2,14 +2,14 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
buildToolsVersion "24.0.2"

defaultConfig {
applicationId "pl.bclogic.pulsator4droid.sampleapplication"
minSdkVersion 18
targetSdkVersion 24
versionCode 1
versionName "1.0"
versionName VERSION_NAME
}
buildTypes {
release {
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Expand Up @@ -15,4 +15,6 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true

VERSION_NAME=1.0.3
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Mon Dec 28 10:00:20 PST 2015
#Fri Sep 02 11:09:25 CEST 2016
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-2.14.1-all.zip
8 changes: 4 additions & 4 deletions pulsator4droid/build.gradle
Expand Up @@ -14,7 +14,7 @@ ext {
siteUrl = 'https://github.com/booncol/Pulsator4Droid'
gitUrl = 'https://github.com/booncol/Pulsator4Droid.git'

libraryVersion = '1.0.2'
libraryVersion = VERSION_NAME

developerId = 'booncol'
developerName = 'Lukasz Majda'
Expand All @@ -27,13 +27,13 @@ ext {

android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
buildToolsVersion "24.0.2"

defaultConfig {
minSdkVersion 11
targetSdkVersion 24
versionCode 1
versionName "1.0.2"
versionCode 2
versionName VERSION_NAME
}
buildTypes {
release {
Expand Down
Expand Up @@ -28,13 +28,11 @@ public class PulsatorLayout extends RelativeLayout {
private static final int DEFAULT_COLOR = Color.rgb(0, 116, 193);
private static final int DEFAULT_DURATION = 7000;
private static final int DEFAULT_REPEAT = INFINITE;
private static final float DEFAULT_MAX_SCALE = 1.f;
private static final boolean DEFAULT_START_FROM_SCRATCH = true;

private int mCount;
private int mDuration;
private int mRepeat;
private float mMaxScale;
private boolean mStartFromScratch;

private final List<View> mViews = new ArrayList<>();
Expand All @@ -44,6 +42,7 @@ public class PulsatorLayout extends RelativeLayout {
private float mCenterX;
private float mCenterY;
private boolean mIsStarted;
private int color;

/**
* Simple constructor to use when creating a view from code.
Expand Down Expand Up @@ -88,14 +87,13 @@ public PulsatorLayout(Context context, AttributeSet attrs, int defStyleAttr) {
mRepeat = DEFAULT_REPEAT;
mStartFromScratch = DEFAULT_START_FROM_SCRATCH;

int color = DEFAULT_COLOR;
color = DEFAULT_COLOR;

try {
mCount = attr.getInteger(R.styleable.Pulsator4Droid_pulse_count, DEFAULT_COUNT);
mDuration = attr.getInteger(R.styleable.Pulsator4Droid_pulse_duration,
DEFAULT_DURATION);
mRepeat = attr.getInteger(R.styleable.Pulsator4Droid_pulse_repeat, DEFAULT_REPEAT);
mMaxScale = attr.getFloat(R.styleable.Pulsator4Droid_pulse_maxScale, DEFAULT_MAX_SCALE);
mStartFromScratch = attr.getBoolean(R.styleable.Pulsator4Droid_pulse_startFromScratch,
DEFAULT_START_FROM_SCRATCH);
color = attr.getColor(R.styleable.Pulsator4Droid_pulse_color, DEFAULT_COLOR);
Expand Down Expand Up @@ -168,33 +166,6 @@ public int getDuration() {
return mDuration;
}

/**
* Get number of pulse repeats.
*
* @return Number of pulse repeats
*/
public int getRepeat() {
return mRepeat;
}

/**
* Get maximum pulse scale.
*
* @return Maximum pulse scale
*/
public float getMaxScale() {
return mMaxScale;
}

/**
* Is animation starting from scratch.
*
* @return True if starting from scratch, otherwise False
*/
public boolean isStartFromScratch() {
return mStartFromScratch;
}

/**
* Set number of pulses.
*
Expand Down Expand Up @@ -230,46 +201,24 @@ public void setDuration(int millis) {
}

/**
* Set number of pulse repeats.
*
* @param count Number of pulse repeats
* Gets the current color of the pulse effect in integer
* Defaults to Color.rgb(0, 116, 193);
* @return an integer representation of color
*/
public void setRepeat(int count) {
if (count < 0) {
throw new IllegalArgumentException("Number of repeats cannot be negative");
}

if (count != mRepeat) {
mRepeat = count;
reset();
invalidate();
}
}

/**
* Set maximum pulse scale.
*
* @param scale Maximum pulse scale
*/
public void setMaxScale(float scale) {
if (scale != mMaxScale) {
mMaxScale = scale;
reset();
invalidate();
}
public int getColor() {
return color;
}

/**
* Set if animation is starting from scratch.
*
* @param startFromScratch True if animation starting from scratch, False if want to start
* already animating.
* Sets the current color of the pulse effect in integer
* Takes effect immediately
* Usage: Color.parseColor("<hex-value>") or getResources().getColor(R.color.colorAccent)
* @param color : an integer representation of color
*/
public void setStartFromScratch(boolean startFromScratch) {
if (startFromScratch != mStartFromScratch) {
mStartFromScratch = startFromScratch;
reset();
invalidate();
public void setColor(int color) {
this.color = color;
if(mPaint != null) {
mPaint.setColor(color);
}
}

Expand Down Expand Up @@ -324,15 +273,13 @@ private void build() {
long delay = index * mDuration / mCount;

// setup animators
ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(pulseView, "ScaleX", 0f,
mMaxScale);
ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(pulseView, "ScaleX", 0f, 1f);
scaleXAnimator.setRepeatCount(repeatCount);
scaleXAnimator.setRepeatMode(ObjectAnimator.RESTART);
scaleXAnimator.setStartDelay(delay);
animators.add(scaleXAnimator);

ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(pulseView, "ScaleY", 0f,
mMaxScale);
ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(pulseView, "ScaleY", 0f, 1f);
scaleYAnimator.setRepeatCount(repeatCount);
scaleYAnimator.setRepeatMode(ObjectAnimator.RESTART);
scaleYAnimator.setStartDelay(delay);
Expand Down

0 comments on commit 2001c2d

Please sign in to comment.