本文整理匯總了Java中android.support.v4.view.ViewPager.removeOnPageChangeListener方法的典型用法代碼示例。如果您正苦於以下問題:Java ViewPager.removeOnPageChangeListener方法的具體用法?Java ViewPager.removeOnPageChangeListener怎麽用?Java ViewPager.removeOnPageChangeListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v4.view.ViewPager
的用法示例。
在下文中一共展示了ViewPager.removeOnPageChangeListener方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setViewPager
import android.support.v4.view.ViewPager; //導入方法依賴的package包/類
/**
* Set the {@link ViewPager} associated with this widget indicator.
*
* @param pager {@link ViewPager} to attach
* @param stepCount The real page count to display (use this if you are using looped viewpager to indicate the real number
* of pages)
*/
public void setViewPager(ViewPager pager, int stepCount) {
if (this.pager == pager) {
return;
}
if (this.pager != null) {
pager.removeOnPageChangeListener(this);
}
if (pager.getAdapter() == null) {
throw new IllegalStateException("ViewPager does not have adapter instance.");
}
this.pager = pager;
this.stepCount = stepCount;
currentStep = 0;
pager.addOnPageChangeListener(this);
if(showLabels && labels == null) {
setLabelsUsingPageTitles();
}
invalidate();
}
示例2: setupWithViewPager
import android.support.v4.view.ViewPager; //導入方法依賴的package包/類
@Override
public void setupWithViewPager(@Nullable final ViewPager viewPager, boolean autoRefresh) {
super.setupWithViewPager(viewPager, autoRefresh);
//TODO
if (viewPager != null) {
if (viewPager != this.viewPager) {
viewPager.removeOnPageChangeListener(this);
viewPager.addOnPageChangeListener(this);
}
}
}
示例3: detachFrom
import android.support.v4.view.ViewPager; //導入方法依賴的package包/類
public void detachFrom(ViewPager viewPager) {
viewPager.removeOnPageChangeListener(spritzOnPageChangeListener);
}
示例4: setupWithViewPager
import android.support.v4.view.ViewPager; //導入方法依賴的package包/類
public void setupWithViewPager(ViewPager pager) {
mItemCount = pager.getAdapter().getCount();
pager.removeOnPageChangeListener(onPageChangeListener);
pager.addOnPageChangeListener(onPageChangeListener);
requestLayout();
}