Merge "Only bind fast scrollbar when attached if not already bound." into tm-qpr-dev
This commit is contained in:
@@ -57,7 +57,9 @@ public abstract class FastScrollRecyclerView extends RecyclerView {
|
||||
@Override
|
||||
protected void onAttachedToWindow() {
|
||||
super.onAttachedToWindow();
|
||||
bindFastScrollbar();
|
||||
if (mScrollbar == null || !mScrollbar.hasRecyclerView()) {
|
||||
bindFastScrollbar();
|
||||
}
|
||||
}
|
||||
|
||||
public void bindFastScrollbar() {
|
||||
|
||||
@@ -174,6 +174,11 @@ public class RecyclerViewFastScroller extends View {
|
||||
ta.recycle();
|
||||
}
|
||||
|
||||
/** @return whether there is a RecyclerView bound to this scroller. */
|
||||
public boolean hasRecyclerView() {
|
||||
return mRv != null;
|
||||
}
|
||||
|
||||
public void setRecyclerView(FastScrollRecyclerView rv, TextView popupView) {
|
||||
if (mRv != null && mOnScrollListener != null) {
|
||||
mRv.removeOnScrollListener(mOnScrollListener);
|
||||
|
||||
Reference in New Issue
Block a user