Fixed bug: Drawer no longer disabled after rotation of screen with opened dashboard.

This commit is contained in:
GaidamakUA 2016-04-13 17:30:37 +03:00
parent fb6e1498ec
commit 007ac44fd8
2 changed files with 16 additions and 25 deletions

View file

@ -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() {

View file

@ -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) {