parent
dee951d85d
commit
ce1eb70c86
|
|
@ -30,8 +30,8 @@ public class SwipeLayout extends FrameLayout {
|
|||
private DragEdge mDragEdge;
|
||||
private ShowMode mShowMode;
|
||||
|
||||
private float horizontalSwipeOffset;
|
||||
private float verticalSwipeOffset;
|
||||
private float mHorizontalSwipeOffset;
|
||||
private float mVerticalSwipeOffset;
|
||||
|
||||
private List<SwipeListener> mSwipeListeners = new ArrayList<SwipeListener>();
|
||||
private List<SwipeDenier> mSwipeDeniers = new ArrayList<SwipeDenier>();
|
||||
|
|
@ -68,8 +68,8 @@ public class SwipeLayout extends FrameLayout {
|
|||
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SwipeLayout);
|
||||
int ordinal = a.getInt(R.styleable.SwipeLayout_drag_edge, DragEdge.Right.ordinal());
|
||||
horizontalSwipeOffset =a.getDimension(R.styleable.SwipeLayout_horizontalSwipeOffset,0);
|
||||
verticalSwipeOffset =a.getDimension(R.styleable.SwipeLayout_verticalSwipeOffset,0);
|
||||
mHorizontalSwipeOffset =a.getDimension(R.styleable.SwipeLayout_horizontalSwipeOffset,0);
|
||||
mVerticalSwipeOffset =a.getDimension(R.styleable.SwipeLayout_verticalSwipeOffset,0);
|
||||
mDragEdge = DragEdge.values()[ordinal];
|
||||
ordinal = a.getInt(R.styleable.SwipeLayout_show_mode, ShowMode.PullOut.ordinal());
|
||||
mShowMode = ShowMode.values()[ordinal];
|
||||
|
|
@ -662,9 +662,9 @@ public class SwipeLayout extends FrameLayout {
|
|||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
|
||||
if(mDragEdge == DragEdge.Left || mDragEdge == DragEdge.Right)
|
||||
mDragDistance = getBottomView().getMeasuredWidth()-dp2px(horizontalSwipeOffset);
|
||||
mDragDistance = getBottomView().getMeasuredWidth()-dp2px(mHorizontalSwipeOffset);
|
||||
else
|
||||
mDragDistance = getBottomView().getMeasuredHeight()-dp2px(verticalSwipeOffset);
|
||||
mDragDistance = getBottomView().getMeasuredHeight()-dp2px(mVerticalSwipeOffset);
|
||||
}
|
||||
|
||||
private boolean mTouchConsumedByChild = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue