From 007ac44fd8c6e86bc4b91da67b329b8f6855e5fe Mon Sep 17 00:00:00 2001 From: GaidamakUA Date: Wed, 13 Apr 2016 17:30:37 +0300 Subject: [PATCH] Fixed bug: Drawer no longer disabled after rotation of screen with opened dashboard. --- .../osmand/plus/activities/MapActivity.java | 21 +------------------ .../other/MapMultiSelectionMenuFragment.java | 20 +++++++++++++----- 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index dd872ff2ec..a65c073e84 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -165,26 +165,6 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven private boolean permissionAsked; private boolean permissionGranted; - //private Notification getNotification() { - //Suppress extra nav notification, all handled by background service notification now - // Intent notificationIndent = new Intent(this, getMyApplication().getAppCustomization().getMapActivity()); - // notificationIndent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - // PendingIntent pi = PendingIntent.getActivity(this, 0, notificationIndent, PendingIntent.FLAG_UPDATE_CURRENT); -// Notification notification = new Notification(R.drawable.bgs_icon_drive, "", //$NON-NLS-1$ -// System.currentTimeMillis()); -// notification.flags |= Notification.FLAG_AUTO_CANCEL; -// notification.setLatestEventInfo(this, Version.getAppName(app), getString(R.string.go_back_to_osmand), -// pi); - // int smallIcon = app.getSettings().getApplicationMode().getSmallIconDark(); - // final Builder noti = new NotificationCompat.Builder(this).setContentTitle(Version.getAppName(app)) - // .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) - // .setContentText(getString(R.string.go_back_to_osmand)) - // .setSmallIcon(smallIcon) -// .setLargeIcon(Helpers.getBitmap(R.drawable.mirakel, getBaseContext())) - // .setContentIntent(pi).setOngoing(true); - // return noti.build(); - //} - @Override public void onCreate(Bundle savedInstanceState) { long tm = System.currentTimeMillis(); @@ -620,6 +600,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven permissionDone = true; } } + enableDrawer(); } private void restartApp() { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapMultiSelectionMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapMultiSelectionMenuFragment.java index 54bbc6b83e..3429bb850b 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapMultiSelectionMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapMultiSelectionMenuFragment.java @@ -68,12 +68,25 @@ public class MapMultiSelectionMenuFragment extends Fragment implements AdapterVi @Override public void onStart() { super.onStart(); + menu.getMapActivity().getMapLayers().getMapControlsLayer().setControlsClickable(false); + menu.getMapActivity().getContextMenu().setBaseFragmentVisibility(false); + } + + @Override + public void onResume() { + super.onResume(); wasDrawerDisabled = menu.getMapActivity().isDrawerDisabled(); if (!wasDrawerDisabled) { menu.getMapActivity().disableDrawer(); } - menu.getMapActivity().getMapLayers().getMapControlsLayer().setControlsClickable(false); - menu.getMapActivity().getContextMenu().setBaseFragmentVisibility(false); + } + + @Override + public void onPause() { + super.onPause(); + if (!wasDrawerDisabled) { + menu.getMapActivity().enableDrawer(); + } } @Override @@ -84,9 +97,6 @@ public class MapMultiSelectionMenuFragment extends Fragment implements AdapterVi } menu.getMapActivity().getContextMenu().setBaseFragmentVisibility(true); menu.getMapActivity().getMapLayers().getMapControlsLayer().setControlsClickable(true); - if (!wasDrawerDisabled) { - menu.getMapActivity().enableDrawer(); - } } public static void showInstance(final MapActivity mapActivity) {