@Override
  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    int desiredHeight = getDesiredHeight();
    int height;
    switch (MeasureSpec.getMode(heightMeasureSpec)) {
      case MeasureSpec.EXACTLY:
        height = MeasureSpec.getSize(heightMeasureSpec);
        break;
      case MeasureSpec.AT_MOST:
        height = Math.min(desiredHeight, MeasureSpec.getSize(heightMeasureSpec));
        break;
      default: // MeasureSpec.UNSPECIFIED
        height = desiredHeight;
        break;
    }
    int desiredWidth = getDesiredWidth();
    int width;
    switch (MeasureSpec.getMode(widthMeasureSpec)) {
      case MeasureSpec.EXACTLY:
        width = MeasureSpec.getSize(widthMeasureSpec);
        break;
      case MeasureSpec.AT_MOST:
        width = Math.min(desiredWidth, MeasureSpec.getSize(widthMeasureSpec));
        break;
      default: // MeasureSpec.UNSPECIFIED
        width = desiredWidth;
        break;
    }
    setMeasuredDimension(width, height);
    calculateDotPositions();
  }
As this class <b>must</b> act as the {@link ViewPager.OnPageChangeListener} for the ViewPager
(as set by {@link #setViewPager(android.support.v4.view.ViewPager)}).  Applications may set a
listener here to be notified of the ViewPager events.

@param onPageChangeListener
java/com/google/android/apps/authenticator/howitworks/PagingIndicator.java