package com.wpc.library.widget;
|
|
import android.content.Context;
|
import android.util.AttributeSet;
|
import android.widget.ScrollView;
|
|
/**
|
* Created by weikou2015 on 2018/9/17.
|
*/
|
|
public class ScListerScrollView extends ScrollView {
|
private OnScollChangedListener onScollChangedListener = null;
|
|
public ScListerScrollView(Context context) {
|
super(context);
|
}
|
|
public ScListerScrollView(Context context, AttributeSet attrs) {
|
super(context, attrs);
|
}
|
|
public ScListerScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
|
super(context, attrs, defStyleAttr);
|
}
|
|
public void setOnScollChangedListener(OnScollChangedListener onScollChangedListener) {
|
this.onScollChangedListener = onScollChangedListener;
|
}
|
|
@Override
|
protected void onScrollChanged(int x, int y, int oldx, int oldy) {
|
super.onScrollChanged(x, y, oldx, oldy);
|
if (onScollChangedListener != null) {
|
onScollChangedListener.onScrollChanged(this, x, y, oldx, oldy);
|
}
|
}
|
|
public interface OnScollChangedListener {
|
void onScrollChanged(ScListerScrollView scrollView, int x, int y, int oldx, int oldy);
|
}
|
}
|