Fix scrolling

This commit is contained in:
PavelRatushny 2017-07-13 14:42:29 +03:00
parent 7f91b1274e
commit 53b091a47f

View file

@ -145,15 +145,13 @@ public class SplitSegmentFragment extends OsmAndListFragment {
previousYPos = currentYPos; previousYPos = currentYPos;
} }
if (previousYPos - currentYPos < headerView.getHeight()) { float yTranslationToSet = headerView.getTranslationY() + (previousYPos - currentYPos);
float yTranslationToSet = headerView.getTranslationY() + (previousYPos - currentYPos); if (yTranslationToSet < 0 && yTranslationToSet > -headerView.getHeight()) {
if (yTranslationToSet < 0 && yTranslationToSet > -headerView.getHeight()) { headerView.setTranslationY(yTranslationToSet);
headerView.setTranslationY(yTranslationToSet); } else if (yTranslationToSet < -headerView.getHeight()) {
} else if (yTranslationToSet < -headerView.getHeight()) { headerView.setTranslationY(-headerView.getHeight());
headerView.setTranslationY(-headerView.getHeight()); } else if (yTranslationToSet > 0) {
} else if (yTranslationToSet > 0) { headerView.setTranslationY(0);
headerView.setTranslationY(0);
}
} }
previousYPos = currentYPos; previousYPos = currentYPos;