Fix markers
This commit is contained in:
parent
a77d32bd1b
commit
1456b5e328
3 changed files with 26 additions and 11 deletions
|
@ -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="clear_active_markers_q">Do you want to delete all active markers?</string>
|
||||||
<string name="clear_markers_history_q">Do you want to clear markers history?</string>
|
<string name="clear_markers_history_q">Do you want to clear markers history?</string>
|
||||||
<string name="active_markers">Active markers</string>
|
<string name="active_markers">Active markers</string>
|
||||||
<string name="map_markers">Map markers</string>
|
<string name="map_markers">Map markers</string>
|
||||||
|
|
|
@ -288,7 +288,6 @@ public class MapMarkersActivity extends OsmandListActivity implements DynamicLis
|
||||||
v.findViewById(R.id.check_item).setVisibility(View.GONE);
|
v.findViewById(R.id.check_item).setVisibility(View.GONE);
|
||||||
v.findViewById(R.id.ProgressBar).setVisibility(View.GONE);
|
v.findViewById(R.id.ProgressBar).setVisibility(View.GONE);
|
||||||
|
|
||||||
if (type == MARKERS_HISTORY) {
|
|
||||||
final Button btn = (Button) v.findViewById(R.id.header_button);
|
final Button btn = (Button) v.findViewById(R.id.header_button);
|
||||||
btn.setTextColor(!nightMode ? getResources().getColor(R.color.map_widget_blue)
|
btn.setTextColor(!nightMode ? getResources().getColor(R.color.map_widget_blue)
|
||||||
: getResources().getColor(R.color.osmand_orange));
|
: getResources().getColor(R.color.osmand_orange));
|
||||||
|
@ -297,6 +296,7 @@ public class MapMarkersActivity extends OsmandListActivity implements DynamicLis
|
||||||
btn.setOnClickListener(new View.OnClickListener() {
|
btn.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
if (type == MARKERS_HISTORY) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(MapMarkersActivity.this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(MapMarkersActivity.this);
|
||||||
builder.setMessage(getString(R.string.clear_markers_history_q))
|
builder.setMessage(getString(R.string.clear_markers_history_q))
|
||||||
.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
||||||
|
@ -309,9 +309,22 @@ public class MapMarkersActivity extends OsmandListActivity implements DynamicLis
|
||||||
})
|
})
|
||||||
.setNegativeButton(R.string.shared_string_no, null)
|
.setNegativeButton(R.string.shared_string_no, null)
|
||||||
.show();
|
.show();
|
||||||
|
} else if (type == ACTIVE_MARKERS) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(MapMarkersActivity.this);
|
||||||
|
builder.setMessage(getString(R.string.clear_active_markers_q))
|
||||||
|
.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
getListAdapter().notifyDataSetInvalidated();
|
||||||
|
getMyApplication().getMapMarkersHelper().removeActiveMarkers();
|
||||||
|
reloadListAdapter();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton(R.string.shared_string_no, null)
|
||||||
|
.show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
TextView tv = (TextView) v.findViewById(R.id.header_text);
|
TextView tv = (TextView) v.findViewById(R.id.header_text);
|
||||||
AndroidUtils.setTextPrimaryColor(this, tv, nightMode);
|
AndroidUtils.setTextPrimaryColor(this, tv, nightMode);
|
||||||
|
|
|
@ -25,6 +25,7 @@ public class MapMarkerMenuController extends MenuController {
|
||||||
@Override
|
@Override
|
||||||
public void buttonPressed() {
|
public void buttonPressed() {
|
||||||
markersHelper.removeMapMarker(getMapMarker().index);
|
markersHelper.removeMapMarker(getMapMarker().index);
|
||||||
|
markersHelper.addMapMarkerHistory(getMapMarker());
|
||||||
getMapActivity().getContextMenu().close();
|
getMapActivity().getContextMenu().close();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue