Merge "Fixed a crash when changing density with HUN visible" into nyc-dev

am: 3af18ca

* commit '3af18caf8e31afe87ee82bb2710876bdcc1d9a06':
  Fixed a crash when changing density with HUN visible

Change-Id: I1d231c00a65ec911c6c04755caf1135da1c6feca
This commit is contained in:
Selim Cinek
2016-04-19 02:58:36 +00:00
committed by android-build-merger

View File

@@ -120,9 +120,8 @@ 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;
if (first == null || second == null) {
// may happen during reInflation or other weird cases
}
// Lay the two views on top of each other.
second.setTranslationX(first.getX() - second.getX());