Skip to content
Open
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ public class ParallaxScrollView extends ScrollView {
private float parallaxFactor = DEFAULT_PARALLAX_FACTOR;
private float alphaFactor = DEFAULT_ALPHA_FACTOR;
private ArrayList<ParallaxedView> parallaxedViews = new ArrayList<ParallaxedView>();
private ParallaxScrolledListener mListener;

public interface ParallaxScrolledListener{
void onParallaxScrolledListener(ParallaxScrollView view,int scrollX,int scrollY);
}

public ParallaxScrollView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
Expand Down Expand Up @@ -78,6 +83,13 @@ protected void onScrollChanged(int l, int t, int oldl, int oldt) {
}
parallaxedView.animateNow();
}
if(mListener!=null){
mListener.onParallaxScrolledListener(this,t,l);
}
}

public void setParallaxScrolledListener(ParallaxScrolledListener listener){
this.mListener = listener;
}

protected class ScrollViewParallaxedItem extends ParallaxedView {
Expand Down