Merge pull request #959 from Bars107/master

Bugfixes.
This commit is contained in:
vshcherb 2014-11-18 16:52:24 +01:00
commit 95e824d4c8
4 changed files with 26 additions and 7 deletions

View file

@ -9,6 +9,7 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated). 3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
--> -->
<string name="advanced_settings">Advanced</string>
<string name="rendering_attr_publicTransportMode_name">Bus, trolleybus, shuttle routes</string> <string name="rendering_attr_publicTransportMode_name">Bus, trolleybus, shuttle routes</string>
<string name="rendering_attr_tramTrainRoutes_name">Tram and train routes</string> <string name="rendering_attr_tramTrainRoutes_name">Tram and train routes</string>
<string name="rendering_attr_subwayMode_name">Subway routes</string> <string name="rendering_attr_subwayMode_name">Subway routes</string>

View file

@ -348,8 +348,12 @@ public class MapActivityActions implements DialogProvider {
standardId == R.string.context_menu_item_destination_point) { standardId == R.string.context_menu_item_destination_point) {
boolean dest = standardId == R.string.context_menu_item_destination_point; boolean dest = standardId == R.string.context_menu_item_destination_point;
String selected = mapActivity.getMapLayers().getContextMenuLayer().getSelectedObjectName(); String selected = mapActivity.getMapLayers().getContextMenuLayer().getSelectedObjectName();
String target = null;
if(dest && selected != null){
target = selected.replaceAll(getString(R.string.context_menu_item_destination_point), "");
}
targets.navigateToPoint(new LatLon(latitude, longitude), true, targets.navigateToPoint(new LatLon(latitude, longitude), true,
dest ? -1 : targets.getIntermediatePoints().size(), selected); dest ? -1 : targets.getIntermediatePoints().size(), dest? target : selected);
if(targets.getIntermediatePoints().size() > 0) { if(targets.getIntermediatePoints().size() > 0) {
openIntermediatePointsDialog(); openIntermediatePointsDialog();
} }
@ -650,7 +654,7 @@ public class MapActivityActions implements DialogProvider {
} }
public void prepareConfigureMap() { public void prepareConfigureMap() {
prepareOptionsMenu(new ConfigureMapMenu().createListAdapter(mapActivity)); prepareOptionsMenu(new ConfigureMapMenu().createListAdapter(mapActivity, true));
} }
private ContextMenuAdapter createOptionsMenu() { private ContextMenuAdapter createOptionsMenu() {

View file

@ -35,7 +35,7 @@ public class ConfigureMapMenu {
private boolean allModes = false; private boolean allModes = false;
public ContextMenuAdapter createListAdapter(final MapActivity ma) { public ContextMenuAdapter createListAdapter(final MapActivity ma, final boolean advanced) {
ContextMenuAdapter adapter = new ContextMenuAdapter(ma, allModes); ContextMenuAdapter adapter = new ContextMenuAdapter(ma, allModes);
adapter.setDefaultLayoutId(R.layout.drawer_list_item); adapter.setDefaultLayoutId(R.layout.drawer_list_item);
adapter.item(R.string.configure_map).icons(R.drawable.ic_back_drawer_dark, R.drawable.ic_back_drawer_white) adapter.item(R.string.configure_map).icons(R.drawable.ic_back_drawer_dark, R.drawable.ic_back_drawer_white)
@ -52,12 +52,26 @@ public class ConfigureMapMenu {
@Override @Override
public void onClick(boolean result) { public void onClick(boolean result) {
allModes = true; allModes = true;
ma.getMapActions().prepareOptionsMenu(createListAdapter(ma)); ma.getMapActions().prepareOptionsMenu(createListAdapter(ma, advanced));
} }
}); });
createLayersItems(adapter, ma); createLayersItems(adapter, ma);
if (!advanced){
adapter.item(R.string.btn_advanced_mode).icons(R.drawable.ic_action_settings_dark, R.drawable.ic_action_settings_light)
.selected(advanced ? 1 : 0)
.listen(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
ma.getMapActions().prepareOptionsMenu(createListAdapter(ma, isChecked));
return false;
}
}).reg();
}
if (advanced) {
createRenderingAttributeItems(adapter, ma); createRenderingAttributeItems(adapter, ma);
}
return adapter; return adapter;
} }
@ -191,7 +205,7 @@ public class ConfigureMapMenu {
} }
adapter.setItemDescription(pos, getRenderDescr(activity)); adapter.setItemDescription(pos, getRenderDescr(activity));
dialog.dismiss(); dialog.dismiss();
activity.getMapActions().prepareOptionsMenu(createListAdapter(activity)); activity.getMapActions().prepareOptionsMenu(createListAdapter(activity, true));
} }
}); });

View file

@ -57,7 +57,7 @@ public class WaypointHelper {
public static final int FAVORITES = 3; public static final int FAVORITES = 3;
public static final int ALARMS = 4; public static final int ALARMS = 4;
public static final int MAX = 5; public static final int MAX = 5;
public static final int[] SEARCH_RADIUS_VALUES = {50, 100, 250, 500, 1000, 1500}; public static final int[] SEARCH_RADIUS_VALUES = {50, 100, 150, 250, 500, 1000, 1500};
private List<List<LocationPointWrapper>> locationPoints = new ArrayList<List<LocationPointWrapper>>(); private List<List<LocationPointWrapper>> locationPoints = new ArrayList<List<LocationPointWrapper>>();
private ConcurrentHashMap<LocationPoint, Integer> locationPointsStates = new ConcurrentHashMap<LocationPoint, Integer>(); private ConcurrentHashMap<LocationPoint, Integer> locationPointsStates = new ConcurrentHashMap<LocationPoint, Integer>();