Created
May 26, 2013 10:11
-
-
Save icastell/5652324 to your computer and use it in GitHub Desktop.
Pushing the ActionBar to the next level
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cyrilmottier.android.translucentactionbar; | |
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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment