Skip to content

Commit

Permalink
Merge pull request #11 from ronaldsmartin/bugfix-api-17-concurrent-mo…
Browse files Browse the repository at this point in the history
…dification-exception

Fix API 17 ConcurrentModificationException
  • Loading branch information
ronaldsmartin authored Oct 15, 2016
2 parents 6089f9b + b1f7579 commit f40e4c9
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@ private void updateDotCount(int newDotCount) {
addViewInLayout(newDot, -1, layoutParams, true);
}
} else if (dotCount > newDotCount) {
final List<IndicatorDotView> removedDots = indicatorDots
.subList(newDotCount, dotCount);
final List<IndicatorDotView> removedDots =
new ArrayList<>(indicatorDots.subList(newDotCount, dotCount));
for (IndicatorDotView removedDot : removedDots) {
removeViewInLayout(removedDot);
}
Expand Down Expand Up @@ -370,8 +370,8 @@ private void updatePathCount(final int newPathCount) {
addViewInLayout(newPath, -1, layoutParams, true);
}
} else if (pathCount > newPathCount && newPathCount >= 0) {
final List<IndicatorDotPathView> pathsToRemove = dotPaths
.subList(newPathCount, pathCount);
final List<IndicatorDotPathView> pathsToRemove =
new ArrayList<>(dotPaths.subList(newPathCount, pathCount));
for (IndicatorDotPathView dotPath : pathsToRemove) {
removeViewInLayout(dotPath);
}
Expand Down

0 comments on commit f40e4c9

Please sign in to comment.