Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2018-01-28 07:06:14 +01:00
commit 9739a2f3bb
8 changed files with 39 additions and 21 deletions

View file

@ -643,7 +643,7 @@ public class OpeningHoursParser {
private boolean off = false;
/**
* Aadditional information or limitation.
* Additional information or limitation.
* https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification#explain:comment
*/
private String comment;
@ -1106,7 +1106,7 @@ public class OpeningHoursParser {
} else if (time > endTime && days[ad] && checkAnotherDay) {
diff = 24 * 60 - endTime + time;
}
if (limit == WITHOUT_TIME_LIMIT || (diff != -1 && diff <= limit || limit == CURRENT_DAY_TIME_LIMIT)) {
if (limit == WITHOUT_TIME_LIMIT || ((diff != -1 && diff <= limit) || limit == CURRENT_DAY_TIME_LIMIT)) {
formatTime(startTime, sb);
break;
}

View file

@ -28,9 +28,7 @@
<string name="av_locations_selected_desc">GPX file with coordinates and data of the selected notes.</string>
<string name="av_locations_all_desc">GPX file with coordinates and data of all notes.</string>
<string name="release_3_0">
\u2022 Detection of stop signs now considers driving direction\n\n
\u2022 New algorithm providing meaningful ascent/descent values for GPX tracks\n\n
\u2022 Terrain (ascent) aware hiking time (Naismith\'s rule)\n\n
\u2022 \n\n
</string>
<string name="modify_the_search_query">Modify the search query.</string>
<string name="shared_string_actions">Actions</string>
@ -340,13 +338,16 @@
\u2022 OsmAnd Live: bug fixes, fresh data on the server every 30 minutes, updates implemented into the navigation\n\n
</string>
<string name="release_2_9">
\u2022 Detection of stop signs now considers driving direction\n\n
\u2022 New algorithm providing meaningful ascent/descent values for GPX tracks\n\n
\u2022 Terrain (ascent) aware hiking time (Naismith\'s rule)\n\n
\u2022 Updated the context menu: show when the POI opens / closes\n\n
\u2022 Transport menu: all available routes are now at the top\n\n
\u2022 Wikipedia: added the button to open the original article, updated the appearance of articles\n\n
\u2022 Route: added possibility to swap start and end points in one tap\n\n
\u2022 Notes: added sorting by type and date\n\n
\u2022 OSM edits: show an icon and a name of the POI category, display completed actions\n\n
\u2022 New quick coordinate input screen for quick markers creation\n\n
\u2022 Route: added possibility to swap start and end points in one tap\n\n
\u2022 Notes: added sorting by type and date\n\n
\u2022 OSM edits: show an icon and a name of the POI category, display completed actions\n\n
\u2022 New quick coordinate input screen for quick markers creation\n\n
</string>
<string name="auto_split_recording_title">Auto-split recordings after gap</string>
<string name="auto_split_recording_descr">Start new segment after gap of 6 min, new track after gap of 2 h, or new file after a longer gap if the date has changed.</string>
@ -2856,4 +2857,6 @@
<string name="winter_and_ski_renderer">Winter and ski</string>
<string name="touring_view_renderer">Touring view (contrast and details)</string>
<string name="nautical_renderer">Nautical</string>
<string name="copy_location_name">Copy Point/POI name</string>
<string name="toast_empty_name_error">Location has no name</string>
</resources>

View file

@ -194,8 +194,8 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
registerListPreference(settings.ARRIVAL_DISTANCE_FACTOR, screen, arrivalNames, arrivalValues);
//array size should be equal!
Float[] speedLimitsKm = new Float[]{0f, 5f, 7f, 10f, 15f, 20f};
Float[] speedLimitsMiles = new Float[]{0f, 3f, 5f, 7f, 10f, 15f};
Float[] speedLimitsKm = new Float[]{-10f, -7f,-5f, 0f, 5f, 7f, 10f, 15f, 20f};
Float[] speedLimitsMiles = new Float[]{-7f, -5f, -3f, 0f, 3f, 5f, 7f, 10f, 15f};
if (settings.METRIC_SYSTEM.get() == OsmandSettings.MetricsConstants.KILOMETERS_AND_METERS) {
String[] speedNames = new String[speedLimitsKm.length];
for (int i =0; i<speedLimitsKm.length;i++){

View file

@ -216,5 +216,7 @@ public class ShareDialog {
public static void sendToClipboard(Activity activity, String text) {
ClipboardManager clipboard = (ClipboardManager) activity.getSystemService(Activity.CLIPBOARD_SERVICE);
clipboard.setText(text);
Toast.makeText(activity, R.string.copied_to_clipboard, Toast.LENGTH_LONG)
.show();
}
}

View file

@ -46,6 +46,7 @@ import net.osmand.AndroidUtils;
import net.osmand.PlatformUtil;
import net.osmand.ValueHolder;
import net.osmand.data.LatLon;
import net.osmand.data.PointDescription;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuAdapter.OnRowItemClick;
@ -1515,7 +1516,8 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
start.start = false;
start.intermediate = startInd != allTargets.size() - 1;
if (targetPointsHelper.getPointToStart() == null) {
start.getOriginalPointDescription().setName(start.getLatitude() + ", " + start.getLongitude());
start.getOriginalPointDescription().setName(PointDescription
.getLocationNamePlain(getMyApplication(), start.getLatitude(), start.getLongitude()));
}
first.start = true;
first.intermediate = false;

View file

@ -5,6 +5,7 @@ import android.net.Uri;
import android.os.Bundle;
import android.support.v4.text.TextUtilsCompat;
import android.support.v4.view.ViewCompat;
import android.widget.Toast;
import net.osmand.data.LatLon;
import net.osmand.plus.R;
@ -30,6 +31,7 @@ public class ShareMenu extends BaseMenuController {
public enum ShareItem {
MESSAGE(R.drawable.ic_action_message, R.string.shared_string_send),
CLIPBOARD(R.drawable.ic_action_copy, R.string.shared_string_copy),
NAME(R.drawable.ic_action_copy, R.string.copy_location_name),
GEO(R.drawable.ic_world_globe_dark, R.string.share_geo),
QR_CODE(R.drawable.ic_action_qrcode, R.string.shared_string_qr_code);
@ -58,6 +60,7 @@ public class ShareMenu extends BaseMenuController {
List<ShareItem> list = new LinkedList<>();
list.add(ShareItem.MESSAGE);
list.add(ShareItem.CLIPBOARD);
list.add(ShareItem.NAME);
list.add(ShareItem.GEO);
list.add(ShareItem.QR_CODE);
return list;
@ -107,6 +110,15 @@ public class ShareMenu extends BaseMenuController {
case CLIPBOARD:
ShareDialog.sendToClipboard(getMapActivity(), sms);
break;
case NAME:
if (!Algorithms.isEmpty(title)) {
ShareDialog.sendToClipboard(getMapActivity(), title);
} else {
Toast.makeText(getMapActivity(),
R.string.toast_empty_name_error,
Toast.LENGTH_LONG).show();
}
break;
case GEO:
Intent mapIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(geoUrl));
getMapActivity().startActivity(mapIntent);

View file

@ -705,9 +705,8 @@ public class MeasurementToolFragment extends BaseOsmAndFragment {
}
@Override
public void onItemClick(View view) {
public void onItemClick(int position) {
if (mapActivity != null && measurementLayer != null) {
int position = pointsRv.indexOfChild(view);
if (pointsListOpened) {
hidePointsList();
}

View file

@ -52,12 +52,6 @@ public class MeasurementToolAdapter extends RecyclerView.Adapter<MeasurementTool
final int backgroundColor = ContextCompat.getColor(mapActivity,
nightMode ? R.color.ctx_menu_info_view_bg_dark : R.color.ctx_menu_info_view_bg_light);
view.setBackgroundColor(backgroundColor);
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
listener.onItemClick(view);
}
});
return new MeasureToolItemVH(view);
}
@ -129,6 +123,12 @@ public class MeasurementToolAdapter extends RecyclerView.Adapter<MeasurementTool
listener.onRemoveClick(holder.getAdapterPosition());
}
});
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
listener.onItemClick(holder.getAdapterPosition());
}
});
}
@Override
@ -174,7 +174,7 @@ public class MeasurementToolAdapter extends RecyclerView.Adapter<MeasurementTool
void onRemoveClick(int position);
void onItemClick(View view);
void onItemClick(int position);
void onDragStarted(RecyclerView.ViewHolder holder);