Fix context menu visibility

This commit is contained in:
Vitaliy 2021-01-28 15:32:21 +02:00
parent c0727f658f
commit 2bd2839f49
2 changed files with 12 additions and 4 deletions

View file

@ -42,6 +42,7 @@ public class SelectedGpxMenuController extends MenuController {
leftTitleButtonController = new TitleButtonController() {
@Override
public void buttonPressed() {
mapContextMenu.hide(false);
TrackMenuFragment.showInstance(mapActivity, selectedGpxPoint.getSelectedGpxFile());
}
};

View file

@ -230,11 +230,18 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card
if (getCurrentMenuState() != MenuState.HEADER_ONLY && isPortrait()) {
openMenuHeaderOnly();
} else {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null && mapActivity.getSupportFragmentManager().getBackStackEntryCount() == 1) {
mapActivity.launchPrevActivityIntent();
}
dismiss();
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
MapContextMenu contextMenu = mapActivity.getContextMenu();
if (contextMenu.isActive() && contextMenu.getPointDescription() != null
&& contextMenu.getPointDescription().isGpxPoint()) {
contextMenu.show();
} else {
mapActivity.launchPrevActivityIntent();
}
}
}
}
});