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;
|
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;
|
||||||
|
|
Loading…
Reference in a new issue