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() {
|
public void show() {
|
||||||
if (!isVisible()) {
|
if (!isVisible()) {
|
||||||
MapContextMenuFragment.showInstance(mapActivity);
|
if (!MapContextMenuFragment.showInstance(this, mapActivity)) {
|
||||||
|
active = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void show(LatLon latLon, PointDescription pointDescription, Object object) {
|
public void show(LatLon latLon, PointDescription pointDescription, Object object) {
|
||||||
if (init(latLon, pointDescription, object)) {
|
if (init(latLon, pointDescription, object)) {
|
||||||
MapContextMenuFragment.showInstance(mapActivity);
|
if (!MapContextMenuFragment.showInstance(this, mapActivity)) {
|
||||||
|
active = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -943,22 +943,32 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
||||||
return (OsmandApplication) getActivity().getApplication();
|
return (OsmandApplication) getActivity().getApplication();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showInstance(final MapActivity mapActivity) {
|
public static boolean showInstance(final MapContextMenu menu, final MapActivity mapActivity) {
|
||||||
|
try {
|
||||||
|
|
||||||
int slideInAnim = R.anim.slide_in_bottom;
|
if (menu.getLatLon() == null) {
|
||||||
int slideOutAnim = R.anim.slide_out_bottom;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
MapContextMenu menu = mapActivity.getContextMenu();
|
int slideInAnim = R.anim.slide_in_bottom;
|
||||||
if (menu.isExtended()) {
|
int slideOutAnim = R.anim.slide_out_bottom;
|
||||||
slideInAnim = menu.getSlideInAnimation();
|
|
||||||
slideOutAnim = menu.getSlideOutAnimation();
|
if (menu.isExtended()) {
|
||||||
|
slideInAnim = menu.getSlideInAnimation();
|
||||||
|
slideOutAnim = menu.getSlideOutAnimation();
|
||||||
|
}
|
||||||
|
|
||||||
|
MapContextMenuFragment fragment = new MapContextMenuFragment();
|
||||||
|
mapActivity.getSupportFragmentManager().beginTransaction()
|
||||||
|
.setCustomAnimations(slideInAnim, slideOutAnim, slideInAnim, slideOutAnim)
|
||||||
|
.add(R.id.fragmentContainer, fragment, TAG)
|
||||||
|
.addToBackStack(TAG).commitAllowingStateLoss();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
MapContextMenuFragment fragment = new MapContextMenuFragment();
|
|
||||||
mapActivity.getSupportFragmentManager().beginTransaction()
|
|
||||||
.setCustomAnimations(slideInAnim, slideOutAnim, slideInAnim, slideOutAnim)
|
|
||||||
.add(R.id.fragmentContainer, fragment, TAG)
|
|
||||||
.addToBackStack(TAG).commitAllowingStateLoss();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//DownloadEvents
|
//DownloadEvents
|
||||||
|
|
Loading…
Reference in a new issue