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


Java ViewDragHelper.EDGE_LEFT屬性代碼示例

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


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

示例1: onEdgeDragStarted

@Override
public void onEdgeDragStarted(int edgeFlags, int pointerId) {
  final View toCapture;
  if ((edgeFlags & ViewDragHelper.EDGE_LEFT) == ViewDragHelper.EDGE_LEFT) {
    toCapture = findDrawerWithGravity(Gravity.LEFT);
  } else {
    toCapture = findDrawerWithGravity(Gravity.RIGHT);
  }

  if (toCapture != null && getDrawerLockMode(toCapture) == LOCK_MODE_UNLOCKED) {
    mDragger.captureChildView(toCapture, pointerId);
  }
}
 
開發者ID:rogues-dev,項目名稱:superglue,代碼行數:13,代碼來源:DebugDrawerLayout.java

示例2: onEdgeLock

@Override
public boolean onEdgeLock(int edgeFlags) {
    Log.i(TAG, "onEdgeLock: " + edgeFlags);
    return (edgeFlags&ViewDragHelper.EDGE_LEFT)==ViewDragHelper.EDGE_LEFT;
}
 
開發者ID:halohoop,項目名稱:AndroidDigIn,代碼行數:5,代碼來源:DragViewGroup.java

示例3: onViewReleased

@Override
public void onViewReleased(View releasedChild, float xvel, float yvel) {
    super.onViewReleased(releasedChild, xvel, yvel);
    if (mCurEdgeFlag == ViewDragHelper.EDGE_LEFT) {

        if (mCurrentX > getWidth() / 2) {
            mViewDragHelper.settleCapturedViewAt(getWidth(), 0);
        } else {
            mViewDragHelper.settleCapturedViewAt(0, 0);
            mCurrentX = 0;
        }
        invalidate();
    }

}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:15,代碼來源:SwipeBackLayout.java

示例4: onViewPositionChanged

@Override
public void onViewPositionChanged(View changedView, int left, int top, int dx, int dy) {
    super.onViewPositionChanged(changedView, left, top, dx, dy);
    if (mCurEdgeFlag == ViewDragHelper.EDGE_LEFT) {
        if (mOnScrollListener != null)
            mOnScrollListener.complete((float) (Math.abs(left) * 1.00 / getWidth()));
        if (left >= getWidth()) finish();
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:9,代碼來源:SwipeBackLayout.java

示例5: onEdgeDragStarted

@Override
public void onEdgeDragStarted(int edgeFlags, int pointerId) {
    mIsEdgeDrag = true;

    if (tryCaptureView(mContentView, pointerId) && edgeFlags == ViewDragHelper.EDGE_LEFT) {
        mViewDragHelper.captureChildView(mContentView, pointerId);
    }
}
 
開發者ID:PSD-Company,項目名稱:duo-navigation-drawer,代碼行數:8,代碼來源:DuoDrawerLayout.java


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