Guard against crash in RTL.

Change-Id: Id692360cc66600a06a4353a8029440be422cc79f
Fixes: 27927374
This commit is contained in:
Jason Monk
2016-04-11 11:00:46 -04:00
parent 726959bf76
commit 339df0742c

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());