本文整理匯總了Java中android.support.v4.view.ViewPager.SCROLL_STATE_SETTLING屬性的典型用法代碼示例。如果您正苦於以下問題:Java ViewPager.SCROLL_STATE_SETTLING屬性的具體用法?Java ViewPager.SCROLL_STATE_SETTLING怎麽用?Java ViewPager.SCROLL_STATE_SETTLING使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.support.v4.view.ViewPager
的用法示例。
在下文中一共展示了ViewPager.SCROLL_STATE_SETTLING屬性的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onPageScrollStateChanged
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
public void onPageScrollStateChanged(int state) {
switch (state) {
case ViewPager.SCROLL_STATE_IDLE: {
invalidateOptionsMenu();
mCurrentPosition = mNextPosition;
break;
}
case ViewPager.SCROLL_STATE_DRAGGING:
case ViewPager.SCROLL_STATE_SETTLING:
default:
break;
}
}
示例2: onPageScrollStateChanged
@Override
public void onPageScrollStateChanged(int state) {
switch (state) {
case ViewPager.SCROLL_STATE_IDLE: {
if (mCurrentPosition >= 0) {
sendFragmentVisibilityChange(mCurrentPosition, false);
}
if (mNextPosition >= 0) {
sendFragmentVisibilityChange(mNextPosition, true);
}
supportInvalidateOptionsMenu();
mCurrentPosition = mNextPosition;
break;
}
case ViewPager.SCROLL_STATE_DRAGGING:
clearDetails();
hasClearedDetails = true;
break;
case ViewPager.SCROLL_STATE_SETTLING:
hasClearedDetails = false;
break;
default:
break;
}
}
示例3: onPageScrollStateChanged
@Override
public void onPageScrollStateChanged(int state) {
/**
* @[email protected]
*
* add scrollstart & scrollend event
*
*/
switch (state) {
case ViewPager.SCROLL_STATE_IDLE:
lastPositionOffset = 99f;
target.fireEvent("scrollend");
break;
case ViewPager.SCROLL_STATE_DRAGGING:
target.fireEvent("scrollstart");
break;
case ViewPager.SCROLL_STATE_SETTLING:
break;
}
}
示例4: onPageScrolled
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
if (currentPagerState != ViewPager.SCROLL_STATE_SETTLING) {
if (positionOffset >= 0.5) {
onPageSelected(position + 1);
} else if (positionOffset <= -0.5) {
onPageSelected(position - 1);
} else {
onPageSelected(position);
}
}
}
示例5: onPageScrollStateChanged
/**
* viewpager狀態監聽
* @param state
*/
@Override
public void onPageScrollStateChanged(int state) {
if (state == ViewPager.SCROLL_STATE_IDLE) { // 0 空閑狀態 pager處於空閑狀態
scrollToChild(viewPager.getCurrentItem(), 0);
}else if(state == ViewPager.SCROLL_STATE_SETTLING){ // 2 正在自動沉降,相當於鬆手後,pager恢複到一個完整pager的過程
}else if(state == ViewPager.SCROLL_STATE_DRAGGING){ // 1 viewpager正在被滑動,處於正在拖拽中
}
}
示例6: onPageScrollStateChanged
@Override
public void onPageScrollStateChanged(int state) {
if (this.state == ViewPager.SCROLL_STATE_SETTLING && state == ViewPager.SCROLL_STATE_IDLE) {
ExposureManager.getInstance().triggerViewCalculate(TrackerInternalConstants.TRIGGER_VIEW_CHANGED, mRootLayout, mCommonInfo, mRootLayout.getLastVisibleViewMap());
}
this.state = state;
}
示例7: onPageScrollStateChanged
@Override
public void onPageScrollStateChanged(int state) {
//ViewPager.SCROLL_STATE_IDLE 空閑狀態 0;CustormViewPager.SCROLL_STATE_DRAGGING 正在滑動 1
//ViewPager.SCROLL_STATE_SETTLING 滑動完畢 2;頁麵開始滑動時,狀態變化(1,2,0)
if (state == ViewPager.SCROLL_STATE_DRAGGING) {
isScrolling = true;
} else {
isScrolling = false;
}
if (state == ViewPager.SCROLL_STATE_SETTLING) {
// Log.i("CustormViewPager", "----------------right =>" + right + "; left =>" + left + "----------------------------");
right = left = false;
// lastValue = -1;
}
}
示例8: onPageScrollStateChanged
@Override
public void onPageScrollStateChanged(int state) {
switch (state) {
case ViewPager.SCROLL_STATE_IDLE:
setData();
break;
case ViewPager.SCROLL_STATE_DRAGGING:
break;
case ViewPager.SCROLL_STATE_SETTLING:
break;
}
}
示例9: onPageSelected
@Override
public void onPageSelected(int position) {
if (state != ViewPager.SCROLL_STATE_SETTLING) {
ExposureManager.getInstance().triggerViewCalculate(TrackerInternalConstants.TRIGGER_VIEW_CHANGED, mRootLayout, mCommonInfo, mRootLayout.getLastVisibleViewMap());
}
}