本文整理匯總了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);
}
}
示例2: onEdgeLock
@Override
public boolean onEdgeLock(int edgeFlags) {
Log.i(TAG, "onEdgeLock: " + edgeFlags);
return (edgeFlags&ViewDragHelper.EDGE_LEFT)==ViewDragHelper.EDGE_LEFT;
}
示例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();
}
}
示例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();
}
}
示例5: onEdgeDragStarted
@Override
public void onEdgeDragStarted(int edgeFlags, int pointerId) {
mIsEdgeDrag = true;
if (tryCaptureView(mContentView, pointerId) && edgeFlags == ViewDragHelper.EDGE_LEFT) {
mViewDragHelper.captureChildView(mContentView, pointerId);
}
}