From fe17991d708796ec787c72eea19833ef944625c4 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Wed, 26 Jul 2017 15:21:35 +0300 Subject: [PATCH 1/3] Hide mapillary --- OsmAnd/src/net/osmand/plus/activities/MapActivity.java | 6 ++++++ .../src/net/osmand/plus/activities/MapActivityActions.java | 1 + OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java | 1 + 3 files changed, 8 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 6831a4efb4..5fd14c9016 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -24,6 +24,7 @@ import android.support.v4.app.ActivityCompat; import android.support.v4.app.ActivityCompat.OnRequestPermissionsResultCallback; import android.support.v4.app.DialogFragment; import android.support.v4.app.Fragment; +import android.support.v4.app.FragmentManager; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.AlertDialog; import android.util.DisplayMetrics; @@ -89,6 +90,7 @@ import net.osmand.plus.helpers.WakeLockHelper; import net.osmand.plus.inapp.InAppHelper; import net.osmand.plus.mapcontextmenu.MapContextMenu; import net.osmand.plus.mapcontextmenu.MapContextMenuFragment; +import net.osmand.plus.mapcontextmenu.builders.cards.dialogs.ContextMenuCardDialogFragment; import net.osmand.plus.mapcontextmenu.other.DestinationReachedMenu; import net.osmand.plus.mapcontextmenu.other.MapRouteInfoMenu; import net.osmand.plus.mapcontextmenu.other.MapRouteInfoMenuFragment; @@ -749,6 +751,10 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven } } + public void dismissCardDialog() { + getSupportFragmentManager().popBackStack(ContextMenuCardDialogFragment.TAG, FragmentManager.POP_BACK_STACK_INCLUSIVE); + } + @Override public void onDismissDialogFragment(DialogFragment dialogFragment) { if (dialogFragment instanceof DataStoragePlaceDialogFragment) { diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 385fa477fe..f14528cb0f 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -921,6 +921,7 @@ public class MapActivityActions implements DialogProvider { menuItemsListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { + mapActivity.dismissCardDialog(); ContextMenuItem item = contextMenuAdapter.getItem(position); ContextMenuAdapter.ItemClickListener click = item.getItemClickListener(); if (click != null && click.onContextMenuClick(simpleListAdapter, item.getTitleId(), diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index 7892aa3ea5..40d4c16ed6 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -423,6 +423,7 @@ public class MapControlsLayer extends OsmandMapLayer { routePlanButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { + mapActivity.dismissCardDialog(); doRoute(false); } }); From 1dffa85992eaf1f1a005cc8c212f8a7327940035 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Wed, 26 Jul 2017 15:39:06 +0300 Subject: [PATCH 2/3] Hide mapillary (dashboard, configure screen, search) --- OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index 40d4c16ed6..816b8adf28 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -247,6 +247,7 @@ public class MapControlsLayer extends OsmandMapLayer { configureMap.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { + mapActivity.dismissCardDialog(); MapActivity.clearPrevActivityIntent(); mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.CONFIGURE_MAP); } @@ -273,6 +274,7 @@ public class MapControlsLayer extends OsmandMapLayer { search.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { + mapActivity.dismissCardDialog(); mapActivity.showQuickSearch(ShowQuickSearchMode.NEW_IF_EXPIRED, false); } }); @@ -408,6 +410,7 @@ public class MapControlsLayer extends OsmandMapLayer { public void onClick(View v) { MapActivity.clearPrevActivityIntent(); if (dash) { + mapActivity.dismissCardDialog(); mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.DASHBOARD); } else { mapActivity.openDrawer(); From 26d58d894e280883f2b2ea5c6b7e59fb43c731ad Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Wed, 26 Jul 2017 15:59:30 +0300 Subject: [PATCH 3/3] Fix dashboard --- OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java | 1 + OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java index 5c7003965b..f4180a90c7 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java @@ -795,6 +795,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis } if (visible) { + mapActivity.dismissCardDialog(); mapActivity.getContextMenu().hideMenues(); mapViewLocation = mapActivity.getMapLocation(); mapRotation = mapActivity.getMapRotate(); diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index 816b8adf28..a0cfbf5d3a 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -247,7 +247,6 @@ public class MapControlsLayer extends OsmandMapLayer { configureMap.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - mapActivity.dismissCardDialog(); MapActivity.clearPrevActivityIntent(); mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.CONFIGURE_MAP); } @@ -410,7 +409,6 @@ public class MapControlsLayer extends OsmandMapLayer { public void onClick(View v) { MapActivity.clearPrevActivityIntent(); if (dash) { - mapActivity.dismissCardDialog(); mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.DASHBOARD); } else { mapActivity.openDrawer();