Fixed 8,9
This commit is contained in:
parent
741f954077
commit
0cbe471b58
2 changed files with 29 additions and 15 deletions
|
@ -229,13 +229,17 @@ public class MapContextMenu extends MenuTitleController {
|
|||
|
||||
public void show() {
|
||||
if (!isVisible()) {
|
||||
MapContextMenuFragment.showInstance(mapActivity);
|
||||
if (!MapContextMenuFragment.showInstance(this, mapActivity)) {
|
||||
active = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void show(LatLon latLon, PointDescription pointDescription, Object object) {
|
||||
if (init(latLon, pointDescription, object)) {
|
||||
MapContextMenuFragment.showInstance(mapActivity);
|
||||
if (!MapContextMenuFragment.showInstance(this, mapActivity)) {
|
||||
active = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -943,12 +943,16 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
return (OsmandApplication) getActivity().getApplication();
|
||||
}
|
||||
|
||||
public static void showInstance(final MapActivity mapActivity) {
|
||||
public static boolean showInstance(final MapContextMenu menu, final MapActivity mapActivity) {
|
||||
try {
|
||||
|
||||
if (menu.getLatLon() == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int slideInAnim = R.anim.slide_in_bottom;
|
||||
int slideOutAnim = R.anim.slide_out_bottom;
|
||||
|
||||
MapContextMenu menu = mapActivity.getContextMenu();
|
||||
if (menu.isExtended()) {
|
||||
slideInAnim = menu.getSlideInAnimation();
|
||||
slideOutAnim = menu.getSlideOutAnimation();
|
||||
|
@ -959,6 +963,12 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
|||
.setCustomAnimations(slideInAnim, slideOutAnim, slideInAnim, slideOutAnim)
|
||||
.add(R.id.fragmentContainer, fragment, TAG)
|
||||
.addToBackStack(TAG).commitAllowingStateLoss();
|
||||
|
||||
return true;
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//DownloadEvents
|
||||
|
|
Loading…
Reference in a new issue