@Override
 public void onPageSelected(int arg0) {
   setCurrentItem(arg0);
   if (mListener != null) {
     mListener.onPageSelected(arg0);
   }
 }
  @Result(FlickrApi.LOAD_IMAGES_EVENT)
  private void onPhotosLoaded(List<Photo> photos, boolean hasMore) {
    mPhotoCount = photos.size();
    mGridAdapter.setPhotos(photos, hasMore);
    mPagerAdapter.setPhotos(photos);
    mGridAdapter.onNextItemsLoaded();

    // Ensure listener called for 0 position
    mPagerListener.onPageSelected(mViews.pager.getCurrentItem());

    // Restoring saved state
    if (mPagerPhotoPosition != -1) {
      if (mPagerPhotoPosition < mPhotoCount) {
        mPagerAdapter.setActivated(true);
        mAnimator.enter(mPagerPhotoPosition, false);
      }
      mPagerPhotoPosition = -1;
    }

    if (mGridPosition != -1) {
      if (mGridPosition < mPhotoCount) {
        ((GridLayoutManager) mViews.grid.getLayoutManager())
            .scrollToPositionWithOffset(mGridPosition, mGridPositionFromTop);
      }
      mGridPosition = -1;
      mGridPositionFromTop = 0;
    }
  }
Esempio n. 3
0
  @Override
  public void onClick(android.view.View v) {
    int position = (Integer) v.getTag();
    if (position == mSelectedPosition && mListener != null) mListener.onPageSelected(position);

    mViewPager.setCurrentItem(position, true);
  }
 @Override
 public void onPageSelected(int position) {
   mCurrentPagePosition = position;
   replaceTitle(getTitle());
   if (mUserOnPageChangeListener != null) {
     mUserOnPageChangeListener.onPageSelected(position);
   }
 }
Esempio n. 5
0
  @Override
  public void onPageSelected(int position) {
    mCurrentPage = position;
    invalidate();

    if (mListener != null) {
      mListener.onPageSelected(position);
    }
  }
  public void onPageSelected(int position) {
    if (mScrollState == ViewPager.SCROLL_STATE_IDLE) {
      mCurrentPage = position;
      invalidate();
    }

    if (mListener != null) {
      mListener.onPageSelected(position);
    }
  }
 public void onPageSelected(int paramInt) {
   if ((n) || (k == 0)) {
     h = paramInt;
     i = paramInt;
     invalidate();
   }
   if (g != null) {
     g.onPageSelected(paramInt);
   }
 }
  @Override
  public void onPageSelected(int position) {
    Log.d("xx", "page select : " + position);
    if (mScrollState == ViewPager.SCROLL_STATE_IDLE) {
      mCurrentPage = position;
      invalidate();
    }

    if (mListener != null) {
      mListener.onPageSelected(position);
    }
  }
Esempio n. 9
0
 @Override
 public void onPageSelected(int position) {
   if (mScrollState == ViewPager.SCROLL_STATE_IDLE) {
     mCurrentPage = position;
     mPositionOffset = 0;
     invalidate();
     mFadeRunnable.run();
   }
   if (mListener != null) {
     mListener.onPageSelected(position);
   }
 }
Esempio n. 10
0
  public void onPageSelected(int position) {

    //
    // get current item position
    //
    int old_position = m_tab_indicator.getCurrentItem();

    //
    // notify on change
    //
    Fragment fragment = m_fragments.get(old_position);
    if (fragment instanceof ViewPager.OnPageChangeListener) {
      ViewPager.OnPageChangeListener listener = (ViewPager.OnPageChangeListener) fragment;
      listener.onPageSelected(position);
    }

    Fragment new_fragment = m_fragments.get(position);
    if (new_fragment instanceof ViewPager.OnPageChangeListener) {
      ViewPager.OnPageChangeListener listener = (ViewPager.OnPageChangeListener) new_fragment;
      listener.onPageSelected(position);
    }

    Logger.i("onPageSelected new_position: " + position + " old position: " + old_position);
  }
Esempio n. 11
0
 @Override
 public void onPageSelected(int position) {
   setCurrentItem(position);
   if (mListener != null) mListener.onPageSelected(position);
 }