public class FastScrollRecyclerView
extends RecyclerView
| Modifier and Type | Class and Description |
|---|---|
static interface |
FastScrollRecyclerView.MeasurableAdapter<VH extends ViewHolder>
FastScrollRecyclerView by default assumes that all items in a RecyclerView will have
ItemViews with the same heights so that the total height of all views in the RecyclerView
can be calculated.
|
static class |
FastScrollRecyclerView.ScrollPositionState
The current scroll state of the recycler view.
|
static interface |
FastScrollRecyclerView.SectionedAdapter |
| Constructor and Description |
|---|
FastScrollRecyclerView(android.content.Context context) |
FastScrollRecyclerView(android.content.Context context,
android.util.AttributeSet attrs) |
FastScrollRecyclerView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr) |
| Modifier and Type | Method and Description |
|---|---|
void |
allowThumbInactiveColor(boolean allowInactiveColor) |
void |
draw(android.graphics.Canvas c) |
protected int |
getAvailableScrollBarHeight()
Returns the available scroll bar height:
AvailableScrollBarHeight = Total height of the visible view - thumb height
|
protected int |
getAvailableScrollHeight(int adapterHeight,
int yOffset)
Returns the available scroll height:
AvailableScrollHeight = Total height of the all items - last page height
|
int |
getScrollBarThumbHeight() |
int |
getScrollBarWidth() |
protected boolean |
isLayoutManagerReversed() |
protected void |
onFinishInflate() |
boolean |
onInterceptTouchEvent(RecyclerView rv,
android.view.MotionEvent ev)
We intercept the touch handling only to support fast scrolling when initiated from the
scroll bar.
|
void |
onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) |
void |
onTouchEvent(RecyclerView rv,
android.view.MotionEvent ev) |
void |
onUpdateScrollbar()
Updates the bounds for the scrollbar.
|
java.lang.String |
scrollToPositionAtProgress(float touchFraction)
Maps the touch (from 0..1) to the adapter position that should be visible.
|
void |
setAdapter(Adapter adapter) |
void |
setAutoHideDelay(int hideDelay) |
void |
setAutoHideEnabled(boolean autoHideEnabled) |
void |
setFastScrollEnabled(boolean fastScrollEnabled) |
void |
setOnFastScrollStateChangeListener(OnFastScrollStateChangeListener stateChangeListener) |
void |
setPopupBgColor(int color) |
void |
setPopupPosition(int popupPosition)
Set the FastScroll Popup position.
|
void |
setPopupTextColor(int color) |
void |
setPopupTextSize(int textSize) |
void |
setPopUpTypeface(android.graphics.Typeface typeface) |
void |
setStateChangeListener(OnFastScrollStateChangeListener stateChangeListener)
Deprecated.
|
void |
setThumbColor(int color) |
void |
setThumbEnabled(boolean thumbEnabled)
Deprecated.
|
void |
setThumbInactiveColor(boolean allowInactiveColor)
Deprecated.
|
void |
setThumbInactiveColor(int color) |
void |
setTrackColor(int color) |
void |
showScrollbar() |
protected void |
updateThumbPosition(FastScrollRecyclerView.ScrollPositionState scrollPosState,
int rowCount)
Updates the scrollbar thumb offset to match the visible scroll of the recycler view.
|
public FastScrollRecyclerView(android.content.Context context)
public FastScrollRecyclerView(android.content.Context context,
android.util.AttributeSet attrs)
public FastScrollRecyclerView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr)
public int getScrollBarWidth()
public int getScrollBarThumbHeight()
protected void onFinishInflate()
public void setAdapter(Adapter adapter)
public boolean onInterceptTouchEvent(RecyclerView rv,
android.view.MotionEvent ev)
public void onTouchEvent(RecyclerView rv,
android.view.MotionEvent ev)
public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept)
protected int getAvailableScrollHeight(int adapterHeight,
int yOffset)
yOffset - the offset from the top of the recycler view to start tracking.protected int getAvailableScrollBarHeight()
public void draw(android.graphics.Canvas c)
protected void updateThumbPosition(FastScrollRecyclerView.ScrollPositionState scrollPosState, int rowCount)
scrollPosState - the current scroll positionrowCount - the number of rows, used to calculate the total scroll height (assumes thatpublic java.lang.String scrollToPositionAtProgress(float touchFraction)
public void onUpdateScrollbar()
protected boolean isLayoutManagerReversed()
public void showScrollbar()
public void setThumbColor(int color)
public void setTrackColor(int color)
public void setPopupBgColor(int color)
public void setPopupTextColor(int color)
public void setPopupTextSize(int textSize)
public void setPopUpTypeface(android.graphics.Typeface typeface)
public void setAutoHideDelay(int hideDelay)
public void setAutoHideEnabled(boolean autoHideEnabled)
public void setOnFastScrollStateChangeListener(OnFastScrollStateChangeListener stateChangeListener)
@Deprecated public void setStateChangeListener(OnFastScrollStateChangeListener stateChangeListener)
public void setThumbInactiveColor(int color)
public void allowThumbInactiveColor(boolean allowInactiveColor)
@Deprecated public void setThumbInactiveColor(boolean allowInactiveColor)
public void setFastScrollEnabled(boolean fastScrollEnabled)
@Deprecated public void setThumbEnabled(boolean thumbEnabled)
public void setPopupPosition(int popupPosition)
FastScroller.PopupPosition.ADJACENT,
meaning the popup moves adjacent to the FastScroll thumb, or FastScroller.PopupPosition.CENTER,
meaning the popup is static and centered within the RecyclerView.