From 6626fbfd517da7a9196f84755a1eedfb2f10dcc5 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 11 Mar 2015 00:34:10 +0100 Subject: [PATCH] Replace strings and icons --- OsmAnd/res/values/strings.xml | 1 - OsmAnd/src/net/osmand/plus/OsmandSettings.java | 2 +- .../plus/myplaces/AvailableGPXFragment.java | 2 +- .../plus/myplaces/TrackSegmentFragment.java | 2 +- .../osmand/plus/osmedit/OsmEditsFragment.java | 16 +++++++++++++--- .../plus/parkingpoint/DashParkingFragment.java | 12 +++--------- 6 files changed, 19 insertions(+), 16 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index c5771b5318..5cdee0968d 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -154,7 +154,6 @@ Shows the settings for development and debugging features like route simulation or rendering performance indication. OsmAnd development - Shown on map Rename failed. days behind Back to map diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 0cff3f4a81..7865dd2e04 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -756,7 +756,7 @@ public class OsmandSettings { new StringPreference("user_password", "").makeGlobal(); // this value boolean is synchronized with settings_pref.xml preference offline POI/Bugs edition - public final OsmandPreference OFFLINE_EDITION = new BooleanPreference("offline_edition", false).makeGlobal(); + public final OsmandPreference OFFLINE_EDITION = new BooleanPreference("offline_edition", true).makeGlobal(); // this value string is synchronized with settings_pref.xml preference name public final CommonPreference DAYNIGHT_MODE = diff --git a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java index 34580381cb..14722aae88 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java @@ -181,7 +181,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { } public static void updateCurrentTrack(View v, final Activity ctx, OsmandApplication app) { - if (OsmandPlugin.getEnabledPlugin(OsmandMonitoringPlugin.class) != null) { + if (OsmandPlugin.getEnabledPlugin(OsmandMonitoringPlugin.class) == null) { return; } if (v == null) { diff --git a/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java index 0881f18563..68e9ed9ecd 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java @@ -22,7 +22,7 @@ public class TrackSegmentFragment extends SelectedGPXFragment { @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); - MenuItem item = menu.add(R.string.showed_on_map).setIcon(R.drawable.ic_show_on_map).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { + MenuItem item = menu.add(R.string.shared_string_show_on_map).setIcon(R.drawable.ic_show_on_map).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { selectSplitDistance(); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java index 6c1f49e90c..9433a7d378 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java @@ -10,10 +10,11 @@ import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; +import android.widget.AdapterView; +import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.TextView; - import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.OsmandSettings; @@ -69,6 +70,15 @@ public class OsmEditsFragment extends ListFragment { dataPoints.addAll(l2); listAdapter = new OsmEditsAdapter(dataPoints); getListView().setAdapter(listAdapter); + getListView().setOnItemClickListener(new OnItemClickListener() { + + @Override + public void onItemClick(AdapterView parent, View view, int position, long id) { + OsmPoint it = listAdapter.getItem(position); + openPopUpMenu(view, it); + + } + }); } @@ -130,7 +140,7 @@ public class OsmEditsFragment extends ListFragment { OsmandApplication app = getMyApplication(); final PopupMenu optionsMenu = new PopupMenu(getActivity(), v); DirectionsDialogs.setupPopUpMenuIcon(optionsMenu); - MenuItem item = optionsMenu.getMenu().add(R.string.showed_on_map). + MenuItem item = optionsMenu.getMenu().add(R.string.shared_string_show_on_map). setIcon(app.getIconsCache().getContentIcon(R.drawable.ic_show_on_map)); item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { @Override @@ -141,7 +151,7 @@ public class OsmEditsFragment extends ListFragment { return true; } }); - item = optionsMenu.getMenu().add(R.string.local_openstreetmap_delete). + item = optionsMenu.getMenu().add(R.string.shared_string_delete). setIcon(app.getIconsCache().getContentIcon(R.drawable.ic_action_delete_dark)); item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { @Override diff --git a/OsmAnd/src/net/osmand/plus/parkingpoint/DashParkingFragment.java b/OsmAnd/src/net/osmand/plus/parkingpoint/DashParkingFragment.java index 8d117ec23e..bbb87b05bc 100644 --- a/OsmAnd/src/net/osmand/plus/parkingpoint/DashParkingFragment.java +++ b/OsmAnd/src/net/osmand/plus/parkingpoint/DashParkingFragment.java @@ -75,11 +75,6 @@ public class DashParkingFragment extends DashLocationFragment { LatLon loc = getDefaultLocation(); LatLon position = plugin.getParkingPosition(); - int dist = (int) (MapUtils.getDistance(position.getLatitude(), position.getLongitude(), - loc.getLatitude(), loc.getLongitude())); - String distance = OsmAndFormatter.getFormattedDistance(dist, getMyApplication()); - ((TextView) mainView.findViewById(R.id.distance)).setText(distance); - boolean limited = plugin.getParkingType(); String parking_name = limited ? getString(R.string.parking_place_limited) : getString(R.string.parking_place); @@ -95,10 +90,9 @@ public class DashParkingFragment extends DashLocationFragment { } ((TextView) mainView.findViewById(R.id.name)).setText(parking_name); ImageView direction = (ImageView) mainView.findViewById(R.id.direction_icon); -// if (loc != null){ -// updateArrow(getActivity(), loc, position, direction, -// (int)getResources().getDimension(R.dimen.dashboard_parking_icon_size), R.drawable.ic_parking_postion_arrow, heading); -// } + if (loc != null){ + distances.add(new DashLocationView(direction, (TextView) mainView.findViewById(R.id.distance), position)); + }