diff options
Diffstat (limited to 'org.fox.ttrss/src/main/java/org/fox/ttrss/util/NotifyingScrollView.java')
-rw-r--r-- | org.fox.ttrss/src/main/java/org/fox/ttrss/util/NotifyingScrollView.java | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/util/NotifyingScrollView.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/util/NotifyingScrollView.java new file mode 100644 index 00000000..e128856f --- /dev/null +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/util/NotifyingScrollView.java @@ -0,0 +1,45 @@ +package org.fox.ttrss.util; + +import android.content.Context; +import android.util.AttributeSet; +import android.widget.ScrollView; + +/** + * @author Cyril Mottier + */ +public class NotifyingScrollView extends ScrollView { + + /** + * @author Cyril Mottier + */ + public interface OnScrollChangedListener { + void onScrollChanged(ScrollView who, int l, int t, int oldl, int oldt); + } + + private OnScrollChangedListener mOnScrollChangedListener; + + public NotifyingScrollView(Context context) { + super(context); + } + + public NotifyingScrollView(Context context, AttributeSet attrs) { + super(context, attrs); + } + + public NotifyingScrollView(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + } + + @Override + protected void onScrollChanged(int l, int t, int oldl, int oldt) { + super.onScrollChanged(l, t, oldl, oldt); + if (mOnScrollChangedListener != null) { + mOnScrollChangedListener.onScrollChanged(this, l, t, oldl, oldt); + } + } + + public void setOnScrollChangedListener(OnScrollChangedListener listener) { + mOnScrollChangedListener = listener; + } + +}
\ No newline at end of file |