message: Removed hard-coded child view indices
diff: @@ -31,11 +31,27 @@ public class CoordinatorLayoutView extends CoordinatorLayout {
  }
  };
  + private NavigationBarView getNavigationBarView() {
  + for(int i = 0; i < getChildCount(); i++) {
  + if (getChildAt(i) instanceof NavigationBarView)
  + return (NavigationBarView) getChildAt(i);
  + }
  + return null;
  + }
  +
  + ScrollView getScrollView() {
  + for(int i = 0; i < getChildCount(); i++) {
  + if (getChildAt(i) instanceof ScrollView)
  + return (ScrollView) getChildAt(i);
  + }
  + return null;
  + }
  +
  @Override
  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  int height = MeasureSpec.getSize(heightMeasureSpec);
  - int contentHeight = ((ScrollView) getChildAt(1)).getChildAt(0).getHeight();
  - boolean collapsingBar = ((NavigationBarView) getChildAt(0)).getChildAt(0) instanceof CollapsingBarView;
  + int contentHeight = getScrollView() != null ? getScrollView().getChildAt(0).getHeight() : 0;
  + boolean collapsingBar = getNavigationBarView() != null && getNavigationBarView().getChildAt(0) instanceof CollapsingBarView;
  int navigationBarHeight = collapsingBar ? (int) PixelUtil.toPixelFromDIP(56) : 0;
  int collapsedGap = height + 2 - contentHeight - navigationBarHeight;
  if (collapsedGap > 0)
  