Skip to content

Instantly share code, notes, and snippets.

@lenamuit
Created January 17, 2015 09:25
Show Gist options
  • Save lenamuit/ea61eac4049141836b81 to your computer and use it in GitHub Desktop.
Save lenamuit/ea61eac4049141836b81 to your computer and use it in GitHub Desktop.
Using ObservableRecycleView to handle top banner scrollable
@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;
}
@lenamuit
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment