@Override public void onPageSelected(int position) {
      if (mScrollState == ViewPager.SCROLL_STATE_IDLE) {
        // Only update the text here if we're not dragging or settling.
        updateText(mPager.getCurrentItem(), mPager.getAdapter());

        final float offset = mLastKnownPositionOffset >= 0 ? mLastKnownPositionOffset : 0;
        updateTextPositions(mPager.getCurrentItem(), offset, true);
      }
    }
Set the {@link Gravity} used to position text within the title strip.
Only the vertical gravity component is used.

@param gravity {@link Gravity} constant for positioning title text
sample/src/main/java/android/support/v4/view/PagerTitleStripV22.java