Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix AnimMode #19

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
package com.txusballesteros.widgets;

public enum AnimationMode {
public enum AnimMode {
LINEAR,
OVERDRAW
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class FitChart extends View {
private List<FitChartValue> chartValues;
private float animationProgress = INITIAL_ANIMATION_PROGRESS;
private float maxSweepAngle = MAXIMUM_SWEEP_ANGLE;
private AnimationMode animationMode = AnimationMode.LINEAR;
private AnimMode animationMode = AnimMode.LINEAR;

public void setMinValue(float value) {
minValue = value;
Expand Down Expand Up @@ -108,7 +108,7 @@ public void setValues(Collection<FitChartValue> values) {
playAnimation();
}

public void setAnimationMode(AnimationMode mode) {
public void setAnimationMode(AnimMode mode) {
this.animationMode = mode;
}

Expand Down Expand Up @@ -182,9 +182,9 @@ private void readAttributes(AttributeSet attrs) {
.getColor(R.styleable.FitChart_backStrokeColor, backStrokeColor);
int attrAnimationMode = attributes.getInteger(R.styleable.FitChart_animationMode, ANIMATION_MODE_LINEAR);
if (attrAnimationMode == ANIMATION_MODE_LINEAR) {
animationMode = AnimationMode.LINEAR;
animationMode = AnimMode.LINEAR;
} else {
animationMode = AnimationMode.OVERDRAW;
animationMode = AnimMode.OVERDRAW;
}
attributes.recycle();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import android.graphics.RectF;

class RendererFactory {
public static Renderer getRenderer(AnimationMode mode, FitChartValue value, RectF drawingArea) {
if (mode == AnimationMode.LINEAR) {
public static Renderer getRenderer(AnimMode mode, FitChartValue value, RectF drawingArea) {
if (mode == AnimMode.LINEAR) {
return new LinearValueRenderer(drawingArea, value);
} else {
return new OverdrawValueRenderer(drawingArea, value);
Expand Down
2 changes: 1 addition & 1 deletion FitChart/src/main/res/values/attributes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<attr name="strokeSize" format="dimension|reference" />
<attr name="valueStrokeColor" format="color|reference" />
<attr name="backStrokeColor" format="color|reference" />
<attr name="animationMode">
<attr name="animMode">
<enum name="linear" value="0" />
<enum name="overdraw" value="1" />
</attr>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.android.tools.build:gradle:4.1.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
}
Expand Down