Skip to content

Commit f9acde9

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

File tree

8 files changed

+102
-93
lines changed

8 files changed

+102
-93
lines changed

.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
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ Include the library as a local library project or add the dependency in your bui
2323

2424
```groovy
2525
dependencies {
26-
compile 'me.itangqi.waveloadingview:library:0.1.5'
27-
// I have uploaded v0.1.5 on 2016-01-14, if it doesn't take effect or your
28-
// gradle cannot find it in maven central, you may try v0.1.4.
26+
compile 'me.itangqi.waveloadingview:library:2.0.0'
27+
// I have uploaded v2.0.0 on 2016-02-17, if it doesn't take effect or your
28+
// gradle cannot find it in maven central, you may try v0.1.5.
2929
}
3030
```
3131
Or
@@ -41,21 +41,21 @@ Include the WaveLoadingView widget in your layout. And you can customize it like
4141
android:id="@+id/waveLoadingView"
4242
android:layout_width="wrap_content"
4343
android:layout_height="wrap_content"
44-
app:mlv_borderColor="@color/colorAccent"
45-
app:mlv_borderWidth="3dp"
46-
app:mlv_progressValue="40"
47-
app:mlv_shapeType="square"
48-
app:mlv_titleBottom="Bottom Title"
49-
app:mlv_titleBottomColor="@color/colorPrimaryText"
50-
app:mlv_titleBottomSize="20sp"
51-
app:mlv_titleCenter="Center Title"
52-
app:mlv_titleCenterColor="@color/colorPrimaryText"
53-
app:mlv_titleCenterSize="24sp"
54-
app:mlv_titleTop="Top Title"
55-
app:mlv_titleTopColor="@color/colorPrimaryText"
56-
app:mlv_titleTopSize="20sp"
57-
app:mlv_waveAmplitude="60"
58-
app:mlv_waveColor="@color/colorAccent"/>
44+
app:wlv_borderColor="@color/colorAccent"
45+
app:wlv_borderWidth="3dp"
46+
app:wlv_progressValue="40"
47+
app:wlv_shapeType="circle"
48+
app:wlv_titleBottom="Bottom Title"
49+
app:wlv_titleBottomColor="@color/colorPrimaryText"
50+
app:wlv_titleBottomSize="20sp"
51+
app:wlv_titleCenter="Center Title"
52+
app:wlv_titleCenterColor="@color/colorPrimaryText"
53+
app:wlv_titleCenterSize="24sp"
54+
app:wlv_titleTop="Top Title"
55+
app:wlv_titleTopColor="@color/colorPrimaryText"
56+
app:wlv_titleTopSize="20sp"
57+
app:wlv_waveAmplitude="70"
58+
app:wlv_waveColor="@color/colorAccent"/>
5959
```
6060

6161
### Step 3
@@ -82,27 +82,42 @@ Do what you what :)
8282

8383
|name|format|description|
8484
|:---:|:---:|:---:|
85-
| mlv_borderWidth | dimension |set border width, default is 0
86-
| mlv_borderColor | color |set border color
87-
| mlv_progressValue | integer |set progress value, default is 50
88-
| mlv_shapeType | enum |set shape type, default is circle
89-
| mlv_waveColor | color |set wave color
90-
| mlv_waveAmplitude | float |set wave amplitude
91-
| mlv_titleTopSize | dimension |set top title size, default is 18
92-
| mlv_titleCenterSize | dimension |set center title size, default is 22
93-
| mlv_titleBottomSize | dimension |set bottom size, default is 18
94-
| mlv_titleTopColor| color |set top title color
95-
| mlv_titleCenterColor | color |set center title color
96-
| mlv_titleBottomColor | color |set bottom title color
97-
| mlv_titleTop | string |set top title content, default is null
98-
| mlv_titleCenter | string |set center title content, default is null
99-
| mlv_titleBottom | string |set bottom title content, default is null
85+
| wlv_borderWidth | dimension |set border width, default is 0
86+
| wlv_borderColor | color |set border color
87+
| wlv_progressValue | integer |set progress value, default is 50
88+
| wlv_shapeType | enum |set shape type, default is circle
89+
| wlv_waveColor | color |set wave color
90+
| wlv_waveAmplitude | float |set wave amplitude
91+
| wlv_titleTopSize | dimension |set top title size, default is 18
92+
| wlv_titleCenterSize | dimension |set center title size, default is 22
93+
| wlv_titleBottomSize | dimension |set bottom size, default is 18
94+
| wlv_titleTopColor| color |set top title color
95+
| wlv_titleCenterColor | color |set center title color
96+
| wlv_titleBottomColor | color |set bottom title color
97+
| wlv_titleTop | string |set top title content, default is null
98+
| wlv_titleCenter | string |set center title content, default is null
99+
| wlv_titleBottom | string |set bottom title content, default is null
100100

101101
**All attributes have their respective getters and setters to change them at runtime.**
102102

103103

104104
## Change Log
105105

106+
### 0.1.6 (2016-02-17)
107+
108+
#### Implemented enhancements:
109+
110+
- Prefix the attributes with "wlv"
111+
112+
#### Fixed bugs:
113+
114+
- setProgressValue() increase doesn't conform to logic [#8](https://github.com/tangqi92/WaveLoadingView/issues/8)
115+
116+
#### Update:
117+
118+
- Update `build.gradle`
119+
- Update Sample
120+
106121
### 0.1.5 (2016-01-14)
107122

108123
#### Fixed bugs:
@@ -120,14 +135,8 @@ Do what you what :)
120135

121136
#### Fixed bugs:
122137

123-
124138
- Attribute "borderWidth" has already been defined [#2](https://github.com/tangqi92/WaveLoadingView/issues/2)
125139

126-
#### Implemented enhancements:
127-
128-
- Prefix the attributes with "wlv"
129-
130-
131140

132141
## Demo
133142

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
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@
1717
android:id="@+id/waveLoadingView"
1818
android:layout_width="wrap_content"
1919
android:layout_height="wrap_content"
20-
app:mlv_borderColor="@color/colorAccent"
21-
app:mlv_borderWidth="3dp"
22-
app:mlv_progressValue="40"
23-
app:mlv_shapeType="square"
24-
app:mlv_titleBottom="Bottom Title"
25-
app:mlv_titleBottomColor="@color/colorPrimaryText"
26-
app:mlv_titleBottomSize="20sp"
27-
app:mlv_titleCenter="Center Title"
28-
app:mlv_titleCenterColor="@color/colorPrimaryText"
29-
app:mlv_titleCenterSize="24sp"
30-
app:mlv_titleTop="Top Title"
31-
app:mlv_titleTopColor="@color/colorPrimaryText"
32-
app:mlv_titleTopSize="20sp"
33-
app:mlv_waveAmplitude="70"
34-
app:mlv_waveColor="@color/colorAccent"/>
20+
app:wlv_borderColor="@color/colorAccent"
21+
app:wlv_borderWidth="3dp"
22+
app:wlv_progressValue="40"
23+
app:wlv_shapeType="circle"
24+
app:wlv_titleBottom="Bottom Title"
25+
app:wlv_titleBottomColor="@color/colorPrimaryText"
26+
app:wlv_titleBottomSize="20sp"
27+
app:wlv_titleCenter="Center Title"
28+
app:wlv_titleCenterColor="@color/colorPrimaryText"
29+
app:wlv_titleCenterSize="24sp"
30+
app:wlv_titleTop="Top Title"
31+
app:wlv_titleTopColor="@color/colorPrimaryText"
32+
app:wlv_titleTopSize="20sp"
33+
app:wlv_waveAmplitude="70"
34+
app:wlv_waveColor="@color/colorAccent"/>
3535

3636
</LinearLayout>
3737

0 commit comments

Comments
 (0)