From 469fd8fd4082ea2bc003f10eaf0f5467b5093fde Mon Sep 17 00:00:00 2001 From: Denis Date: Wed, 6 Aug 2014 15:09:00 +0300 Subject: [PATCH] Added calling slide menu for another control --- .../src/net/osmand/plus/activities/MapActivityActions.java | 5 +++-- .../net/osmand/plus/views/controls/SmallMapMenuControls.java | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 95a4e676c9..2676a135cd 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -725,8 +725,8 @@ public class MapActivityActions implements DialogProvider { public void openOptionsMenuAsDrawer(){ final ContextMenuAdapter cm = createOptionsMenu(); - DrawerLayout mDrawerLayout = (DrawerLayout) mapActivity.findViewById(R.id.drawer_layout); - ListView mDrawerList = (ListView) mapActivity.findViewById(R.id.left_drawer); + final DrawerLayout mDrawerLayout = (DrawerLayout) mapActivity.findViewById(R.id.drawer_layout); + final ListView mDrawerList = (ListView) mapActivity.findViewById(R.id.left_drawer); mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START); ListAdapter listAdapter ; if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB){ @@ -751,6 +751,7 @@ public class MapActivityActions implements DialogProvider { if (click != null) { click.onContextMenuClick(cm.getItemId(which), which, false, null); } + mDrawerLayout.closeDrawer(mDrawerList); } }); diff --git a/OsmAnd/src/net/osmand/plus/views/controls/SmallMapMenuControls.java b/OsmAnd/src/net/osmand/plus/views/controls/SmallMapMenuControls.java index 127a23706f..94b77ebfcd 100644 --- a/OsmAnd/src/net/osmand/plus/views/controls/SmallMapMenuControls.java +++ b/OsmAnd/src/net/osmand/plus/views/controls/SmallMapMenuControls.java @@ -26,7 +26,8 @@ public class SmallMapMenuControls extends MapControls { @Override public void onClick(View v) { notifyClicked(); - mapActivity.getMapActions().openOptionsMenuAsList(); + mapActivity.getMapActions().openOptionsMenuAsDrawer(); + //mapActivity.getMapActions().openOptionsMenuAsList(); } }); }