Fix back to context menu from gpx menu
This commit is contained in:
parent
1b1ed6e02f
commit
d2aa6c331e
2 changed files with 9 additions and 7 deletions
|
@ -42,9 +42,7 @@ public class SelectedGpxMenuController extends MenuController {
|
||||||
leftTitleButtonController = new TitleButtonController() {
|
leftTitleButtonController = new TitleButtonController() {
|
||||||
@Override
|
@Override
|
||||||
public void buttonPressed() {
|
public void buttonPressed() {
|
||||||
SelectedGpxFile selectedGpxFile = selectedGpxPoint.getSelectedGpxFile();
|
TrackMenuFragment.showInstance(mapActivity, selectedGpxPoint.getSelectedGpxFile());
|
||||||
mapActivity.getContextMenu().hide(false);
|
|
||||||
TrackMenuFragment.showInstance(mapActivity, selectedGpxFile.getGpxFile().path, selectedGpxFile.isShowCurrentTrack());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
leftTitleButtonController.caption = mapActivity.getString(R.string.shared_string_open_track);
|
leftTitleButtonController.caption = mapActivity.getString(R.string.shared_string_open_track);
|
||||||
|
|
|
@ -227,11 +227,15 @@ public class TrackMenuFragment extends ContextMenuScrollFragment implements Card
|
||||||
FragmentActivity activity = requireMyActivity();
|
FragmentActivity activity = requireMyActivity();
|
||||||
activity.getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) {
|
activity.getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) {
|
||||||
public void handleOnBackPressed() {
|
public void handleOnBackPressed() {
|
||||||
MapActivity mapActivity = getMapActivity();
|
if (getCurrentMenuState() != MenuState.HEADER_ONLY && isPortrait()) {
|
||||||
if (mapActivity != null) {
|
openMenuHeaderOnly();
|
||||||
mapActivity.launchPrevActivityIntent();
|
} else {
|
||||||
|
MapActivity mapActivity = getMapActivity();
|
||||||
|
if (mapActivity != null && mapActivity.getSupportFragmentManager().getBackStackEntryCount() == 1) {
|
||||||
|
mapActivity.launchPrevActivityIntent();
|
||||||
|
}
|
||||||
|
dismiss();
|
||||||
}
|
}
|
||||||
dismiss();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue