public class ObservableRecyclerView extends RecyclerView implements Scrollable
| コンストラクタと説明 |
|---|
ObservableRecyclerView(android.content.Context context) |
ObservableRecyclerView(android.content.Context context,
android.util.AttributeSet attrs) |
ObservableRecyclerView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle) |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
int |
getChildAdapterPosition(android.view.View child) |
int |
getCurrentScrollY()
Returns the current Y of the scrollable view.
|
boolean |
onInterceptTouchEvent(android.view.MotionEvent ev) |
void |
onRestoreInstanceState(android.os.Parcelable state) |
android.os.Parcelable |
onSaveInstanceState() |
protected void |
onScrollChanged(int l,
int t,
int oldl,
int oldt) |
boolean |
onTouchEvent(android.view.MotionEvent ev) |
void |
scrollVerticallyTo(int y)
Scrolls vertically to the absolute Y.
|
void |
scrollVerticallyToPosition(int position)
Same as #scrollToPosition(int) but it scrolls to the position not only make
the position visible.
|
void |
setScrollViewCallbacks(ObservableScrollViewCallbacks listener)
Sets a callback listener.
|
void |
setTouchInterceptionViewGroup(android.view.ViewGroup viewGroup)
Sets a touch motion event delegation ViewGroup.
|
public ObservableRecyclerView(android.content.Context context)
public ObservableRecyclerView(android.content.Context context,
android.util.AttributeSet attrs)
public ObservableRecyclerView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
public void onRestoreInstanceState(android.os.Parcelable state)
public android.os.Parcelable onSaveInstanceState()
protected void onScrollChanged(int l,
int t,
int oldl,
int oldt)
public boolean onInterceptTouchEvent(android.view.MotionEvent ev)
public boolean onTouchEvent(android.view.MotionEvent ev)
public void setScrollViewCallbacks(ObservableScrollViewCallbacks listener)
ScrollablesetScrollViewCallbacks インタフェース内 Scrollablelistener - listener to setpublic void setTouchInterceptionViewGroup(android.view.ViewGroup viewGroup)
ScrollablesetTouchInterceptionViewGroup インタフェース内 ScrollableviewGroup - ViewGroup object to dispatch motion eventspublic void scrollVerticallyTo(int y)
ScrollablescrollVerticallyTo インタフェース内 Scrollabley - vertical position to scroll topublic void scrollVerticallyToPosition(int position)
Same as #scrollToPosition(int) but it scrolls to the position not only make the position visible.
It depends on LayoutManager how #scrollToPosition(int) works,
and currently we know that LinearLayoutManager#scrollToPosition(int) just
make the position visible.
In LinearLayoutManager, scrollToPositionWithOffset() is provided for scrolling to the position. This method checks which LayoutManager is set, and handles which method should be called for scrolling.
Other know classes (StaggeredGridLayoutManager and GridLayoutManager) are not tested.
position - position to scrollpublic int getCurrentScrollY()
ScrollablegetCurrentScrollY インタフェース内 Scrollablepublic int getChildAdapterPosition(android.view.View child)