@@ -26,11 +26,11 @@ class StatusViewScroller @JvmOverloads constructor(
2626 addView(statusView)
2727 }
2828
29- fun scrollToPos ( count : Int ){
30- scrollTo(statusView.getScrollPosForStatus(count).toInt( ),scrollY)
29+ fun scrollToStep ( stepCount : Int ){
30+ scrollTo(statusView.getScrollPosForStep(stepCount ),scrollY)
3131 }
32- fun smoothScrollToPos ( count : Int ){
33- smoothScrollTo(statusView.getScrollPosForStatus(count).toInt( ),scrollY)
32+ fun smoothScrollToStep ( stepCount : Int ){
33+ smoothScrollTo(statusView.getScrollPosForStep(stepCount ),scrollY)
3434 }
3535}
3636
@@ -82,9 +82,9 @@ class StatusView @JvmOverloads constructor(
8282
8383 /* *
8484 * A min margin that there should be between every adjacent status Text
85- * Note# This only applies if obeyLineLength is set to false
85+ * Note# This only applies if strictObeyLineLength is set to false
8686 */
87- var minMarginStatusText : Float by OnLayoutProp (5.0f .pxValue())
87+ var minStatusAdjacentMargin : Float by OnLayoutProp (5.0f .pxValue())
8888
8989 /* *
9090 * Set true to obey Status Text i.e alphabets or words belonging to one line would not cross
@@ -94,13 +94,13 @@ class StatusView @JvmOverloads constructor(
9494 *
9595 *
9696 */
97- var obeyLineLength : Boolean by OnLayoutProp (false )
97+ var strictObeyLineLength : Boolean by OnLayoutProp (false )
9898
9999
100100 /* *
101101 * The total number of statuses to be displayed
102102 */
103- var statusCount : Int by OnLayoutProp (4 )
103+ var stepCount : Int by OnLayoutProp (4 )
104104
105105 /*
106106 The count up to which status has been completed
@@ -136,9 +136,9 @@ class StatusView @JvmOverloads constructor(
136136
137137
138138 /* *
139- * Top Margin of Labels from circle
139+ * Top Margin of Status from circle
140140 */
141- var labelTopMargin by OnLayoutProp ( 4.0f .pxValue())
141+ var statusTopMargin by OnLayoutProp ( 4.0f .pxValue())
142142
143143 /* *
144144 * set true to align all status to align same as current Status y-pos
@@ -151,10 +151,10 @@ class StatusView @JvmOverloads constructor(
151151 /* *
152152 * Stroke width of the line between circles (dp)
153153 */
154- var lineStrokeWidth : Float by OnValidateProp (1.5f .pxValue()) {
155- mLinePaint.strokeWidth = lineStrokeWidth
156- mLinePaintIncomplete.strokeWidth = lineStrokeWidth
157- mLinePaintCurrent.strokeWidth = lineStrokeWidth
154+ var lineWidth : Float by OnValidateProp (1.5f .pxValue()) {
155+ mLinePaint.strokeWidth = lineWidth
156+ mLinePaintIncomplete.strokeWidth = lineWidth
157+ mLinePaintCurrent.strokeWidth = lineWidth
158158 }
159159
160160 /* *
@@ -366,11 +366,11 @@ class StatusView @JvmOverloads constructor(
366366
367367 /* *
368368 * Creates List<LabelInfo> from List<String> by passing default values.
369- * #Note: It trims any extra statuses (if size is greater than statusCount )
369+ * #Note: It trims any extra statuses (if size is greater than stepCount )
370370 */
371371 fun setStatusList (list : List <String >) {
372372 // to make sure original list is not modified convert to mutableList
373- val input = list.toMutableList().dropLast(statusCount )
373+ val input = list.toMutableList().dropLast(stepCount )
374374
375375 statusData = (input.map{StatusInfo (it)}).toMutableList()
376376
@@ -419,26 +419,26 @@ class StatusView @JvmOverloads constructor(
419419
420420 try {
421421
422- statusCount = a.getInt(R .styleable.StatusViewScroller_statusCount , statusCount )
422+ stepCount = a.getInt(R .styleable.StatusViewScroller_stepCount , stepCount )
423423 currentCount = a.getInt(R .styleable.StatusViewScroller_currentCount , INVALID_STATUS_COUNT )
424424 circleRadius = a.getDimension(R .styleable.StatusViewScroller_circleRadius , circleRadius)
425425 lineLength = a.getDimension(R .styleable.StatusViewScroller_lineLength , lineLength)
426426 circleStrokeWidth = a.getDimension(R .styleable.StatusViewScroller_circleStrokeWidth , circleStrokeWidth)
427- lineStrokeWidth = a.getDimension(R .styleable.StatusViewScroller_lineWidth , lineStrokeWidth )
428- completeDrawable = a.getDrawable(R .styleable.StatusViewScroller_complete_drawable )
429- incompleteDrawable = a.getDrawable(R .styleable.StatusViewScroller_incomplete_drawable )
430- currentDrawable = a.getDrawable(R .styleable.StatusViewScroller_current_drawable )
431- drawLabels = a.getBoolean(R .styleable.StatusViewScroller_drawCount , drawLabels)
432- obeyLineLength = a.getBoolean(R .styleable.StatusViewScroller_obeyLineLength , obeyLineLength )
427+ lineWidth = a.getDimension(R .styleable.StatusViewScroller_lineWidth , lineWidth )
428+ completeDrawable = a.getDrawable(R .styleable.StatusViewScroller_completeDrawable )
429+ incompleteDrawable = a.getDrawable(R .styleable.StatusViewScroller_incompleteDrawable )
430+ currentDrawable = a.getDrawable(R .styleable.StatusViewScroller_currentDrawable )
431+ drawLabels = a.getBoolean(R .styleable.StatusViewScroller_drawLabels , drawLabels)
432+ strictObeyLineLength = a.getBoolean(R .styleable.StatusViewScroller_strictObeyLineLength , strictObeyLineLength )
433433 lineGap = a.getDimension(R .styleable.StatusViewScroller_lineGap , lineGap)
434- minMarginStatusText = a.getDimension(R .styleable.StatusViewScroller_minStatusMargin , minMarginStatusText )
435- labelTopMargin = a.getDimension(R .styleable.StatusViewScroller_labelTopMargin , labelTopMargin )
434+ minStatusAdjacentMargin = a.getDimension(R .styleable.StatusViewScroller_minStatusAdjacentMargin , minStatusAdjacentMargin )
435+ statusTopMargin = a.getDimension(R .styleable.StatusViewScroller_statusTopMargin , statusTopMargin )
436436 lineColor = a.getColor(R .styleable.StatusViewScroller_lineColor , lineColor)
437437 circleFillColor = a.getColor(R .styleable.StatusViewScroller_circleColor , circleFillColor)
438438 circleStrokeColor = a.getColor(R .styleable.StatusViewScroller_circleStrokeColor , circleStrokeColor)
439- textColorStatus = a.getColor(R .styleable.StatusViewScroller_textColor , textColorStatus)
439+ textColorStatus = a.getColor(R .styleable.StatusViewScroller_textColorStatus , textColorStatus)
440440 textColorLabels = a.getColor(R .styleable.StatusViewScroller_textColorLabels , textColorLabels)
441- textSizeStatus = a.getDimension(R .styleable.StatusViewScroller_textSize , textSizeStatus)
441+ textSizeStatus = a.getDimension(R .styleable.StatusViewScroller_textSizeStatus , textSizeStatus)
442442 textSizeLabels = a.getDimension(R .styleable.StatusViewScroller_textSizeLabels , textSizeLabels)
443443 circleColorType = a.getInteger(R .styleable.StatusViewScroller_circleColorType , circleColorType)
444444 textColorLabelsIncomplete = a.getColor(R .styleable.StatusViewScroller_textColorLabelsIncomplete , textColorLabels)
@@ -449,7 +449,7 @@ class StatusView @JvmOverloads constructor(
449449 circleStrokeColorIncomplete = a.getColor(R .styleable.StatusViewScroller_circleStrokeColorIncomplete , circleStrokeColor)
450450 circleStrokeColorCurrent = a.getColor(R .styleable.StatusViewScroller_circleStrokeColorCurrent , circleStrokeColorIncomplete)
451451 circleFillColorCurrent = a.getColor(R .styleable.StatusViewScroller_circleColorCurrent , circleFillColorIncomplete)
452- currentStatusZoom = a.getFloat(R .styleable.StatusViewScroller_currentStatusZoom , currentStatusZoom)
452+ currentStatusZoom = a.getFloat(R .styleable.StatusViewScroller_currentStepZoom , currentStatusZoom)
453453 alignStatusWithCurrent = a.getBoolean(R .styleable.StatusViewScroller_alignStatusWithCurrent , alignStatusWithCurrent)
454454
455455 val entries = a.getTextArray(R .styleable.StatusViewScroller_android_entries )
@@ -490,7 +490,7 @@ class StatusView @JvmOverloads constructor(
490490
491491 mLinePaint = Paint (Paint .ANTI_ALIAS_FLAG )
492492 mLinePaint.style = Paint .Style .STROKE
493- mLinePaint.strokeWidth = lineStrokeWidth
493+ mLinePaint.strokeWidth = lineWidth
494494 mLinePaint.color = lineColor
495495
496496
@@ -591,17 +591,17 @@ class StatusView @JvmOverloads constructor(
591591
592592
593593 private fun isShowingIncompleteStatus () =
594- currentCount > INVALID_STATUS_COUNT && currentCount < statusCount
594+ currentCount > INVALID_STATUS_COUNT && currentCount < stepCount
595595
596596 private fun isShowingCurrentStatus ()=
597- currentCount in 1 .. statusCount
597+ currentCount in 1 .. stepCount
598598
599599
600600 override fun getSuggestedMinimumWidth (): Int {
601601
602602
603603 lineLengthComputed = lineLength
604- var extraWidth = if (obeyLineLength ){// extra width required by status at extreme positions
604+ var extraWidth = if (strictObeyLineLength ){// extra width required by status at extreme positions
605605 setWidthDataForObeyingLineLength()
606606 }else {
607607 setWidthDataForObeyingStatusText()
@@ -612,12 +612,12 @@ class StatusView @JvmOverloads constructor(
612612 }
613613
614614
615- if (statusCount == 1 ) {
615+ if (stepCount == 1 ) {
616616 extraWidth * = 2
617617 }
618618
619- return ((statusCount * (2 * (circleRadius + (circleStrokeWidth/ 2 )))) +
620- ((statusCount - 1 ) * ( lineLengthComputed + (lineGap * 2 ))) + extraWidth).toInt()
619+ return ((stepCount * (2 * (circleRadius + (circleStrokeWidth/ 2 )))) +
620+ ((stepCount - 1 ) * ( lineLengthComputed + (lineGap * 2 ))) + extraWidth).toInt()
621621 }
622622
623623
@@ -630,7 +630,7 @@ class StatusView @JvmOverloads constructor(
630630 labelHeight = Math .max(labelHeight,setLabelsHeight(mTextPaintStatus,item))
631631 }
632632 if (statusData.size> 0 ){
633- labelHeight+ = labelTopMargin
633+ labelHeight+ = statusTopMargin
634634 }
635635
636636 val circleRadius = if (isShowingCurrentStatus()) currentStatusRadius else circleRadius
@@ -716,7 +716,7 @@ class StatusView @JvmOverloads constructor(
716716 lastPoint.x = paddingLeft.toFloat() + (circleStrokeWidth / 2 )
717717 lastPoint.y = paddingTop.toFloat() + (circleRadius + (circleStrokeWidth / 2 ))
718718 if (isShowingCurrentStatus()) lastPoint.y + = currentStatusRadius- circleRadius
719- for (pos in 0 until statusCount ) {
719+ for (pos in 0 until stepCount ) {
720720
721721 var circleStrokePaint: Paint ?
722722 var circleFillPaint : Paint ?
@@ -732,7 +732,7 @@ class StatusView @JvmOverloads constructor(
732732 textPaintLabel = mTextPaintLabelCurrent
733733 linePaint = mLinePaintCurrent
734734 itemDrawable = currentDrawable
735- }else if (isShowingIncompleteStatus() && pos in (currentCount).. statusCount ) {
735+ }else if (isShowingIncompleteStatus() && pos in (currentCount).. stepCount ) {
736736 circleStrokePaint = mCircleStrokePaintIncomplete
737737 circleFillPaint = mCircleFillPaintIncomplete
738738 textPaintLabel = mTextPaintLabelsIncomplete
@@ -770,7 +770,7 @@ class StatusView @JvmOverloads constructor(
770770
771771 if (pos< statusData.size){
772772 val radii = if (isShowingCurrentStatus() && alignStatusWithCurrent) currentStatusRadius else circleRadius
773- labelItemText = StatusItemText (circleItem.center.x, circleItem.center.y + radii + circleStrokeWidth/ 2 + labelTopMargin , statusData[pos].staticLayout)
773+ labelItemText = StatusItemText (circleItem.center.x, circleItem.center.y + radii + circleStrokeWidth/ 2 + statusTopMargin , statusData[pos].staticLayout)
774774 }
775775
776776
@@ -815,7 +815,7 @@ class StatusView @JvmOverloads constructor(
815815
816816 val item = statusData[pos]
817817 when (pos) {
818- 0 , statusCountIndex () -> {
818+ 0 , stepCountIndex () -> {
819819
820820 val minStatusWidthExtremes = minStatusWidthExtremes(pos)
821821 val minStatusWidth = minStatusWidth(pos)
@@ -871,7 +871,7 @@ class StatusView @JvmOverloads constructor(
871871 for (pos in 0 until statusData.size) {
872872 val item = statusData[pos]
873873 when (pos) {
874- 0 , statusCountIndex () -> {
874+ 0 , stepCountIndex () -> {
875875
876876 item.width = if (pos == 0 ) {
877877 widestLineData.extremeLeftStatusWidth
@@ -889,16 +889,16 @@ class StatusView @JvmOverloads constructor(
889889 else -> item.width = widestLineData.widestStatus.width
890890 }
891891
892- if (minMarginStatusText > 0 && ! addMinStatusMargin && pos in 1 until statusData.size){
893- if (minStatusWidth(pos)+ minStatusWidth(pos- 1 ) - (item.width+ statusData[pos- 1 ].width)< minMarginStatusText ){
892+ if (minStatusAdjacentMargin > 0 && ! addMinStatusMargin && pos in 1 until statusData.size){
893+ if (minStatusWidth(pos)+ minStatusWidth(pos- 1 ) - (item.width+ statusData[pos- 1 ].width)< minStatusAdjacentMargin ){
894894 addMinStatusMargin = true
895895 }
896896
897897 }
898898 }
899899 if (addMinStatusMargin){
900900 // add additional padding only if it is required
901- lineLengthComputed+ = minMarginStatusText
901+ lineLengthComputed+ = minStatusAdjacentMargin
902902 }
903903 return extraWidth
904904 }
@@ -1015,7 +1015,7 @@ class StatusView @JvmOverloads constructor(
10151015
10161016 when (pos) {
10171017 0 -> statusWidthInfo.extremeLeftStatusWidth= result
1018- statusCountIndex () -> statusWidthInfo.extremeRightStatusWidth = result
1018+ stepCountIndex () -> statusWidthInfo.extremeRightStatusWidth = result
10191019 }
10201020
10211021 }
@@ -1063,9 +1063,9 @@ class StatusView @JvmOverloads constructor(
10631063 private fun currentCountIndex () = currentCount- 1
10641064
10651065 /* *
1066- * actual position in list for statusCount
1066+ * actual position in list for stepCount
10671067 */
1068- private fun statusCountIndex () = statusCount - 1
1068+ private fun stepCountIndex () = stepCount - 1
10691069
10701070
10711071 /* *
@@ -1111,7 +1111,7 @@ class StatusView @JvmOverloads constructor(
11111111 return TypedValue .applyDimension(unit,this ,resources.displayMetrics)
11121112 }
11131113
1114- fun getScrollPosForStatus (count : Int ): Int {
1114+ fun getScrollPosForStep (count : Int ): Int {
11151115 val posIndex = count - 1
11161116 return if (posIndex> 0 && posIndex < drawingData.size) {
11171117 drawingData[posIndex].circleItem.center.x.toInt()
0 commit comments