Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Commit

Permalink
fixed bug on small devices
Browse files Browse the repository at this point in the history
  • Loading branch information
florent37 committed Jul 8, 2015
1 parent f07b7c5 commit 3ffcd50
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ private void setScrollOffset(Object scroll, float yOffset) {
}
}

float initialDistance = -1;

/**
* Called when a scroller(RecyclerView/ListView,ScrollView,WebView) scrolled by the user
*
Expand Down Expand Up @@ -179,6 +181,13 @@ public void onMaterialScrolled(Object source, float yOffset) {

float percent = yOffset / scrollMax;

if(initialDistance == -1)
initialDistance = mHeader.mPagerSlidingTabStrip.getTop() - mHeader.toolbar.getBottom();

float newDistance = ViewHelper.getY(mHeader.mPagerSlidingTabStrip) - mHeader.toolbar.getBottom();

percent = 1 - newDistance/initialDistance;

percent = minMax(0, percent, 1);
{

Expand Down

0 comments on commit 3ffcd50

Please sign in to comment.