Back to project page StikkyHeader.
The source code is released under:
Apache License
If you think the Android project StikkyHeader listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package it.carlom.stikkyheader.core; //from www . j a v a 2 s .co m import android.view.View; import android.widget.ListView; public abstract class HeaderAnimator { private View mHeader; private ListView mListView; private int mMinHeightHeader; private int mHeightHeader; private int mMaxTranslation; public abstract void onScroll(final int scrolledY,final View header); /** * Called by the {@link it.carlom.stikkyheader.core.StikkyHeader} to set the {@link HeaderAnimator} up * * @param header * @param listView */ void setupAnimator(final View header, final ListView listView, final int minHeightHeader, final int heightHeader, final int maxTranslation) { this.mHeader = header; this.mListView = listView; this.mMinHeightHeader = minHeightHeader; this.mHeightHeader = heightHeader; this.mMaxTranslation = maxTranslation; onAnimatorAttached(); onAnimatorReady(); } /** * Called after that the animator is attached to the header */ protected abstract void onAnimatorAttached(); /** * Called after that the animator is attached and ready */ protected abstract void onAnimatorReady(); public View getHeader() { return mHeader; } public ListView getListView() { return mListView; } public int getMinHeightHeader() { return mMinHeightHeader; } public int getHeightHeader() { return mHeightHeader; } public int getMaxTranslation() { return mMaxTranslation; } public static float clamp(float value, float min, float max) { return Math.max(min, Math.min(value, max)); } }