Fix scrolling
This commit is contained in:
parent
7f91b1274e
commit
53b091a47f
1 changed files with 7 additions and 9 deletions
|
@ -145,15 +145,13 @@ public class SplitSegmentFragment extends OsmAndListFragment {
|
|||
previousYPos = currentYPos;
|
||||
}
|
||||
|
||||
if (previousYPos - currentYPos < headerView.getHeight()) {
|
||||
float yTranslationToSet = headerView.getTranslationY() + (previousYPos - currentYPos);
|
||||
if (yTranslationToSet < 0 && yTranslationToSet > -headerView.getHeight()) {
|
||||
headerView.setTranslationY(yTranslationToSet);
|
||||
} else if (yTranslationToSet < -headerView.getHeight()) {
|
||||
headerView.setTranslationY(-headerView.getHeight());
|
||||
} else if (yTranslationToSet > 0) {
|
||||
headerView.setTranslationY(0);
|
||||
}
|
||||
float yTranslationToSet = headerView.getTranslationY() + (previousYPos - currentYPos);
|
||||
if (yTranslationToSet < 0 && yTranslationToSet > -headerView.getHeight()) {
|
||||
headerView.setTranslationY(yTranslationToSet);
|
||||
} else if (yTranslationToSet < -headerView.getHeight()) {
|
||||
headerView.setTranslationY(-headerView.getHeight());
|
||||
} else if (yTranslationToSet > 0) {
|
||||
headerView.setTranslationY(0);
|
||||
}
|
||||
|
||||
previousYPos = currentYPos;
|
||||
|
|
Loading…
Reference in a new issue