Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
fc6ace8d09
1 changed files with 11 additions and 1 deletions
|
@ -250,10 +250,10 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
|
||||
if (singleTapDetector.onTouchEvent(event)) {
|
||||
showOnMap(menu.getLatLon(), true, false);
|
||||
|
||||
if (hasMoved) {
|
||||
applyPosY(getViewY(), false, false, 0, 0);
|
||||
}
|
||||
openMenuHalfScreen();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -406,6 +406,15 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
public void openMenuFullScreen() {
|
||||
changeMenuState(getViewY(), true, true, false);
|
||||
}
|
||||
|
||||
public void openMenuHalfScreen() {
|
||||
int oldMenuState = menu.getCurrentMenuState();
|
||||
if(oldMenuState == MenuState.HEADER_ONLY) {
|
||||
changeMenuState(getViewY(), false, true, false);
|
||||
} else if(oldMenuState == MenuState.FULL_SCREEN && !menu.isLandscapeLayout()) {
|
||||
changeMenuState(getViewY(), false, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
private void changeMenuState(int currentY, boolean skipHalfScreenState,
|
||||
boolean slidingUp, boolean slidingDown) {
|
||||
|
@ -655,6 +664,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
runLayoutListener();
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
|
||||
private void runLayoutListener() {
|
||||
ViewTreeObserver vto = view.getViewTreeObserver();
|
||||
vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
|
|
Loading…
Reference in a new issue