本文整理汇总了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);
}
}