Merge pull request #704 from Bars107/master

Added navigation dialog.
This commit is contained in:
vshcherb 2014-06-19 16:47:49 +02:00
commit a54f2e42f4
2 changed files with 8 additions and 1 deletions

View file

@ -9,5 +9,5 @@
<string name="mark_as_not_visited">Mark as not-visited</string> <string name="mark_as_not_visited">Mark as not-visited</string>
<string name="mark_as_current">Navigate to</string> <string name="mark_as_current">Navigate to</string>
<string name="map_widget_route_points">Route points</string> <string name="map_widget_route_points">Route points</string>
<string name="navigate_dialog">Navigate dialog</string>
</resources> </resources>

View file

@ -40,6 +40,7 @@ import com.actionbarsherlock.view.Window;
*/ */
public class RoutePointsActivity extends OsmandListActivity { public class RoutePointsActivity extends OsmandListActivity {
private static final int NAVIGATE_DIALOG_ID = 4;
private static final int OK_ID = 5; private static final int OK_ID = 5;
protected static final int MARK_AS_CURRENT_ID = 6; protected static final int MARK_AS_CURRENT_ID = 6;
protected static final int AS_VISITED_ID = 7; protected static final int AS_VISITED_ID = 7;
@ -295,6 +296,9 @@ public class RoutePointsActivity extends OsmandListActivity {
createMenuItem(menu, OK_ID, R.string.default_buttons_ok, createMenuItem(menu, OK_ID, R.string.default_buttons_ok,
R.drawable.ic_action_map_marker_light, R.drawable.ic_action_map_marker_dark , R.drawable.ic_action_map_marker_light, R.drawable.ic_action_map_marker_dark ,
MenuItem.SHOW_AS_ACTION_IF_ROOM); MenuItem.SHOW_AS_ACTION_IF_ROOM);
createMenuItem(menu, NAVIGATE_DIALOG_ID, R.string.navigate_dialog,
R.drawable.ic_action_gdirections_light, R.drawable.ic_action_gdirections_dark,
MenuItem.SHOW_AS_ACTION_IF_ROOM);
return super.onCreateOptionsMenu(menu); return super.onCreateOptionsMenu(menu);
} }
@ -303,6 +307,9 @@ public class RoutePointsActivity extends OsmandListActivity {
if (item.getItemId() == OK_ID) { if (item.getItemId() == OK_ID) {
finish(); finish();
return true; return true;
} else if (item.getItemId() == NAVIGATE_DIALOG_ID){
app.getSettings().navigateDialog();
return true;
} }
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }