Update: to v0.2.0 (≖ ‿ ≖) · foozilla/WaveLoadingView@f9acde9 · GitHub
Skip to content

Commit f9acde9

Browse files
committed
Update: to v0.2.0 (≖ ‿ ≖)
1 parent 6866607 commit f9acde9

8 files changed

Lines changed: 102 additions & 93 deletions

File tree

.idea/gradle.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 48 additions & 39 deletions

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
9-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1'
8+
classpath 'com.android.tools.build:gradle:1.5.0'
9+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
1010
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
1111
// NOTE: Do not place your application dependencies here; they belong
1212
// in the individual module build.gradle files

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

library/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply plugin: 'com.github.dcendents.android-maven'
33
apply plugin: 'com.jfrog.bintray'
44

55
// This is the library version used when deploying the artifact.
6-
version = "0.1.5"
6+
version = "0.2.0"
77

88
android {
99
compileSdkVersion 23
@@ -12,8 +12,8 @@ android {
1212
defaultConfig {
1313
minSdkVersion 14
1414
targetSdkVersion 23
15-
versionCode 1
16-
versionName "1.0"
15+
versionCode 2
16+
versionName "2.0"
1717
}
1818
buildTypes {
1919
release {

library/src/main/java/me/itangqi/waveloadingview/WaveLoadingView.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -120,47 +120,47 @@ private void init(Context context, AttributeSet attrs, int defStyleAttr) {
120120
TypedArray attributes = context.obtainStyledAttributes(attrs, R.styleable.WaveLoadingView, defStyleAttr, 0);
121121

122122
// Init ShapeType
123-
mShapeType = attributes.getInteger(R.styleable.WaveLoadingView_mlv_shapeType, DEFAULT_WAVE_SHAPE);
123+
mShapeType = attributes.getInteger(R.styleable.WaveLoadingView_wlv_shapeType, DEFAULT_WAVE_SHAPE);
124124

125125
// Init Wave
126-
mWaveColor = attributes.getColor(R.styleable.WaveLoadingView_mlv_waveColor, DEFAULT_WAVE_COLOR);
126+
mWaveColor = attributes.getColor(R.styleable.WaveLoadingView_wlv_waveColor, DEFAULT_WAVE_COLOR);
127127

128128
// Init AmplitudeRatio
129-
float amplitudeRatioAttr = attributes.getFloat(R.styleable.WaveLoadingView_mlv_waveAmplitude, DEFAULT_AMPLITUDE_RATIO) / 1000;
129+
float amplitudeRatioAttr = attributes.getFloat(R.styleable.WaveLoadingView_wlv_waveAmplitude, DEFAULT_AMPLITUDE_RATIO) / 1000;
130130
mAmplitudeRatio = (amplitudeRatioAttr > DEFAULT_AMPLITUDE_RATIO) ? DEFAULT_AMPLITUDE_RATIO : amplitudeRatioAttr;
131131

132132
// Init Progress
133-
mProgressValue = attributes.getInteger(R.styleable.WaveLoadingView_mlv_progressValue, DEFAULT_WAVE_PROGRESS_VALUE);
133+
mProgressValue = attributes.getInteger(R.styleable.WaveLoadingView_wlv_progressValue, DEFAULT_WAVE_PROGRESS_VALUE);
134134
setProgressValue(mProgressValue);
135135

136136
// Init Border
137137
mBorderPaint = new Paint();
138138
mBorderPaint.setAntiAlias(true);
139139
mBorderPaint.setStyle(Paint.Style.STROKE);
140-
mBorderPaint.setStrokeWidth(attributes.getDimension(R.styleable.WaveLoadingView_mlv_borderWidth, dp2px(DEFAULT_BORDER_WIDTH)));
141-
mBorderPaint.setColor(attributes.getColor(R.styleable.WaveLoadingView_mlv_borderColor, DEFAULT_WAVE_COLOR));
140+
mBorderPaint.setStrokeWidth(attributes.getDimension(R.styleable.WaveLoadingView_wlv_borderWidth, dp2px(DEFAULT_BORDER_WIDTH)));
141+
mBorderPaint.setColor(attributes.getColor(R.styleable.WaveLoadingView_wlv_borderColor, DEFAULT_WAVE_COLOR));
142142

143143
// Init Title
144144
mTopTitlePaint = new Paint();
145-
mTopTitlePaint.setColor(attributes.getColor(R.styleable.WaveLoadingView_mlv_titleTopColor, DEFAULT_TITLE_COLOR));
145+
mTopTitlePaint.setColor(attributes.getColor(R.styleable.WaveLoadingView_wlv_titleTopColor, DEFAULT_TITLE_COLOR));
146146
mTopTitlePaint.setStyle(Paint.Style.FILL);
147147
mTopTitlePaint.setAntiAlias(true);
148-
mTopTitlePaint.setTextSize(attributes.getDimension(R.styleable.WaveLoadingView_mlv_titleTopSize, sp2px(DEFAULT_TITLE_TOP_SIZE)));
149-
mTopTitle = attributes.getString(R.styleable.WaveLoadingView_mlv_titleTop);
148+
mTopTitlePaint.setTextSize(attributes.getDimension(R.styleable.WaveLoadingView_wlv_titleTopSize, sp2px(DEFAULT_TITLE_TOP_SIZE)));
149+
mTopTitle = attributes.getString(R.styleable.WaveLoadingView_wlv_titleTop);
150150

151151
mCenterTitlePaint = new Paint();
152-
mCenterTitlePaint.setColor(attributes.getColor(R.styleable.WaveLoadingView_mlv_titleCenterColor, DEFAULT_TITLE_COLOR));
152+
mCenterTitlePaint.setColor(attributes.getColor(R.styleable.WaveLoadingView_wlv_titleCenterColor, DEFAULT_TITLE_COLOR));
153153
mCenterTitlePaint.setStyle(Paint.Style.FILL);
154154
mCenterTitlePaint.setAntiAlias(true);
155-
mCenterTitlePaint.setTextSize(attributes.getDimension(R.styleable.WaveLoadingView_mlv_titleCenterSize, sp2px(DEFAULT_TITLE_CENTER_SIZE)));
156-
mCenterTitle = attributes.getString(R.styleable.WaveLoadingView_mlv_titleCenter);
155+
mCenterTitlePaint.setTextSize(attributes.getDimension(R.styleable.WaveLoadingView_wlv_titleCenterSize, sp2px(DEFAULT_TITLE_CENTER_SIZE)));
156+
mCenterTitle = attributes.getString(R.styleable.WaveLoadingView_wlv_titleCenter);
157157

158158
mBottomTitlePaint = new Paint();
159-
mBottomTitlePaint.setColor(attributes.getColor(R.styleable.WaveLoadingView_mlv_titleBottomColor, DEFAULT_TITLE_COLOR));
159+
mBottomTitlePaint.setColor(attributes.getColor(R.styleable.WaveLoadingView_wlv_titleBottomColor, DEFAULT_TITLE_COLOR));
160160
mBottomTitlePaint.setStyle(Paint.Style.FILL);
161161
mBottomTitlePaint.setAntiAlias(true);
162-
mBottomTitlePaint.setTextSize(attributes.getDimension(R.styleable.WaveLoadingView_mlv_titleBottomSize, sp2px(DEFAULT_TITLE_BOTTOM_SIZE)));
163-
mBottomTitle = attributes.getString(R.styleable.WaveLoadingView_mlv_titleBottom);
162+
mBottomTitlePaint.setTextSize(attributes.getDimension(R.styleable.WaveLoadingView_wlv_titleBottomSize, sp2px(DEFAULT_TITLE_BOTTOM_SIZE)));
163+
mBottomTitle = attributes.getString(R.styleable.WaveLoadingView_wlv_titleBottom);
164164
}
165165

166166
@Override
@@ -409,7 +409,7 @@ public float getAmplitudeRatio() {
409409
*/
410410
public void setProgressValue(int progress) {
411411
mProgressValue = progress;
412-
ObjectAnimator waterLevelAnim = ObjectAnimator.ofFloat(this, "waterLevelRatio", mWaterLevelRatio, 1f - ((float) progress / 100));
412+
ObjectAnimator waterLevelAnim = ObjectAnimator.ofFloat(this, "waterLevelRatio", mWaterLevelRatio, ((float) mProgressValue / 100));
413413
waterLevelAnim.setDuration(1000);
414414
waterLevelAnim.setInterpolator(new DecelerateInterpolator());
415415
AnimatorSet animatorSetProgress = new AnimatorSet();

library/src/main/res/values/attrs.xml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
<resources>
33

44
<declare-styleable name="WaveLoadingView">
5-
<attr name="mlv_borderWidth" format="dimension"/>
6-
<attr name="mlv_borderColor" format="color"/>
7-
<attr name="mlv_progressValue" format="integer"/>
8-
<attr name="mlv_shapeType" format="enum">
5+
<attr name="wlv_borderWidth" format="dimension"/>
6+
<attr name="wlv_borderColor" format="color"/>
7+
<attr name="wlv_progressValue" format="integer"/>
8+
<attr name="wlv_shapeType" format="enum">
99
<enum name="circle" value="0" />
1010
<enum name="square" value="1" />
1111
</attr>
12-
<attr name="mlv_waveColor" format="color"/>
13-
<attr name="mlv_waveAmplitude" format="float"/>
14-
<attr name="mlv_titleTopSize" format="dimension"/>
15-
<attr name="mlv_titleCenterSize" format="dimension"/>
16-
<attr name="mlv_titleBottomSize" format="dimension"/>
17-
<attr name="mlv_titleTopColor" format="color"/>
18-
<attr name="mlv_titleCenterColor" format="color"/>
19-
<attr name="mlv_titleBottomColor" format="color"/>
20-
<attr name="mlv_titleTop" format="string"/>
21-
<attr name="mlv_titleCenter" format="string"/>
22-
<attr name="mlv_titleBottom" format="string"/>
12+
<attr name="wlv_waveColor" format="color"/>
13+
<attr name="wlv_waveAmplitude" format="float"/>
14+
<attr name="wlv_titleTopSize" format="dimension"/>
15+
<attr name="wlv_titleCenterSize" format="dimension"/>
16+
<attr name="wlv_titleBottomSize" format="dimension"/>
17+
<attr name="wlv_titleTopColor" format="color"/>
18+
<attr name="wlv_titleCenterColor" format="color"/>
19+
<attr name="wlv_titleBottomColor" format="color"/>
20+
<attr name="wlv_titleTop" format="string"/>
21+
<attr name="wlv_titleCenter" format="string"/>
22+
<attr name="wlv_titleBottom" format="string"/>
2323
</declare-styleable>
2424

2525
</resources>

sample/src/main/res/layout/activity_main.xml

Lines changed: 15 additions & 15 deletions

0 commit comments

Comments
 (0)