Updated drawer layout. Fixed compatibility issue
This commit is contained in:
parent
ec64baeda7
commit
b4961d3401
4 changed files with 70 additions and 66 deletions
|
@ -459,7 +459,7 @@ public class MapActivity extends AccessibleActivity {
|
|||
}
|
||||
return true;
|
||||
} else if (keyCode == KeyEvent.KEYCODE_MENU && event.getRepeatCount() == 0) {
|
||||
mapActions.openOptionsMenuAsList();
|
||||
mapActions.openOptionsMenuAsDrawer();
|
||||
return true;
|
||||
} else if (keyCode == KeyEvent.KEYCODE_SEARCH && event.getRepeatCount() == 0) {
|
||||
Intent newIntent = new Intent(MapActivity.this, getMyApplication().getAppCustomization().getSearchActivity());
|
||||
|
|
|
@ -3,6 +3,7 @@ package net.osmand.plus.helpers;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import android.support.v4.widget.DrawerLayout;
|
||||
import net.osmand.Location;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.data.LocationPoint;
|
||||
|
@ -47,7 +48,7 @@ import android.widget.TextView;
|
|||
public class WaypointDialogHelper implements OsmAndLocationListener {
|
||||
private MapActivity mapActivity;
|
||||
private OsmandApplication app;
|
||||
private FrameLayout mainLayout;
|
||||
private DrawerLayout mainLayout;
|
||||
private WaypointHelper waypointHelper;
|
||||
|
||||
public final static boolean OVERLAP_LAYOUT = true; // only true is supported
|
||||
|
@ -59,7 +60,8 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
|||
this.app = mapActivity.getMyApplication();
|
||||
waypointHelper = this.app.getWaypointHelper();
|
||||
this.mapActivity = mapActivity;
|
||||
this.mainLayout = (FrameLayout) ((FrameLayout) mapActivity.getLayout()).getChildAt(0);
|
||||
this.mainLayout = (DrawerLayout) mapActivity.findViewById(R.id.drawer_layout);
|
||||
|
||||
}
|
||||
|
||||
public void init() {
|
||||
|
@ -255,7 +257,9 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
|||
new AsyncTask<Void, Void, Void>() {
|
||||
|
||||
protected void onPreExecute() {
|
||||
};
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
|
@ -266,9 +270,11 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
|||
protected void onPostExecute(Void result) {
|
||||
running[0] = -1;
|
||||
listAdapter.clear();
|
||||
listAdapter.addAll(getPoints());
|
||||
for (Object point : getPoints()) {
|
||||
listAdapter.add(point);
|
||||
}
|
||||
listAdapter.notifyDataSetChanged();
|
||||
};
|
||||
}
|
||||
}.execute((Void) null);
|
||||
}
|
||||
|
||||
|
@ -492,6 +498,4 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -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().openOptionsMenuAsList();
|
||||
mapActivity.getMapActions().openOptionsMenuAsDrawer();
|
||||
notifyClicked();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -27,7 +27,7 @@ public class SmallMapMenuControls extends MapControls {
|
|||
public void onClick(View v) {
|
||||
notifyClicked();
|
||||
//mapActivity.getMapActions().openOptionsMenuAsDrawer();
|
||||
mapActivity.getMapActions().openOptionsMenuAsList();
|
||||
mapActivity.getMapActions().openOptionsMenuAsDrawer();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue