Skip to content

Commit 7bdea1d

Browse files
committed
refactor(MagicProgressBar): adjust the name of the non-standard: mpb_color -> mpb_fill_color; mpb_default_color -> mpb_background_color
1 parent 0c8271d commit 7bdea1d

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,28 @@
3434
style="@style/demo_progress_bar"
3535
android:layout_height="32dp"
3636
android:layout_marginTop="30dp"
37-
app:mpb_color="#FF1CECBE"
38-
app:mpb_default_color="#1AFFFFFF"
37+
app:mpb_background_color="#1AFFFFFF"
38+
app:mpb_fill_color="#FF1CECBE"
3939
app:mpb_flat="true" />
4040

4141
<com.liulishuo.magicprogresswidget.MagicProgressBar
4242
android:id="@+id/demo_2_mpb"
4343
style="@style/demo_progress_bar"
4444
android:layout_height="32dp"
45-
app:mpb_color="#FFFF493D"
46-
app:mpb_default_color="#1AFFFFFF" />
45+
app:mpb_background_color="#1AFFFFFF"
46+
app:mpb_fill_color="#FFFF493D" />
4747

4848
<com.liulishuo.magicprogresswidget.MagicProgressBar
4949
android:id="@+id/demo_3_mpb"
5050
style="@style/demo_progress_bar"
51-
app:mpb_color="#FFF141B4"
52-
app:mpb_default_color="#1AFFFFFF" />
51+
app:mpb_background_color="#1AFFFFFF"
52+
app:mpb_fill_color="#FFF141B4" />
5353

5454
<com.liulishuo.magicprogresswidget.MagicProgressBar
5555
android:id="@+id/demo_4_mpb"
5656
style="@style/demo_progress_bar"
57-
app:mpb_color="#FF86E50E"
58-
app:mpb_default_color="#1AFFFFFF" />
57+
app:mpb_background_color="#1AFFFFFF"
58+
app:mpb_fill_color="#FF86E50E" />
5959

6060

6161
</LinearLayout>

library/src/main/java/com/liulishuo/magicprogresswidget/MagicProgressBar.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ private void init(final Context context, AttributeSet attrs) {
7676
try {
7777
typedArray = context.obtainStyledAttributes(attrs, R.styleable.MagicProgressBar);
7878
percent = typedArray.getFloat(R.styleable.MagicProgressBar_mpb_percent, 0);
79-
fillColor = typedArray.getColor(R.styleable.MagicProgressBar_mpb_color, 0);
80-
backgroundColor = typedArray.getColor(R.styleable.MagicProgressBar_mpb_default_color, 0);
79+
fillColor = typedArray.getColor(R.styleable.MagicProgressBar_mpb_fill_color, 0);
80+
backgroundColor = typedArray.getColor(R.styleable.MagicProgressBar_mpb_background_color, 0);
8181
isFlat = typedArray.getBoolean(R.styleable.MagicProgressBar_mpb_flat, false);
8282
} finally {
8383
if (typedArray != null) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
<declare-styleable name="MagicProgressBar">
1313
<attr name="mpb_percent" format="float" />
14-
<attr name="mpb_color" format="color" />
15-
<attr name="mpb_default_color" format="color" />
14+
<attr name="mpb_fill_color" format="color" />
15+
<attr name="mpb_background_color" format="color" />
1616
<attr name="mpb_flat" format="boolean" />
1717
</declare-styleable>
1818

0 commit comments

Comments
 (0)