Merge "Guard against crash in RTL." into nyc-dev

This commit is contained in:
Jason Monk
2016-04-11 15:08:08 +00:00
committed by Android (Google) Code Review

View File

@@ -118,6 +118,10 @@ public class PageIndicator extends ViewGroup {
}
ImageView first = (ImageView) getChildAt(firstIndex);
ImageView second = (ImageView) getChildAt(secondIndex);
if (second == null) {
// Weird state where number of pages must not have propagated yet.
return;
}
// Lay the two views on top of each other.
second.setTranslationX(first.getX() - second.getX());