Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ public AbsRecyclerViewFastScroller(Context context, AttributeSet attrs, int defS
} finally {
attributes.recycle();
}

setOnTouchListener(new FastScrollerTouchListener(this));
}

private void applyCustomAttributesToView(View view, Drawable drawable, int color) {
Expand All @@ -91,6 +89,31 @@ private void applyCustomAttributesToView(View view, Drawable drawable, int color
}
}

@Override
public boolean onTouchEvent(MotionEvent event) {
SectionIndicator sectionIndicator = this.getSectionIndicator();
showOrHideIndicator(sectionIndicator, event);

float scrollProgress = this.getScrollProgress(event);
this.scrollTo(scrollProgress, true);
this.moveHandleToPosition(scrollProgress);
return true;
}

private void showOrHideIndicator(@Nullable SectionIndicator sectionIndicator, MotionEvent event) {
if (sectionIndicator == null) {
return;
}

switch (event.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
sectionIndicator.animateAlpha(1f);
return;
case MotionEvent.ACTION_UP:
sectionIndicator.animateAlpha(0f);
}
}

/**
* Provides the ability to programmatically set the color of the fast scroller's handle
* @param color for the handle to be
Expand Down

This file was deleted.