File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
stepview/src/main/java/params/com/stepview Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -372,7 +372,11 @@ class StatusView @JvmOverloads constructor(
372372 */
373373 fun setStatusList (list : List <String >) {
374374 // to make sure original list is not modified convert to mutableList
375- val input = list.toMutableList().dropLast(stepCount)
375+ val input = list.toMutableList()
376+ if (stepCount > 0 && list.size - stepCount > 0 ) {
377+ input.dropLast(list.size - stepCount)
378+ }
379+
376380
377381 statusData = (input.map { StatusInfo (it) }).toMutableList()
378382
@@ -638,7 +642,7 @@ class StatusView @JvmOverloads constructor(
638642
639643 val circleAndStatusTextHeight = if (isShowingCurrentStatus()) {
640644 val topRadius = currentStatusRadius
641- val labelHeightCurrentStatus = if (statusData.size > 0 && currentCountIndex() in 0 .. statusData.size) {
645+ val labelHeightCurrentStatus = if (statusData.size > 0 && currentCountIndex() in 0 .. ( statusData.size- 1 ) ) {
642646 statusData[currentCountIndex()].height
643647 } else {
644648 0.0f
You can’t perform that action at this time.
0 commit comments