Fixed issue with drawer not showing when swype from left side first time

This commit is contained in:
Denis 2014-10-10 12:47:33 +03:00
parent 90b4c7f8f7
commit 3863a864aa
4 changed files with 10 additions and 6 deletions

View file

@ -213,6 +213,8 @@ public class MapActivity extends AccessibleActivity {
((FrameLayout)mapView.getParent()).addView(lockView);
}
gpxImportHelper = new GpxImportHelper(this, getMyApplication(), getMapView());
mapActions.createOptionsMenuAsDrawer(false);
}
public void addLockView(FrameLayout lockView) {
@ -466,7 +468,7 @@ public class MapActivity extends AccessibleActivity {
}
return true;
} else if (keyCode == KeyEvent.KEYCODE_MENU && event.getRepeatCount() == 0) {
mapActions.openOptionsMenuAsDrawer();
mapActions.createOptionsMenuAsDrawer(true);
return true;
} else if (keyCode == KeyEvent.KEYCODE_SEARCH && event.getRepeatCount() == 0) {
Intent newIntent = new Intent(MapActivity.this, getMyApplication().getAppCustomization().getSearchActivity());

View file

@ -723,7 +723,7 @@ public class MapActivityActions implements DialogProvider {
}
}
public void openOptionsMenuAsDrawer(){
public void createOptionsMenuAsDrawer(boolean show){
final ContextMenuAdapter cm = createOptionsMenu();
final DrawerLayout mDrawerLayout = (DrawerLayout) mapActivity.findViewById(R.id.drawer_layout);
final ListView mDrawerList = (ListView) mapActivity.findViewById(R.id.left_drawer);
@ -755,8 +755,10 @@ public class MapActivityActions implements DialogProvider {
}
});
if (show){
mDrawerLayout.openDrawer(mDrawerList);
}
}
public AlertDialog openOptionsMenuAsList() {
final ContextMenuAdapter cm = createOptionsMenu();

View file

@ -39,7 +39,7 @@ public class MapMenuControls extends MapControls {
// double lat = activity.getMapView().getLatitude();
// double lon = activity.getMapView().getLongitude();
// MainMenuActivity.backToMainMenuDialog(activity, new LatLon(lat, lon));
mapActivity.getMapActions().openOptionsMenuAsDrawer();
mapActivity.getMapActions().createOptionsMenuAsDrawer(true);
notifyClicked();
}
});

View file

@ -27,7 +27,7 @@ public class SmallMapMenuControls extends MapControls {
public void onClick(View v) {
notifyClicked();
//mapActivity.getMapActions().openOptionsMenuAsDrawer();
mapActivity.getMapActions().openOptionsMenuAsDrawer();
mapActivity.getMapActions().createOptionsMenuAsDrawer(true);
}
});
}