title: TitlePageIndicator title becomes different from PagerAdapter.getPageTitle(int)
body: <p>The issue I'm noticing happens when the user scrolls to the next (or previous) page in the <code>ViewPager</code>, which triggers the <code>ViewPager</code>'s settling (confirm?) to that page. This works perfectly unless the user starts dragging while the <code>ViewPager</code> is still settling. In this scenario what I get is the title shown by the <code>TitlePageIndicator</code> shows the title for 2 pages after (or before, respectively) while the content shown by the <code>ViewPager</code> is showing the next (or previous) page. </p>
  
  <p>If the user starts to swipe after that page - the one with the mismatched title and content - has settled, the title gets quickly updated to the correct title. Looking at <a href="http://developer.android.com/reference/android/support/v4/view/ViewPager.OnPageChangeListener.html#onPageScrollStateChanged%28int%29" rel="nofollow"><code>ViewPager.OnPageChangeListener</code></a> they say "Useful for discovering when the user begins dragging, when the pager is automatically settling to the current page" for <code>onPageScrollStateChanged(int)</code>, which seems to be what the issue is, but I haven't found a way to use the method to resolve the issue.</p>
  
  <p>I'm using Jake Wharton's <code>com.viewpagerindicator.TitlePageIndicator</code> with <code>android.support.v4.view.ViewPager</code> to render a view of calendar days. Swiping left/right moves to the previous/next calendar day. This means my <code>ViewPager</code> is set up to implement infinite pagination based on 3 <code>Fragments</code> that correspond to the visible day, the day before the visible day, and the day after the visible day.</p>
  
  <p>My <code>ViewPager.OnPageChangeListener</code> is constructed like this and attached to the <code>TitlePageIndicator</code></p>
  
  <pre><code>_title.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
          private int _focused_page = _VISIBLE;
          private boolean _is_settling = false;
  
          @Override
          public void onPageScrollStateChanged(int state) {
              if (state == ViewPager.SCROLL_STATE_IDLE) {
                  if (_focused_page == _PREVIOUS)
                      moveToPrevious();
                  else if (_focused_page == _NEXT)
                      moveToNext();
  
                  // always set to middle page to continue to be able to
                  // scroll left/right
                  if (_paginator.getCurrentItem() != _VISIBLE)
                      _paginator.setCurrentItem(_VISIBLE, false);
                  _is_settling = false;
              } else if (state == ViewPager.SCROLL_STATE_DRAGGING &amp;&amp; _is_settling) {
                  Ln.d("Double scrolled!");
                  _title.setCurrentItem(_paginator.getCurrentItem());
                  _title.invalidate();
              } else if (state == ViewPager.SCROLL_STATE_SETTLING) {
                  _is_settling = true;
              }
          }
  
          @Override
          public void onPageSelected(int position) {
              _focused_page = position;
          }
  });
  </code></pre>
  
  <p>I see there to be about 3 solutions</p>
  
  <ul>
  <li>Disable the sending or responding to user drag event while settling</li>
  <li>Notice when the drag occurs during a settling and recover the correct title after it becomes invalid</li>
  <li>Move the <code>ViewPager</code> with the second drag as if it were the first drag resulting in everything being 2 pages after (or before) the original visible day </li>
  </ul>
  
  <p><strong>EDIT:</strong>
  Is there a way to force the <code>TitlePageIndicator</code> to call <code>getPageTitle(int)</code> again to redraw the title with the correct title?</p>