Fixing small regression in PageIndicators add page, fixing NPE (Bug 10779956)

Change-Id: I7ff711c6fc97987efc57bf023913e33e31ccf140
This commit is contained in:
Winson Chung
2013-09-20 11:32:26 -07:00
parent 37cab1bc25
commit 89f9705077
3 changed files with 43 additions and 31 deletions

View File

@@ -186,6 +186,11 @@ public class PageIndicator extends LinearLayout {
}
}
void updateMarker(int index, PageMarkerResources marker) {
PageIndicatorMarker m = mMarkers.get(index);
m.setMarkerDrawables(marker.activeId, marker.inactiveId);
}
void removeMarker(int index, boolean allowAnimations) {
if (mMarkers.size() > 0) {
index = Math.max(0, Math.min(mMarkers.size() - 1, index));