Fixed 8,9

This commit is contained in:
Alexey Kulish 2015-11-25 13:32:05 +03:00
parent 741f954077
commit 0cbe471b58
2 changed files with 29 additions and 15 deletions

View file

@ -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;
}
}
}

View file

@ -943,22 +943,32 @@ 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 {
int slideInAnim = R.anim.slide_in_bottom;
int slideOutAnim = R.anim.slide_out_bottom;
if (menu.getLatLon() == null) {
return false;
}
MapContextMenu menu = mapActivity.getContextMenu();
if (menu.isExtended()) {
slideInAnim = menu.getSlideInAnimation();
slideOutAnim = menu.getSlideOutAnimation();
int slideInAnim = R.anim.slide_in_bottom;
int slideOutAnim = R.anim.slide_out_bottom;
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