Skip to content

Instantly share code, notes, and snippets.

@marinat
Created June 19, 2014 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marinat/71cac3c1107ecc0f6398 to your computer and use it in GitHub Desktop.
Save marinat/71cac3c1107ecc0f6398 to your computer and use it in GitHub Desktop.
@Override
protected void onScrollChanged(int l, int t, int oldl, int oldt) {
super.onScrollChanged(l, t, oldl, oldt);
WebTitle webTitle = mBrowser.getTabsActionBar().getTitle();
if (t > oldt) {
Tracer.debug("SCROLL", "tbar = " + webTitle.getY() + " t height = " + webTitle.getHeight());
if (-(webTitle.getY() - (t - oldt)) > webTitle.getHeight())
webTitle.setTranslationY(-webTitle.getHeight());
else
webTitle.setY(webTitle.getY() - (t - oldt));
Tracer.debug("SCROLL", "tbar CH = " + webTitle.getY());
} else {
if (webTitle.getY() + (oldt - t) < 0)
webTitle.setTranslationY(webTitle.getY() + (oldt - t));
else
webTitle.setTranslationY(0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment