Fix markers

This commit is contained in:
Alexey Kulish 2016-02-08 11:22:03 +03:00
parent a77d32bd1b
commit 1456b5e328
3 changed files with 26 additions and 11 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).
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="active_markers">Active markers</string>
<string name="map_markers">Map markers</string>

View file

@ -288,7 +288,6 @@ public class MapMarkersActivity extends OsmandListActivity implements DynamicLis
v.findViewById(R.id.check_item).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);
btn.setTextColor(!nightMode ? getResources().getColor(R.color.map_widget_blue)
: getResources().getColor(R.color.osmand_orange));
@ -297,6 +296,7 @@ public class MapMarkersActivity extends OsmandListActivity implements DynamicLis
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (type == MARKERS_HISTORY) {
AlertDialog.Builder builder = new AlertDialog.Builder(MapMarkersActivity.this);
builder.setMessage(getString(R.string.clear_markers_history_q))
.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)
.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);
AndroidUtils.setTextPrimaryColor(this, tv, nightMode);

View file

@ -25,6 +25,7 @@ public class MapMarkerMenuController extends MenuController {
@Override
public void buttonPressed() {
markersHelper.removeMapMarker(getMapMarker().index);
markersHelper.addMapMarkerHistory(getMapMarker());
getMapActivity().getContextMenu().close();
}
};