當前位置: 首頁>>代碼示例>>Java>>正文


Java ViewPager.SCROLL_STATE_IDLE屬性代碼示例

本文整理匯總了Java中android.support.v4.view.ViewPager.SCROLL_STATE_IDLE屬性的典型用法代碼示例。如果您正苦於以下問題:Java ViewPager.SCROLL_STATE_IDLE屬性的具體用法?Java ViewPager.SCROLL_STATE_IDLE怎麽用?Java ViewPager.SCROLL_STATE_IDLE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.support.v4.view.ViewPager的用法示例。


在下文中一共展示了ViewPager.SCROLL_STATE_IDLE屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: playAnimation

private void playAnimation() {
    if (mViewPagerState == ViewPager.SCROLL_STATE_IDLE) {
        Observable.timer(500, TimeUnit.MILLISECONDS)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Consumer<Long>() {
                    @Override
                    public void accept(Long aLong) throws Exception {
                        if (mViewPagerState == ViewPager.SCROLL_STATE_IDLE) {
                            if (((float) mAnimator.getAnimatedValue()) == END_VALUE) {

                                startEnd2StartAnimation();
                            }
                        }
                    }
                });
    }
}
 
開發者ID:piyell,項目名稱:NeteaseCloudMusic,代碼行數:17,代碼來源:DiscPageChanger.java

示例2: onPageSelected

@Override
  public void onPageSelected(int position) {
      for (int i = 0; i < mTabViews.size(); i++) {
      	if(i == position){
      		((TextView)mTabViews.get(i)).setTextColor(mSelectedTabColor);
      	}else{
      		((TextView)mTabViews.get(i)).setTextColor(mTabViewDefaultColor);
      	}
}
      
      if (mScrollState == ViewPager.SCROLL_STATE_IDLE) {
          mCurrentPage = position;
          mPositionOffset = 0;
          invalidate();
          mFadeRunnable.run();
      }
      if (mListener != null) {
          mListener.onPageSelected(position);
      }
  }
 
開發者ID:SavorGit,項目名稱:Hotspot-master-devp,代碼行數:20,代碼來源:UnderlinePageIndicator.java

示例3: setCurrentItem

@Override
public void setCurrentItem(int item, boolean anim) {
    int count = fixedIndicatorView.getCount();
    if (count == 0) {
        return;
    }
    if (item < 0) {
        item = 0;
    } else if (item > count - 1) {
        item = count - 1;
    }
    unScrollPosition = -1;
    if (state == ViewPager.SCROLL_STATE_IDLE) {
        if (anim) {
            animateToTab(item);
        } else {
            final View tabView = fixedIndicatorView.getChildAt(item);
            final int scrollPos = tabView.getLeft() - (getWidth() - tabView.getWidth()) / 2;
            scrollTo(scrollPos, 0);
            unScrollPosition = item;
        }
    } else {

    }
    fixedIndicatorView.setCurrentItem(item, anim);
}
 
開發者ID:snowwolf10285,項目名稱:PicShow-zhaipin,代碼行數:26,代碼來源:ScrollIndicatorView.java

示例4: onPageScrollStateChanged

@Override
public void onPageScrollStateChanged(int state) {
    if (state == ViewPager.SCROLL_STATE_IDLE) {
        int current = mViewPager.getCurrentItem();
        int lastReal = mViewPager.getAdapter().getCount() - 2;
        if (current == 0) {
            mViewPager.setCurrentItem(lastReal, false);
        } else if (current == lastReal + 1) {
            mViewPager.setCurrentItem(1, false);
        }
    }
}
 
開發者ID:Jay-Ping,項目名稱:newIPlay,代碼行數:12,代碼來源:FlyBanner1.java

示例5: onPageScrollStateChanged

@Override
public void onPageScrollStateChanged(int state) {
  if (state == ViewPager.SCROLL_STATE_IDLE) {
    scrollToChild(pager.getCurrentItem(), 0);
  }

  if (delegatePageListener != null) {
    delegatePageListener.onPageScrollStateChanged(state);
  }
}
 
開發者ID:nordfalk,項目名稱:EsperantoRadio,代碼行數:10,代碼來源:PagerSlidingTabStrip.java

示例6: onPageScrollStateChanged

@Override
public void onPageScrollStateChanged(int state) {
	if (state == ViewPager.SCROLL_STATE_IDLE) {
		scrollToChild(pager.getCurrentItem(), 0);
	}

	if (delegatePageListener != null) {
		delegatePageListener.onPageScrollStateChanged(state);
	}
}
 
開發者ID:MobileDev418,項目名稱:AndroidBackendlessChat,代碼行數:10,代碼來源:PagerSlidingTabStrip.java

示例7: onPageSelected

@Override
public void onPageSelected(int position) {
    if (mScrollState == ViewPager.SCROLL_STATE_IDLE) {
        mCurrentPage = position;
        invalidate();
    }

    if (mListener != null) {
        mListener.onPageSelected(position);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:11,代碼來源:TitlePageIndicator.java

示例8: onPageScrollStateChanged

@Override
public void onPageScrollStateChanged(int state) {
    if (state == ViewPager.SCROLL_STATE_IDLE) {
        updateFolderHSVIndicator(folderStateManagers.get(pager.getCurrentItem()));
        updateSize();
    }
}
 
開發者ID:GlennioTech,項目名稱:MetadataEditor,代碼行數:7,代碼來源:FolderPickerDialogHelper.java

示例9: onPageSelected

@Override
public void onPageSelected(int position) {
    if (mScrollState == ViewPager.SCROLL_STATE_IDLE) {
        mTabStrip.onViewPagerPageChanged(position, 0f);
        scrollToTab(position, 0);
    }
    for (int i = 0; i < mTabStrip.getChildCount(); i++) {
        mTabStrip.getChildAt(i).setSelected(position == i);
    }
    if (mViewPagerPageChangeListener != null) {
        mViewPagerPageChangeListener.onPageSelected(position);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:13,代碼來源:SlidingTabLayout.java

示例10: callPageScrollStateChanged

public void callPageScrollStateChanged(int state, int viewPageItem) {
    if (state == ViewPager.SCROLL_STATE_IDLE) {
        if (viewPageItem != mCurrentPosition) {
            mCurrentPosition = viewPageItem;
            mCurrentPositionOffset = 0;
        }
        scrollToChild(viewPageItem, 0, false);
    }
}
 
開發者ID:rexyren,項目名稱:PageScrollView,代碼行數:9,代碼來源:PageScrollTab.java

示例11: onPageSelected

@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);
    }
}
 
開發者ID:fikyair,項目名稱:musicplayer,代碼行數:12,代碼來源:UnderlinePageIndicator.java

示例12: onPageScrollStateChanged

@Override
public void onPageScrollStateChanged(final int state) {
    if (state == ViewPager.SCROLL_STATE_IDLE) {//固定狀態
        mViewPagerState = state;
        playAnimation();
    } else {//正在滾動
        mViewPagerState = state;
        playAfterEndAnimation = false;
        if (((float) mAnimator.getAnimatedValue()) != END_VALUE) {
            startStart2EndAnimation();
        }
    }
}
 
開發者ID:piyell,項目名稱:NeteaseCloudMusic,代碼行數:13,代碼來源:DiscPageChanger.java

示例13: onPageSelected

@Override
public void onPageSelected(int position) {
    if (mSnap || mScrollState == ViewPager.SCROLL_STATE_IDLE) {
        mCurrentPage = position;
        mSnapPage = position;
        invalidate();
    }

    if (mListener != null) {
        mListener.onPageSelected(position);
    }
}
 
開發者ID:SavorGit,項目名稱:Hotspot-master-devp,代碼行數:12,代碼來源:CirclePageIndicator.java

示例14: onPageScrollStateChanged

@Override
public void onPageScrollStateChanged(int state) {
    if (state == ViewPager.SCROLL_STATE_IDLE) {
        isDragging = false;
    } else {
        isDragging = true;
    }
}
 
開發者ID:wzc25151,項目名稱:lrs_android,代碼行數:8,代碼來源:AutoScrollViewPager.java

示例15: onPageSelected

@Override
public void onPageSelected(int position) {
  if (scrollState == ViewPager.SCROLL_STATE_IDLE) {
    tabStrip.onViewPagerPageChanged(position, 0f);
    scrollToTab(position, 0);
  }

  for (int i = 0, size = tabStrip.getChildCount(); i < size; i++) {
    tabStrip.getChildAt(i).setSelected(position == i);
  }

  if (viewPagerPageChangeListener != null) {
    viewPagerPageChangeListener.onPageSelected(position);
  }
}
 
開發者ID:huashengzzz,項目名稱:SmartChart,代碼行數:15,代碼來源:SmartTabLayout.java


注:本文中的android.support.v4.view.ViewPager.SCROLL_STATE_IDLE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。