public class IntroScrollView extends ScrollView{
// private Context mContext;
private ScrollViewListener scrollViewListener = null;
public interface ScrollViewListener {
void onScrollChanged(IntroScrollView scrollView, int x, int y, int oldx, int oldy);
}
public IntroScrollView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// TODO Auto-generated constructor stub
// mContext = context;
}
public IntroScrollView(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
// mContext = context;
}
public IntroScrollView(Context context) {
super(context);
// TODO Auto-generated constructor stub
// mContext = context;
}
@Override
protected void onScrollChanged(int l, int t, int oldl, int oldt) {
// TODO Auto-generated method stub
super.onScrollChanged(l, t, oldl, oldt);
if(scrollViewListener != null) {
scrollViewListener.onScrollChanged(this, l, t, oldl, oldt);
}
}
public void setScrollViewListener(ScrollViewListener scrollViewListener) {
this.scrollViewListener = scrollViewListener;
}
}
// private Context mContext;
private ScrollViewListener scrollViewListener = null;
public interface ScrollViewListener {
void onScrollChanged(IntroScrollView scrollView, int x, int y, int oldx, int oldy);
}
public IntroScrollView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// TODO Auto-generated constructor stub
// mContext = context;
}
public IntroScrollView(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
// mContext = context;
}
public IntroScrollView(Context context) {
super(context);
// TODO Auto-generated constructor stub
// mContext = context;
}
@Override
protected void onScrollChanged(int l, int t, int oldl, int oldt) {
// TODO Auto-generated method stub
super.onScrollChanged(l, t, oldl, oldt);
if(scrollViewListener != null) {
scrollViewListener.onScrollChanged(this, l, t, oldl, oldt);
}
}
public void setScrollViewListener(ScrollViewListener scrollViewListener) {
this.scrollViewListener = scrollViewListener;
}
}
0 comments: