Skip to content

Commit 0cb65b1

Browse files
committed
1. Modified code and parameters name.
1 parent 5c1d15c commit 0cb65b1

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

app/src/main/java/com/amit/imgview/CircularImageView.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
public class CircularImageView extends AppCompatImageView
2424
{
25-
private static final int DEF_PRESS_HIGHTLIGHT_COLOR = 0x32000000;
25+
private static final int DEF_PRESS_HIGHLIGHT_COLOR = 0x32000000;
2626

2727
private Shader mBitmapShader;
2828
private Matrix mSharedMatrix;
@@ -49,17 +49,17 @@ public CircularImageView(Context context, AttributeSet attrs)
4949
super(context, attrs);
5050

5151
float strokeWidth = 0;
52-
boolean highlighEnable = true;
52+
boolean highlightEnable = true;
5353
int strokeColor = Color.TRANSPARENT;
54-
int highlightColor = DEF_PRESS_HIGHTLIGHT_COLOR;
54+
int highlightColor = DEF_PRESS_HIGHLIGHT_COLOR;
5555

5656
if (attrs != null)
5757
{
5858
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CircularImageView, 0,0);
5959
strokeColor = a.getColor(R.styleable.CircularImageView_strokeColor, Color.TRANSPARENT);
6060
strokeWidth = a.getDimension(R.styleable.CircularImageView_imgStrokeWidth, 0);
61-
highlighEnable = a.getBoolean(R.styleable.CircularImageView_highlightEnable, true);
62-
highlightColor = a.getColor(R.styleable.CircularImageView_highlightColor, DEF_PRESS_HIGHTLIGHT_COLOR);
61+
highlightEnable = a.getBoolean(R.styleable.CircularImageView_highlightEnable, true);
62+
highlightColor = a.getColor(R.styleable.CircularImageView_highlightColor, DEF_PRESS_HIGHLIGHT_COLOR);
6363
a.recycle();
6464
}
6565

@@ -77,7 +77,7 @@ public CircularImageView(Context context, AttributeSet attrs)
7777
mPressedPaint.setColor(highlightColor);
7878
mPressedPaint.setStyle(Paint.Style.FILL);
7979

80-
mHighlightEnable = highlighEnable;
80+
mHighlightEnable = highlightEnable;
8181
mInitialized = true;
8282
setupBitmap();
8383
}

app/src/main/java/com/amit/ui/ProgressBtn.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,18 @@ private void init(Context context, AttributeSet attrs, int defStyleAttr, int def
139139
mParams.progressBarWidth = ta.getDimension(R.styleable.ProgressBtn_progressBarWidth, 10);
140140
mParams.progressBarPadding = ta.getDimension(R.styleable.ProgressBtn_progressBarPadding, 0);
141141

142-
mParams.progressBarColor = ta.getColor(R.styleable.ProgressBtn_progressBarColor,
143-
Utils.getColorWrapper(context, R.color.colorPrimary));
142+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
143+
{
144+
mParams.progressBarColor = ta.getColor(
145+
R.styleable.ProgressBtn_progressBarColor,
146+
context.getColor(android.R.color.black));
147+
}
148+
else
149+
{
150+
mParams.progressBarColor = ta.getColor(
151+
R.styleable.ProgressBtn_progressBarColor,
152+
context.getResources().getColor(android.R.color.black));
153+
}
144154

145155
ta.recycle();
146156
taBg.recycle();

0 commit comments

Comments
 (0)