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


Java ViewPager.SCROLL_STATE_DRAGGING屬性代碼示例

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


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

示例1: run

@Override
public void run() {
    int now = (int) System.currentTimeMillis();
    int timediff = mAutoRollingTime;
    if(mReleasingTime != 0){
        timediff = now - mReleasingTime;
    }

    if(mViewPagerScrollState == ViewPager.SCROLL_STATE_IDLE){
        //if user's finger just left the screen,we should wait for a while.
        if(timediff >= mAutoRollingTime * 0.8){
            mHandler.sendEmptyMessage(MESSAGE_AUTO_ROLLING);
        }else {
            mHandler.sendEmptyMessage(MESSAGE_AUTO_ROLLING_CANCEL);
        }
    }else if(mViewPagerScrollState == ViewPager.SCROLL_STATE_DRAGGING){
        mHandler.sendEmptyMessage(MESSAGE_AUTO_ROLLING_CANCEL);
    }

}
 
開發者ID:popo1379,項目名稱:popomusic,代碼行數:20,代碼來源:BannerViewPager.java

示例2: 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;
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:16,代碼來源:Codecs.java

示例3: 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;
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:26,代碼來源:SipHome.java

示例4: onPageScrolled

@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
    mCurrentPage = position;
    mPositionOffset = positionOffset;
    if (mFades) {
        if (positionOffsetPixels > 0) {
            removeCallbacks(mFadeRunnable);
            mPaint.setAlpha(0xFF);
        } else if (mScrollState != ViewPager.SCROLL_STATE_DRAGGING) {
            postDelayed(mFadeRunnable, mFadeDelay);
        }
    }
    invalidate();

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

示例5: 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;

  }
}
 
開發者ID:weexext,項目名稱:ucar-weex-core,代碼行數:22,代碼來源:WXSlider.java

示例6: onPageScrollStateChanged

@Override
public void onPageScrollStateChanged(int state) {
    if (originList == null) {
        return;
    }
    currentPosition = viewPager.getCurrentItem();
    if (state == ViewPager.SCROLL_STATE_IDLE || state == ViewPager.SCROLL_STATE_DRAGGING) {
        if (currentPosition == 0) {
            currentPosition = originList.size();
            viewPager.setCurrentItem(currentPosition, false);
        }else if (currentPosition == originList.size() + 1) {
            currentPosition = 1;
            viewPager.setCurrentItem(currentPosition, false);
        }

    }
}
 
開發者ID:BittleDragon,項目名稱:ImageLooper,代碼行數:17,代碼來源:ImageLooper.java

示例7: canSwipeRefreshChildScrollUp

@Override
public boolean canSwipeRefreshChildScrollUp() {
    if (mWideMode) {
        return ViewCompat.canScrollVertically(mScrollViewWide, -1);
    }

    // Prevent the swipe refresh by returning true here
    if (mViewPagerScrollState == ViewPager.SCROLL_STATE_DRAGGING) {
        return true;
    }

    for (MyScheduleFragment fragment : mMyScheduleFragments) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
            if (!fragment.getUserVisibleHint()) {
                continue;
            }
        }

        return ViewCompat.canScrollVertically(fragment.getListView(), -1);
    }

    return false;
}
 
開發者ID:dreaminglion,項目名稱:iosched-reader,代碼行數:23,代碼來源:MyScheduleActivity.java

示例8: onPageScrolled

@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
  if (App.fejlsøgning) Log.d("onPageScrolled( " + position + " " + positionOffset + " " + positionOffsetPixels);
  // Hvis vi er på 0'te side og der trækkes mod højre kan viewpageren ikke komme længere og offsetPixels vil være 0,
  if (position == 0 && positionOffsetPixels == 0 && viewPagerScrollState == ViewPager.SCROLL_STATE_DRAGGING) {
    venstremenuFrag.visMenu();
  }
}
 
開發者ID:nordfalk,項目名稱:EsperantoRadio,代碼行數:8,代碼來源:Kanaler_frag.java

示例9: onPageScrollStateChanged

@Override
public void onPageScrollStateChanged(int state) {
    if (state == ViewPager.SCROLL_STATE_DRAGGING)
        mScrollState = ViewPager.SCROLL_STATE_DRAGGING;
    else if (state == ViewPager.SCROLL_STATE_IDLE)
        mScrollState = ViewPager.SCROLL_STATE_IDLE;
}
 
開發者ID:shenhuanet,項目名稱:OpenEyesReading-android,代碼行數:7,代碼來源:BottomTabView.java

示例10: onPageScrollStateChanged

@Override
public void onPageScrollStateChanged(int state) {
    if(state == ViewPager.SCROLL_STATE_DRAGGING){
        mViewPagerScrollState = ViewPager.SCROLL_STATE_DRAGGING;
    }else if(state == ViewPager.SCROLL_STATE_IDLE){
        mReleasingTime = (int) System.currentTimeMillis();
        mViewPagerScrollState = ViewPager.SCROLL_STATE_IDLE;
        // when scroll stops, change the viewpager to make circle
        mViewPager.setCurrentItem(mCurrentPosition, false);
    }

}
 
開發者ID:yuhodev,項目名稱:login,代碼行數:12,代碼來源:BannerViewPager.java

示例11: 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;
            }
        }
 
開發者ID:DyncKathline,項目名稱:LiveGiftLayout,代碼行數:15,代碼來源:GiftPanelControl.java

示例12: 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;
    }
}
 
開發者ID:kamisakihideyoshi,項目名稱:TaipeiTechRefined,代碼行數:12,代碼來源:CalendarFragment.java

示例13: scrollTo

@Override
public void scrollTo(int x, int y) {
  if(scrollable || mState != ViewPager.SCROLL_STATE_DRAGGING) {
    super.scrollTo(x, y);
  }
}
 
開發者ID:erguotou520,項目名稱:weex-uikit,代碼行數:6,代碼來源:WXCircleViewPager.java


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