public class SwipeMenuRecyclerView extends XRecyclerView
描述:自定义具有侧滑功能的Recyclerview侧滑菜单view
作者: zhouyou| 限定符和类型 | 类和说明 |
|---|---|
static interface |
SwipeMenuRecyclerView.OnSwipeListener |
XRecyclerView.LoadingListener, XRecyclerView.Sections, XRecyclerView.WrapAdapter| 限定符和类型 | 字段和说明 |
|---|---|
static int |
DIRECTION_LEFT |
static int |
DIRECTION_RIGHT |
protected float |
dx |
protected float |
dy |
protected android.view.animation.Interpolator |
mCloseInterpolator |
protected int |
mDirection |
protected float |
mDownX |
protected float |
mDownY |
protected RecyclerView.LayoutManager |
mLlm |
protected SwipeMenuRecyclerView.OnSwipeListener |
mOnSwipeListener |
protected android.view.animation.Interpolator |
mOpenInterpolator |
protected int |
mTouchPosition |
protected int |
mTouchState |
protected SwipeMenuLayout |
mTouchView |
protected android.view.ViewConfiguration |
mViewConfiguration |
protected long |
startClickTime |
static int |
TOUCH_STATE_NONE |
static int |
TOUCH_STATE_X |
static int |
TOUCH_STATE_Y |
FOOTER_INIT_INDEX, HEADER_INIT_INDEX, TYPE_LOADMORE_FOOTER, TYPE_REFRESH_HEADER| 构造器和说明 |
|---|
SwipeMenuRecyclerView(android.content.Context context) |
SwipeMenuRecyclerView(android.content.Context context,
android.util.AttributeSet attrs) |
SwipeMenuRecyclerView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle) |
| 限定符和类型 | 方法和说明 |
|---|---|
android.view.animation.Interpolator |
getCloseInterpolator() |
android.view.animation.Interpolator |
getOpenInterpolator() |
SwipeMenuLayout |
getTouchView()
get current touched view
|
protected void |
init() |
boolean |
onInterceptTouchEvent(android.view.MotionEvent ev) |
void |
setCloseInterpolator(android.view.animation.Interpolator interpolator) |
void |
setLayoutManager(RecyclerView.LayoutManager layout) |
void |
setOnSwipeListener(SwipeMenuRecyclerView.OnSwipeListener onSwipeListener) |
void |
setOpenInterpolator(android.view.animation.Interpolator interpolator) |
void |
setSwipeDirection(int direction)
set the swipe direction
|
void |
smoothCloseMenu()
close the opened menu manually
|
void |
smoothOpenMenu(int position)
open menu manually
|
addFooterView, addHeaderView, getAdapter, getEmptyView, getFootersCount, getHeadersCount, getItemCount, getRefreshHeader, isHeaderFooter, isLoadingMore, isLoadingMoreEnabled, isPullRefreshEnabled, isRefresh, isRefreshing, loadMoreComplete, onAttachedToWindow, onScrollStateChanged, onTouchEvent, refresh, refreshComplete, removeFooterView, removeHeaderView, reset, setAdapter, setArrowImageView, setEmptyView, setEnabledScroll, setFootViewText, setListener, setLoadingListener, setLoadingMoreEnabled, setLoadingMoreFooter, setLoadingMoreProgressStyle, setNoMore, setPullRefreshEnabled, setRefreshHeader, setRefreshing, setRefreshProgressStylepublic static final int TOUCH_STATE_NONE
public static final int TOUCH_STATE_X
public static final int TOUCH_STATE_Y
public static final int DIRECTION_LEFT
public static final int DIRECTION_RIGHT
protected int mDirection
protected float mDownX
protected float mDownY
protected int mTouchState
protected int mTouchPosition
protected SwipeMenuLayout mTouchView
protected SwipeMenuRecyclerView.OnSwipeListener mOnSwipeListener
protected android.view.animation.Interpolator mCloseInterpolator
protected android.view.animation.Interpolator mOpenInterpolator
protected RecyclerView.LayoutManager mLlm
protected android.view.ViewConfiguration mViewConfiguration
protected long startClickTime
protected float dx
protected float dy
public SwipeMenuRecyclerView(android.content.Context context)
public SwipeMenuRecyclerView(android.content.Context context,
android.util.AttributeSet attrs)
public SwipeMenuRecyclerView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
protected void init()
public void setCloseInterpolator(android.view.animation.Interpolator interpolator)
public void setOpenInterpolator(android.view.animation.Interpolator interpolator)
public android.view.animation.Interpolator getOpenInterpolator()
public android.view.animation.Interpolator getCloseInterpolator()
public boolean onInterceptTouchEvent(android.view.MotionEvent ev)
public void smoothOpenMenu(int position)
position - the adapter positionpublic void smoothCloseMenu()
public void setOnSwipeListener(SwipeMenuRecyclerView.OnSwipeListener onSwipeListener)
public SwipeMenuLayout getTouchView()
public void setSwipeDirection(int direction)
direction - swipe direction (left or right)public void setLayoutManager(RecyclerView.LayoutManager layout)
setLayoutManager 在类中 XRecyclerView