Skip to content

Commit

Permalink
Merge pull request Todd-Davies#61 from vicktor/master
Browse files Browse the repository at this point in the history
Renamed attributes, there are a problem with level api 23
  • Loading branch information
Todd-Davies committed Oct 2, 2015
2 parents e6241f9 + 65cefa3 commit 92bfcfe
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 38 deletions.
18 changes: 9 additions & 9 deletions res/layout/progress_wheel_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
android:id="@+id/progressBarTwo"
android:layout_width="150dp"
android:layout_height="150dp"
ProgressWheel:textColor="#222222"
ProgressWheel:textSize="14sp"
ProgressWheel:rimColor="#44000000"
ProgressWheel:barLength="60dp"
ProgressWheel:barColor="#339BB9"
ProgressWheel:barWidth="25dp"
ProgressWheel:rimWidth="25dp"
ProgressWheel:spinSpeed="3dp"/>
ProgressWheel:pwTextColor="#222222"
ProgressWheel:pwTextSize="14sp"
ProgressWheel:pwRimColor="#44000000"
ProgressWheel:pwBarLength="60dp"
ProgressWheel:pwBarColor="#339BB9"
ProgressWheel:pwBarWidth="25dp"
ProgressWheel:pwRimWidth="25dp"
ProgressWheel:pwSpinSpeed="3dp"/>
</LinearLayout>

</LinearLayout>
Expand All @@ -74,4 +74,4 @@
android:layout_above="@+id/textView"
android:layout_centerHorizontal="true" />

</RelativeLayout>
</RelativeLayout>
30 changes: 15 additions & 15 deletions res/values/attrs.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="ProgressWheel">
<attr name="text" format="string" />
<attr name="textColor" format="color" />
<attr name="textSize" format="dimension" />
<attr name="barColor" format="color" />
<attr name="rimColor" format="color" />
<attr name="rimWidth" format="dimension" />
<attr name="spinSpeed" format="dimension" />
<attr name="delayMillis" format="integer" />
<attr name="circleColor" format="color" />
<attr name="pw_radius" format="dimension" />
<attr name="barWidth" format="dimension" />
<attr name="barLength" format="dimension" />
<attr name="contourColor" format="color"/>
<attr name="contourSize" format="dimension"/>
<attr name="pwText" format="string" />
<attr name="pwTextColor" format="color" />
<attr name="pwTextSize" format="dimension" />
<attr name="pwBarColor" format="color" />
<attr name="pwRimColor" format="color" />
<attr name="pwRimWidth" format="dimension" />
<attr name="pwSpinSpeed" format="dimension" />
<attr name="pwDelayMillis" format="integer" />
<attr name="pwCircleColor" format="color" />
<attr name="pwRadius" format="dimension" />
<attr name="pwBarWidth" format="dimension" />
<attr name="pwBarLength" format="dimension" />
<attr name="pwContourColor" format="color"/>
<attr name="pwContourSize" format="dimension"/>
</declare-styleable>
</resources>
</resources>
28 changes: 14 additions & 14 deletions src/com/todddavies/components/progressbar/ProgressWheel.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,27 +233,27 @@ private void setupBounds() {
* @param a the attributes to parse
*/
private void parseAttributes(TypedArray a) {
barWidth = (int) a.getDimension(R.styleable.ProgressWheel_barWidth, barWidth);
rimWidth = (int) a.getDimension(R.styleable.ProgressWheel_rimWidth, rimWidth);
spinSpeed = (int) a.getDimension(R.styleable.ProgressWheel_spinSpeed, spinSpeed);
barLength = (int) a.getDimension(R.styleable.ProgressWheel_barLength, barLength);
barWidth = (int) a.getDimension(R.styleable.ProgressWheel_pwBarWidth, barWidth);
rimWidth = (int) a.getDimension(R.styleable.ProgressWheel_pwRimWidth, rimWidth);
spinSpeed = (int) a.getDimension(R.styleable.ProgressWheel_pwSpinSpeed, spinSpeed);
barLength = (int) a.getDimension(R.styleable.ProgressWheel_pwBarLength, barLength);

delayMillis = a.getInteger(R.styleable.ProgressWheel_delayMillis, delayMillis);
delayMillis = a.getInteger(R.styleable.ProgressWheel_pwDelayMillis, delayMillis);
if (delayMillis < 0) { delayMillis = 10; }

// Only set the text if it is explicitly defined
if (a.hasValue(R.styleable.ProgressWheel_text)) {
setText(a.getString(R.styleable.ProgressWheel_text));
if (a.hasValue(R.styleable.ProgressWheel_pwText)) {
setText(a.getString(R.styleable.ProgressWheel_pwText));
}

barColor = a.getColor(R.styleable.ProgressWheel_barColor, barColor);
textColor = a.getColor(R.styleable.ProgressWheel_textColor, textColor);
rimColor = a.getColor(R.styleable.ProgressWheel_rimColor, rimColor);
circleColor = a.getColor(R.styleable.ProgressWheel_circleColor, circleColor);
contourColor = a.getColor(R.styleable.ProgressWheel_contourColor, contourColor);
barColor = a.getColor(R.styleable.ProgressWheel_pwBarColor, barColor);
textColor = a.getColor(R.styleable.ProgressWheel_pwTextColor, textColor);
rimColor = a.getColor(R.styleable.ProgressWheel_pwRimColor, rimColor);
circleColor = a.getColor(R.styleable.ProgressWheel_pwCircleColor, circleColor);
contourColor = a.getColor(R.styleable.ProgressWheel_pwContourColor, contourColor);

textSize = (int) a.getDimension(R.styleable.ProgressWheel_textSize, textSize);
contourSize = a.getDimension(R.styleable.ProgressWheel_contourSize, contourSize);
textSize = (int) a.getDimension(R.styleable.ProgressWheel_pwTextSize, textSize);
contourSize = a.getDimension(R.styleable.ProgressWheel_pwContourSize, contourSize);

a.recycle();
}
Expand Down

0 comments on commit 92bfcfe

Please sign in to comment.