Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setOnScrollChangeListener Added #165

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Next Next commit
OnScrollChangeListener support for <23 API
Jekos authored Dec 3, 2017
commit 3190da3e99832b397260ef297962d4560931d56a
Original file line number Diff line number Diff line change
@@ -142,6 +142,34 @@ protected void setListener(final Listener listener, final int requestCodeFilePic
mListener = listener;
mRequestCodeFilePicker = requestCodeFilePicker;
}

@Override
protected void onScrollChanged(int l, int t, int oldl, int oldt) {
super.onScrollChanged(l, t, oldl, oldt);
if (onScrollChangeListener != null) {
onScrollChangeListener.onScrollChange(getContext(), l, t, oldl, oldt);
}
}

public void setOnScrollChangeListener(OnScrollChangeListener onScrollChangeListener) {
this.onScrollChangeListener = onScrollChangeListener;
}

public OnScrollChangeListener getOnScrollChangeListener() {
return onScrollChangeListener;
}

public interface OnScrollChangeListener {
/**
* Called when the scroll position of a view changes.
* @param v The view whose scroll position has changed.
* @param scrollX Current horizontal scroll origin.
* @param scrollY Current vertical scroll origin.
* @param oldScrollX Previous horizontal scroll origin.
* @param oldScrollY Previous vertical scroll origin.
*/
void onScrollChange(Context v, int scrollX, int scrollY, int oldScrollX, int oldScrollY);
}

@Override
public void setWebViewClient(final WebViewClient client) {