Skip to content

Commit

Permalink
Added stroke width manipulation.
Browse files Browse the repository at this point in the history
  • Loading branch information
tizisdeepan committed Aug 14, 2019
1 parent 6f4b38d commit 6fc522b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,22 @@ class PieProgress : View {
val progressColor = attributes.getColor(
R.styleable.PieProgress_progressColor, context.resources.getColor(R.color.white, context.theme)
)
val strokeWidthAttribute = attributes.getDimension(
R.styleable.PieProgress_strokeWidth, context.resources.getDimension(R.dimen.width_circle_stroke)
)
progressPaint.apply {
color = progressColor
}
tickPaint.apply {
color = progressColor
style = Paint.Style.STROKE
strokeCap = Paint.Cap.ROUND
strokeWidth = resources.getDimension(R.dimen.width_circle_stroke)
strokeWidth = strokeWidthAttribute
}
strokePaint.apply {
color = progressColor
style = Paint.Style.STROKE
strokeWidth = resources.getDimension(R.dimen.width_circle_stroke)
strokeWidth = strokeWidthAttribute
}
} finally {
attributes.recycle()
Expand Down
1 change: 1 addition & 0 deletions pieprogress/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
<resources>
<declare-styleable name="PieProgress">
<attr name="progressColor" format="color"/>
<attr name="strokeWidth" format="dimension"/>
</declare-styleable>
</resources>

0 comments on commit 6fc522b

Please sign in to comment.