当前位置: 首页>>代码示例>>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;未经允许,请勿转载。