Created
January 17, 2015 09:25
-
-
Save lenamuit/ea61eac4049141836b81 to your computer and use it in GitHub Desktop.
Using ObservableRecycleView to handle top banner scrollable
This file contains hidden or 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
@Override | |
public void onScrollChanged(int scrollY, boolean firstScroll, boolean dragging) { | |
int max = fxTopView.getHeight(); | |
int delta = currentScrollY - scrollY; | |
mTopScrollY += delta; | |
Timber.e("mTopScrollY %d",mTopScrollY); | |
if (mTopScrollY >0) mTopScrollY = 0; | |
if (mTopScrollY < -max) mTopScrollY = -max; | |
fxTopView.setTranslationY(mTopScrollY); | |
currentScrollY = scrollY; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using this library https://github.com/ksoichiro/Android-ObservableScrollView