can anyone tell me why I can not get onOverScrolled be called in my following code:
public class KasOverScrollListenableListView extends ListView {
public interface OverScrollListener{
void onOverScroll(int scrollx, int scrollY,boolean clampedX, boolean clampedY );
}
private OverScrollListener mOverScrollListener= null;
public KasOverScrollListenableListView(Context context, AttributeSet attrs,
int defStyle) {
super(context, attrs, defStyle);
}
public KasOverScrollListenableListView(Context context, AttributeSet attrs){
this(context,attrs,0);
}
public KasOverScrollListenableListView(Context context){
this(context,null,0);
}
protected void onOverScroll(int scrollX, int scrollY, boolean clampedX, boolean clampedY){
Log.i("overScrolling", "overScrolling is " + scrollY);
// if the version of the system higher than 2.3 then do the following things.
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD){
// super.onOverScrolled(scrollX, scrollY, clampedX, clampedY);
if(null != mOverScrollListener ){
mOverScrollListener.onOverScroll(scrollX, scrollY, clampedX, clampedY);
}
}
}
public void setOnOverScrollListener(OverScrollListener listener){
mOverScrollListener = listener;
}
}
I can never get the log to be output which means this function never been called, while this listview is actually overscrolled.I will really be grateful to hear your idea.