[android] Add more info to route plan panel #9936
41 changed files with 1053 additions and 207 deletions
|
@ -1608,13 +1608,15 @@ Java_app_organicmaps_Framework_nativeGetRoutePoints(JNIEnv * env, jclass)
|
|||
// Java signature : RouteMarkData(String title, String subtitle,
|
||||
// @RoutePointInfo.RouteMarkType int pointType,
|
||||
// int intermediateIndex, boolean isVisible, boolean isMyPosition,
|
||||
// boolean isPassed, double lat, double lon)
|
||||
// boolean isPassed, double lat, double lon, long timeSec,
|
||||
// String distanceString)
|
||||
static jmethodID const pointConstructor = jni::GetConstructorID(env, pointClazz,
|
||||
"(Ljava/lang/String;Ljava/lang/String;IIZZZDD)V");
|
||||
"(Ljava/lang/String;Ljava/lang/String;IIZZZDDJLjava/lang/String;)V");
|
||||
return jni::ToJavaArray(env, pointClazz, points, [&](JNIEnv * jEnv, RouteMarkData const & data)
|
||||
{
|
||||
jni::TScopedLocalRef const title(env, jni::ToJavaString(env, data.m_title));
|
||||
jni::TScopedLocalRef const subtitle(env, jni::ToJavaString(env, data.m_subTitle));
|
||||
jni::TScopedLocalRef const distance(env, jni::ToJavaString(env, data.m_distance));
|
||||
return env->NewObject(pointClazz, pointConstructor,
|
||||
title.get(), subtitle.get(),
|
||||
static_cast<jint>(data.m_pointType),
|
||||
|
@ -1623,7 +1625,9 @@ Java_app_organicmaps_Framework_nativeGetRoutePoints(JNIEnv * env, jclass)
|
|||
static_cast<jboolean>(data.m_isMyPosition),
|
||||
static_cast<jboolean>(data.m_isPassed),
|
||||
mercator::YToLat(data.m_position.y),
|
||||
mercator::XToLon(data.m_position.x));
|
||||
mercator::XToLon(data.m_position.x),
|
||||
static_cast<jlong>(data.m_timeSec),
|
||||
distance.get());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@ package app.organicmaps.routing;
|
|||
import androidx.annotation.Keep;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import app.organicmaps.util.Distance;
|
||||
|
||||
/**
|
||||
* Represents RouteMarkData from core.
|
||||
*/
|
||||
|
@ -23,11 +25,14 @@ public class RouteMarkData
|
|||
public final boolean mIsPassed;
|
||||
public final double mLat;
|
||||
public final double mLon;
|
||||
public final long mTimeSec;
|
||||
public final String mDistance;
|
||||
|
||||
public RouteMarkData(@Nullable String title, @Nullable String subtitle,
|
||||
@RoutePointInfo.RouteMarkType int pointType,
|
||||
int intermediateIndex, boolean isVisible, boolean isMyPosition,
|
||||
boolean isPassed, double lat, double lon)
|
||||
boolean isPassed, double lat, double lon, long timeSec,
|
||||
String distance)
|
||||
{
|
||||
mTitle = title;
|
||||
mSubtitle = subtitle;
|
||||
|
@ -38,5 +43,7 @@ public class RouteMarkData
|
|||
mIsPassed = isPassed;
|
||||
mLat = lat;
|
||||
mLon = lon;
|
||||
mTimeSec = timeSec;
|
||||
mDistance = distance;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,125 @@
|
|||
package app.organicmaps.routing;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.util.DateUtils;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
|
||||
public class RoutePlanAdapter extends RecyclerView.Adapter<RoutePlanAdapter.RoutePlanViewHolder>
|
||||
{
|
||||
Context mContext;
|
||||
RouteMarkData[] mRouteMarkData;
|
||||
|
||||
public RoutePlanAdapter(Context context, RouteMarkData[] routeMarkData)
|
||||
{
|
||||
mContext = context;
|
||||
|
||||
// Copy all route points, except the first one (starting point).
|
||||
mRouteMarkData = new RouteMarkData[routeMarkData.length - 1];
|
||||
System.arraycopy(routeMarkData, 1, mRouteMarkData, 0, routeMarkData.length - 1);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RoutePlanViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType)
|
||||
{
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.route_plan_list_item,
|
||||
parent, false);
|
||||
|
||||
return new RoutePlanViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RoutePlanViewHolder holder, int position)
|
||||
{
|
||||
int markPos = mRouteMarkData.length - 1 - position;
|
||||
int iconId;
|
||||
|
||||
if (mRouteMarkData[markPos].mPointType == 0)
|
||||
{
|
||||
// Start point.
|
||||
iconId = R.drawable.route_point_start;
|
||||
}
|
||||
else if (mRouteMarkData[markPos].mPointType == 1)
|
||||
{
|
||||
// Intermediate stop.
|
||||
TypedArray iconArray = mContext.getResources().obtainTypedArray(R.array.route_stop_icons);
|
||||
iconId = iconArray.getResourceId(mRouteMarkData[markPos].mIntermediateIndex,
|
||||
R.drawable.route_point_01);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Finish point.
|
||||
iconId = R.drawable.route_point_finish;
|
||||
}
|
||||
|
||||
holder.mImageViewIcon.setImageDrawable(AppCompatResources.getDrawable(mContext, iconId));
|
||||
|
||||
holder.mTextViewEta.setText(DateUtils.getEstimateTimeString(mContext,
|
||||
mRouteMarkData[markPos].mTimeSec));
|
||||
|
||||
if (mRouteMarkData[markPos].mPointType == 0)
|
||||
{
|
||||
UiUtils.hide(holder.mTextViewSeparator1);
|
||||
UiUtils.hide(holder.mTextViewTime);
|
||||
UiUtils.hide(holder.mTextViewSeparator2);
|
||||
UiUtils.hide(holder.mTextViewDistance);
|
||||
}
|
||||
else
|
||||
{
|
||||
holder.mTextViewTime.setText(DateUtils.getRemainingTimeString(mContext,
|
||||
mRouteMarkData[markPos].mTimeSec));
|
||||
|
||||
holder.mTextViewDistance.setText(mRouteMarkData[markPos].mDistance);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount()
|
||||
{
|
||||
return mRouteMarkData.length;
|
||||
}
|
||||
|
||||
static class RoutePlanViewHolder extends RecyclerView.ViewHolder
|
||||
{
|
||||
@NonNull
|
||||
public final ImageView mImageViewIcon;
|
||||
|
||||
@NonNull
|
||||
public final TextView mTextViewEta;
|
||||
|
||||
@NonNull
|
||||
public final TextView mTextViewSeparator1;
|
||||
|
||||
@NonNull
|
||||
public final TextView mTextViewTime;
|
||||
|
||||
@NonNull
|
||||
public final TextView mTextViewSeparator2;
|
||||
|
||||
@NonNull
|
||||
public final TextView mTextViewDistance;
|
||||
|
||||
RoutePlanViewHolder(@NonNull View itemView)
|
||||
{
|
||||
super(itemView);
|
||||
mImageViewIcon = itemView.findViewById(R.id.icon);
|
||||
mTextViewEta = itemView.findViewById(R.id.eta);
|
||||
mTextViewSeparator1 = itemView.findViewById(R.id.separator1);
|
||||
mTextViewTime = itemView.findViewById(R.id.time);
|
||||
mTextViewSeparator2 = itemView.findViewById(R.id.separator2);
|
||||
mTextViewDistance = itemView.findViewById(R.id.distance);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -17,6 +17,8 @@ import android.text.style.ForegroundColorSpan;
|
|||
import android.text.style.StyleSpan;
|
||||
import android.text.style.TypefaceSpan;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ScrollView;
|
||||
|
@ -26,14 +28,17 @@ import androidx.annotation.IdRes;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import app.organicmaps.Framework;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.bookmarks.data.DistanceAndAzimut;
|
||||
import app.organicmaps.location.LocationHelper;
|
||||
import app.organicmaps.util.DateUtils;
|
||||
import app.organicmaps.util.Distance;
|
||||
import app.organicmaps.util.Graphics;
|
||||
import app.organicmaps.util.StringUtils;
|
||||
import app.organicmaps.util.ThemeUtils;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
import app.organicmaps.widget.recycler.DotDividerItemDecoration;
|
||||
|
@ -50,7 +55,7 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||
@NonNull
|
||||
private final Activity mContext;
|
||||
@NonNull
|
||||
private final View mTimeElevationLine;
|
||||
private final View mAltitudeLine;
|
||||
@NonNull
|
||||
private final View mAltitudeChartFrame;
|
||||
@NonNull
|
||||
|
@ -62,13 +67,9 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||
@NonNull
|
||||
private final ImageView mAltitudeChart;
|
||||
@NonNull
|
||||
private final TextView mTime;
|
||||
private final TextView mAltitudeDiffAscent;
|
||||
@NonNull
|
||||
private final TextView mAltitudeDifference;
|
||||
@NonNull
|
||||
private final TextView mTimeVehicle;
|
||||
@Nullable
|
||||
private final TextView mArrival;
|
||||
private final TextView mAltitudeDiffDescent;
|
||||
@NonNull
|
||||
private final View mActionFrame;
|
||||
@NonNull
|
||||
|
@ -79,6 +80,8 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||
private final ImageView mActionIcon;
|
||||
@NonNull
|
||||
private final DotDividerItemDecoration mTransitViewDecorator;
|
||||
@NonNull
|
||||
private final RecyclerView mRoutePlanList;
|
||||
|
||||
@Nullable
|
||||
private final RoutingBottomMenuListener mListener;
|
||||
|
@ -88,20 +91,19 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||
@Nullable RoutingBottomMenuListener listener)
|
||||
{
|
||||
View altitudeChartFrame = getViewById(activity, frame, R.id.altitude_chart_panel);
|
||||
View timeElevationLine = getViewById(activity, frame, R.id.time_elevation_line);
|
||||
View altitudeLine = getViewById(activity, frame, R.id.altitude_line);
|
||||
View transitFrame = getViewById(activity, frame, R.id.transit_panel);
|
||||
TextView error = (TextView) getViewById(activity, frame, R.id.error);
|
||||
Button start = (Button) getViewById(activity, frame, R.id.start);
|
||||
ImageView altitudeChart = (ImageView) getViewById(activity, frame, R.id.altitude_chart);
|
||||
TextView time = (TextView) getViewById(activity, frame, R.id.time);
|
||||
TextView timeVehicle = (TextView) getViewById(activity, frame, R.id.time_vehicle);
|
||||
TextView altitudeDifference = (TextView) getViewById(activity, frame, R.id.altitude_difference);
|
||||
TextView arrival = (TextView) getViewById(activity, frame, R.id.arrival);
|
||||
TextView altitudeDiffAscent = (TextView) getViewById(activity, frame, R.id.altitude_diff_ascent);
|
||||
TextView altitudeDiffDescent = (TextView) getViewById(activity, frame, R.id.altitude_diff_descent);
|
||||
View actionFrame = getViewById(activity, frame, R.id.routing_action_frame);
|
||||
RecyclerView routePlanList = (RecyclerView) getViewById(activity, frame, R.id.route_plan_list);
|
||||
|
||||
return new RoutingBottomMenuController(activity, altitudeChartFrame, timeElevationLine, transitFrame,
|
||||
error, start, altitudeChart, time, altitudeDifference,
|
||||
timeVehicle, arrival, actionFrame, listener);
|
||||
return new RoutingBottomMenuController(activity, altitudeChartFrame, altitudeLine, transitFrame,
|
||||
error, start, altitudeChart, altitudeDiffAscent,
|
||||
altitudeDiffDescent, actionFrame, routePlanList, listener);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
@ -114,29 +116,26 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||
|
||||
private RoutingBottomMenuController(@NonNull Activity context,
|
||||
@NonNull View altitudeChartFrame,
|
||||
@NonNull View timeElevationLine,
|
||||
@NonNull View altitudeLine,
|
||||
@NonNull View transitFrame,
|
||||
@NonNull TextView error,
|
||||
@NonNull Button start,
|
||||
@NonNull ImageView altitudeChart,
|
||||
@NonNull TextView time,
|
||||
@NonNull TextView altitudeDifference,
|
||||
@NonNull TextView timeVehicle,
|
||||
@Nullable TextView arrival,
|
||||
@NonNull TextView altitudeDiffAscent,
|
||||
@NonNull TextView altitudeDiffDescent,
|
||||
@NonNull View actionFrame,
|
||||
@NonNull RecyclerView routePlanList,
|
||||
@Nullable RoutingBottomMenuListener listener)
|
||||
{
|
||||
mContext = context;
|
||||
mAltitudeChartFrame = altitudeChartFrame;
|
||||
mTimeElevationLine = timeElevationLine;
|
||||
mAltitudeLine = altitudeLine;
|
||||
mTransitFrame = transitFrame;
|
||||
mError = error;
|
||||
mStart = start;
|
||||
mAltitudeChart = altitudeChart;
|
||||
mTime = time;
|
||||
mAltitudeDifference = altitudeDifference;
|
||||
mTimeVehicle = timeVehicle;
|
||||
mArrival = arrival;
|
||||
mAltitudeDiffAscent = altitudeDiffAscent;
|
||||
mAltitudeDiffDescent = altitudeDiffDescent;
|
||||
mActionFrame = actionFrame;
|
||||
mActionMessage = actionFrame.findViewById(R.id.tv__message);
|
||||
mActionButton = actionFrame.findViewById(R.id.btn__my_position_use);
|
||||
|
@ -149,13 +148,16 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||
int dividerRes = ThemeUtils.getResource(mContext, R.attr.transitStepDivider);
|
||||
Drawable dividerDrawable = ContextCompat.getDrawable(mContext, dividerRes);
|
||||
Resources res = mContext.getResources();
|
||||
mTransitViewDecorator = new DotDividerItemDecoration(dividerDrawable, res.getDimensionPixelSize(R.dimen.margin_base),
|
||||
mTransitViewDecorator = new DotDividerItemDecoration(dividerDrawable,
|
||||
res.getDimensionPixelSize(R.dimen.margin_base),
|
||||
res.getDimensionPixelSize(R.dimen.margin_half));
|
||||
mRoutePlanList = routePlanList;
|
||||
mRoutePlanList.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
}
|
||||
|
||||
void showAltitudeChartAndRoutingDetails()
|
||||
{
|
||||
UiUtils.hide(mError, mActionFrame, mAltitudeChart, mTimeElevationLine, mTransitFrame);
|
||||
UiUtils.hide(mError, mActionFrame, mAltitudeChart, mAltitudeLine, mTransitFrame);
|
||||
|
||||
if (!RoutingController.get().isVehicleRouterType() && !RoutingController.get().isRulerRouterType())
|
||||
showRouteAltitudeChart();
|
||||
|
@ -185,13 +187,19 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||
|
||||
scrollToBottom(rv);
|
||||
|
||||
TextView estimatedTimeOfArrivalView = mTransitFrame.findViewById(R.id.estimated_time_of_arrival);
|
||||
estimatedTimeOfArrivalView.setText(DateUtils.getEstimateTimeString(mContext, info.getTotalTime()));
|
||||
UiUtils.show(mTransitFrame, estimatedTimeOfArrivalView);
|
||||
|
||||
UiUtils.show(mTransitFrame, R.id.dot1);
|
||||
|
||||
TextView totalTimeView = mTransitFrame.findViewById(R.id.total_time);
|
||||
totalTimeView.setText(RoutingController.formatRoutingTime(mContext, info.getTotalTime(),
|
||||
R.dimen.text_size_routing_number));
|
||||
View dotView = mTransitFrame.findViewById(R.id.dot);
|
||||
View dot2View = mTransitFrame.findViewById(R.id.dot2);
|
||||
View pedestrianIcon = mTransitFrame.findViewById(R.id.pedestrian_icon);
|
||||
TextView distanceView = mTransitFrame.findViewById(R.id.total_distance);
|
||||
UiUtils.showIf(info.getTotalPedestrianTimeInSec() > 0, dotView, pedestrianIcon, distanceView);
|
||||
UiUtils.showIf(info.getTotalPedestrianTimeInSec() > 0, dot2View, pedestrianIcon, distanceView);
|
||||
distanceView.setText(info.getTotalPedestrianDistance() + " " + info.getTotalPedestrianDistanceUnits());
|
||||
}
|
||||
|
||||
|
@ -216,13 +224,15 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||
scrollToBottom(rv);
|
||||
}
|
||||
else
|
||||
UiUtils.hide(rv); // Show only distance between start and finish
|
||||
UiUtils.hide(rv); // Show only distance between start and finish.
|
||||
|
||||
TextView totalTimeView = mTransitFrame.findViewById(R.id.total_time);
|
||||
totalTimeView.setText(mContext.getString(R.string.placepage_distance) + ": " +
|
||||
totalLength.mDistanceStr + " " + totalLength.getUnitsStr(mContext));
|
||||
|
||||
UiUtils.hide(mTransitFrame, R.id.dot);
|
||||
UiUtils.hide(mTransitFrame, R.id.estimated_time_of_arrival);
|
||||
UiUtils.hide(mTransitFrame, R.id.dot1);
|
||||
UiUtils.hide(mTransitFrame, R.id.dot2);
|
||||
UiUtils.hide(mTransitFrame, R.id.pedestrian_icon);
|
||||
UiUtils.hide(mTransitFrame, R.id.total_distance);
|
||||
}
|
||||
|
@ -330,11 +340,11 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||
{
|
||||
if (RoutingController.get().isVehicleRouterType())
|
||||
{
|
||||
UiUtils.hide(mTimeElevationLine, mAltitudeChart);
|
||||
UiUtils.hide(mAltitudeLine, mAltitudeChart);
|
||||
return;
|
||||
}
|
||||
|
||||
UiUtils.hide(mTimeVehicle);
|
||||
UiUtils.show(mAltitudeLine, mAltitudeChart);
|
||||
|
||||
int chartWidth = UiUtils.dimen(mContext, R.dimen.altitude_chart_image_width);
|
||||
int chartHeight = UiUtils.dimen(mContext, R.dimen.altitude_chart_image_height);
|
||||
|
@ -344,39 +354,23 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||
{
|
||||
mAltitudeChart.setImageBitmap(bm);
|
||||
UiUtils.show(mAltitudeChart);
|
||||
final String unit = limits.isMetricUnits ? mAltitudeDifference.getResources().getString(R.string.m) : mAltitudeDifference.getResources().getString(R.string.ft);
|
||||
mAltitudeDifference.setText("↗ " + limits.totalAscentString + " " + unit +
|
||||
" ↘ " + limits.totalDescentString + " " + unit);
|
||||
UiUtils.show(mAltitudeDifference);
|
||||
final String unit = limits.isMetricUnits ? mAltitudeDiffAscent.getResources().getString(R.string.m) :
|
||||
mAltitudeDiffAscent.getResources().getString(R.string.ft);
|
||||
mAltitudeDiffAscent.setText(limits.totalAscentString + StringUtils.kNarrowNonBreakingSpace + unit);
|
||||
mAltitudeDiffDescent.setText(limits.totalDescentString + StringUtils.kNarrowNonBreakingSpace + unit);
|
||||
|
||||
UiUtils.show(mAltitudeDiffAscent, mAltitudeDiffDescent);
|
||||
}
|
||||
}
|
||||
|
||||
private void showRoutingDetails()
|
||||
{
|
||||
// Show route plan info.
|
||||
mRoutePlanList.setAdapter(new RoutePlanAdapter(mContext, Framework.nativeGetRoutePoints()));
|
||||
|
||||
final RoutingInfo rinfo = RoutingController.get().getCachedRoutingInfo();
|
||||
if (rinfo == null)
|
||||
{
|
||||
UiUtils.hide(mTimeElevationLine, mTimeVehicle);
|
||||
return;
|
||||
}
|
||||
|
||||
Spanned spanned = makeSpannedRoutingDetails(mContext, rinfo);
|
||||
if (RoutingController.get().isVehicleRouterType())
|
||||
{
|
||||
UiUtils.show(mTimeVehicle);
|
||||
mTimeVehicle.setText(spanned);
|
||||
}
|
||||
else
|
||||
{
|
||||
UiUtils.show(mTimeElevationLine);
|
||||
mTime.setText(spanned);
|
||||
}
|
||||
|
||||
if (mArrival != null)
|
||||
{
|
||||
String arrivalTime = RoutingController.formatArrivalTime(rinfo.totalTimeInSeconds);
|
||||
mArrival.setText(arrivalTime);
|
||||
}
|
||||
UiUtils.hide(mAltitudeLine);
|
||||
}
|
||||
|
||||
// Scroll RecyclerView to bottom using parent ScrollView.
|
||||
|
@ -389,7 +383,6 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||
|
||||
@NonNull
|
||||
private static Spanned makeSpannedRoutingDetails(@NonNull Context context, @NonNull RoutingInfo routingInfo)
|
||||
|
||||
{
|
||||
CharSequence time = RoutingController.formatRoutingTime(context,
|
||||
routingInfo.totalTimeInSeconds,
|
||||
|
|
|
@ -6,7 +6,12 @@ import androidx.annotation.Keep;
|
|||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import app.organicmaps.R;
|
||||
|
||||
public final class DateUtils
|
||||
{
|
||||
|
@ -27,4 +32,28 @@ public final class DateUtils
|
|||
{
|
||||
return android.text.format.DateFormat.is24HourFormat(context);
|
||||
}
|
||||
|
||||
public static String getEstimateTimeString(@NonNull Context context, long seconds)
|
||||
{
|
||||
final String format = android.text.format.DateFormat.is24HourFormat(context)? "HH:mm" : "h:mm a";
|
||||
final LocalTime localTime = LocalTime.now().plusSeconds(seconds);
|
||||
return localTime.format(DateTimeFormatter.ofPattern(format));
|
||||
}
|
||||
|
||||
public static String getRemainingTimeString(@NonNull Context context, long seconds)
|
||||
{
|
||||
final long hours = TimeUnit.SECONDS.toHours(seconds);
|
||||
final long minutes = TimeUnit.SECONDS.toMinutes(seconds) % 60;
|
||||
|
||||
String timeString = "";
|
||||
|
||||
if (hours != 0)
|
||||
timeString = String.valueOf(hours) + StringUtils.kNarrowNonBreakingSpace +
|
||||
context.getResources().getString(R.string.hour) + " ";
|
||||
|
||||
timeString += String.valueOf(minutes) + StringUtils.kNarrowNonBreakingSpace +
|
||||
context.getResources().getString(R.string.minute);
|
||||
|
||||
return timeString;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,8 @@ import java.util.Locale;
|
|||
|
||||
public class StringUtils
|
||||
{
|
||||
final public static String kNarrowNonBreakingSpace = "\u202F";
|
||||
|
||||
public static String formatUsingUsLocale(String pattern, Object... args)
|
||||
{
|
||||
return String.format(Locale.US, pattern, args);
|
||||
|
|
|
@ -114,6 +114,21 @@ public final class UiUtils
|
|||
v.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
public static void show(View frame, @IdRes int viewId)
|
||||
{
|
||||
View view = frame.findViewById(viewId);
|
||||
if (view == null)
|
||||
return;
|
||||
|
||||
show(view);
|
||||
}
|
||||
|
||||
public static void show(View frame, @IdRes int... viewIds)
|
||||
{
|
||||
for (final int id : viewIds)
|
||||
show(frame, id);
|
||||
}
|
||||
|
||||
public static void invisible(View... views)
|
||||
{
|
||||
for (final View v : views)
|
||||
|
|
|
@ -16,6 +16,7 @@ import app.organicmaps.R;
|
|||
import app.organicmaps.location.LocationHelper;
|
||||
import app.organicmaps.routing.RoutingInfo;
|
||||
import app.organicmaps.sound.TtsPlayer;
|
||||
import app.organicmaps.util.DateUtils;
|
||||
import app.organicmaps.util.Graphics;
|
||||
import app.organicmaps.util.StringUtils;
|
||||
import app.organicmaps.util.ThemeUtils;
|
||||
|
@ -200,10 +201,8 @@ public class NavMenu
|
|||
|
||||
private void updateTimeEstimate(int seconds)
|
||||
{
|
||||
final String format = android.text.format.DateFormat.is24HourFormat(mTimeMinuteValue.getContext())
|
||||
? "HH:mm" : "h:mm a";
|
||||
final LocalTime localTime = LocalTime.now().plusSeconds(seconds);
|
||||
mTimeEstimate.setText(localTime.format(DateTimeFormatter.ofPattern(format)));
|
||||
mTimeEstimate.setText(DateUtils.getEstimateTimeString(mTimeMinuteValue.getContext(),
|
||||
seconds));
|
||||
}
|
||||
|
||||
private void updateSpeedView(@NonNull RoutingInfo info)
|
||||
|
|
19
android/app/src/main/res/drawable/route_point_01.xml
Normal file
19
android/app/src/main/res/drawable/route_point_01.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14,14m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeAlpha="0.35"
|
||||
android:fillAlpha="0.35"/>
|
||||
<path
|
||||
android:pathData="M14,13m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#006c35"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m15.251,17h-1.693v-6.527l-2.022,0.627v-1.377l3.533,-1.266h0.182z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
19
android/app/src/main/res/drawable/route_point_02.xml
Normal file
19
android/app/src/main/res/drawable/route_point_02.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14,14m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeAlpha="0.35"
|
||||
android:fillAlpha="0.35"/>
|
||||
<path
|
||||
android:pathData="M14,13m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#006c35"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m16.985,17h-5.848v-1.16l2.76,-2.941q0.568,-0.621 0.838,-1.084 0.275,-0.463 0.275,-0.879 0,-0.568 -0.287,-0.891 -0.287,-0.328 -0.82,-0.328 -0.574,0 -0.908,0.398 -0.328,0.393 -0.328,1.037h-1.699q0,-0.779 0.369,-1.424 0.375,-0.645 1.055,-1.008 0.68,-0.369 1.541,-0.369 1.318,0 2.045,0.633 0.732,0.633 0.732,1.787 0,0.633 -0.328,1.289t-1.125,1.529l-1.939,2.045h3.668z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
19
android/app/src/main/res/drawable/route_point_03.xml
Normal file
19
android/app/src/main/res/drawable/route_point_03.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14,14m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeAlpha="0.35"
|
||||
android:fillAlpha="0.35"/>
|
||||
<path
|
||||
android:pathData="M14,13m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#006c35"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m12.86,11.984h0.902q0.645,0 0.955,-0.322 0.311,-0.322 0.311,-0.855 0,-0.516 -0.311,-0.803 -0.305,-0.287 -0.844,-0.287 -0.486,0 -0.814,0.27 -0.328,0.264 -0.328,0.691h-1.693q0,-0.668 0.357,-1.195 0.363,-0.533 1.008,-0.832 0.65,-0.299 1.43,-0.299 1.354,0 2.121,0.65 0.768,0.645 0.768,1.781 0,0.586 -0.357,1.078 -0.357,0.492 -0.938,0.756 0.721,0.258 1.072,0.773 0.357,0.516 0.357,1.219 0,1.137 -0.832,1.822 -0.826,0.686 -2.191,0.686 -1.277,0 -2.092,-0.674 -0.809,-0.674 -0.809,-1.781h1.693q0,0.48 0.357,0.785 0.363,0.305 0.891,0.305 0.604,0 0.943,-0.316 0.346,-0.322 0.346,-0.85 0,-1.277 -1.406,-1.277h-0.896z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
19
android/app/src/main/res/drawable/route_point_04.xml
Normal file
19
android/app/src/main/res/drawable/route_point_04.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14,14m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeAlpha="0.35"
|
||||
android:fillAlpha="0.35"/>
|
||||
<path
|
||||
android:pathData="M14,13m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#006c35"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m16.147,13.789h0.967v1.365h-0.967v1.846h-1.693v-1.846h-3.498l-0.076,-1.066 3.557,-5.619h1.711zM12.567,13.789h1.887v-3.012l-0.111,0.193z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
19
android/app/src/main/res/drawable/route_point_05.xml
Normal file
19
android/app/src/main/res/drawable/route_point_05.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14,14m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeAlpha="0.35"
|
||||
android:fillAlpha="0.35"/>
|
||||
<path
|
||||
android:pathData="M14,13m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#006c35"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m11.39,12.805 l0.492,-4.336h4.781v1.412h-3.393l-0.211,1.834q0.604,-0.322 1.283,-0.322 1.219,0 1.91,0.756 0.691,0.756 0.691,2.115 0,0.826 -0.352,1.482 -0.346,0.65 -0.996,1.014 -0.65,0.357 -1.535,0.357 -0.773,0 -1.436,-0.311 -0.662,-0.316 -1.049,-0.885 -0.381,-0.568 -0.404,-1.295h1.676q0.053,0.533 0.369,0.832 0.322,0.293 0.838,0.293 0.574,0 0.885,-0.41 0.311,-0.416 0.311,-1.172 0,-0.727 -0.357,-1.113 -0.357,-0.387 -1.014,-0.387 -0.604,0 -0.979,0.316l-0.164,0.152z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
19
android/app/src/main/res/drawable/route_point_06.xml
Normal file
19
android/app/src/main/res/drawable/route_point_06.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14,14m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeAlpha="0.35"
|
||||
android:fillAlpha="0.35"/>
|
||||
<path
|
||||
android:pathData="M14,13m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#006c35"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m15.731,8.381v1.395h-0.164q-1.148,0.018 -1.852,0.598 -0.697,0.58 -0.838,1.611 0.68,-0.691 1.717,-0.691 1.113,0 1.77,0.797t0.656,2.098q0,0.832 -0.363,1.506 -0.357,0.674 -1.02,1.049 -0.656,0.375 -1.488,0.375 -1.348,0 -2.18,-0.938 -0.826,-0.938 -0.826,-2.502v-0.609q0,-1.389 0.521,-2.449 0.527,-1.066 1.506,-1.646 0.984,-0.586 2.279,-0.592zM14.079,12.652q-0.41,0 -0.744,0.217 -0.334,0.211 -0.492,0.563v0.516q0,0.85 0.334,1.33 0.334,0.475 0.938,0.475 0.545,0 0.879,-0.428 0.34,-0.434 0.34,-1.119 0,-0.697 -0.34,-1.125 -0.34,-0.428 -0.914,-0.428z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
19
android/app/src/main/res/drawable/route_point_07.xml
Normal file
19
android/app/src/main/res/drawable/route_point_07.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14,14m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeAlpha="0.35"
|
||||
android:fillAlpha="0.35"/>
|
||||
<path
|
||||
android:pathData="M14,13m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#006c35"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m16.938,9.418 l-3.299,7.582h-1.787l3.305,-7.16h-4.242v-1.371h6.023z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
19
android/app/src/main/res/drawable/route_point_08.xml
Normal file
19
android/app/src/main/res/drawable/route_point_08.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14,14m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeAlpha="0.35"
|
||||
android:fillAlpha="0.35"/>
|
||||
<path
|
||||
android:pathData="M14,13m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#006c35"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m16.698,10.736q0,0.621 -0.311,1.102 -0.311,0.48 -0.855,0.768 0.621,0.299 0.984,0.826 0.363,0.521 0.363,1.23 0,1.137 -0.773,1.799 -0.773,0.656 -2.103,0.656t-2.109,-0.662 -0.779,-1.793q0,-0.709 0.363,-1.236 0.363,-0.527 0.979,-0.82 -0.545,-0.287 -0.855,-0.768 -0.305,-0.48 -0.305,-1.102 0,-1.09 0.727,-1.734 0.727,-0.65 1.975,-0.65 1.242,0 1.969,0.645 0.732,0.639 0.732,1.74zM15.18,14.539q0,-0.557 -0.322,-0.891 -0.322,-0.334 -0.867,-0.334 -0.539,0 -0.861,0.334 -0.322,0.328 -0.322,0.891 0,0.545 0.316,0.879 0.316,0.334 0.879,0.334 0.551,0 0.861,-0.322 0.316,-0.322 0.316,-0.891zM15.005,10.818q0,-0.498 -0.264,-0.797 -0.264,-0.305 -0.744,-0.305 -0.475,0 -0.738,0.293 -0.264,0.293 -0.264,0.809 0,0.51 0.264,0.82t0.744,0.311q0.48,0 0.738,-0.311 0.264,-0.311 0.264,-0.82z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
19
android/app/src/main/res/drawable/route_point_09.xml
Normal file
19
android/app/src/main/res/drawable/route_point_09.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14,14m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeAlpha="0.35"
|
||||
android:fillAlpha="0.35"/>
|
||||
<path
|
||||
android:pathData="M14,13m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#006c35"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m15.099,13.59q-0.662,0.65 -1.547,0.65 -1.131,0 -1.811,-0.773 -0.68,-0.779 -0.68,-2.098 0,-0.838 0.363,-1.535 0.369,-0.703 1.025,-1.09 0.656,-0.393 1.477,-0.393 0.844,0 1.5,0.422t1.02,1.213q0.363,0.791 0.369,1.811v0.627q0,2.133 -1.061,3.352t-3.006,1.301l-0.416,0.006v-1.412l0.375,-0.006q2.209,-0.1 2.391,-2.074zM13.968,12.945q0.41,0 0.703,-0.211 0.299,-0.211 0.451,-0.51v-0.697q0,-0.861 -0.328,-1.336 -0.328,-0.475 -0.879,-0.475 -0.51,0 -0.838,0.469 -0.328,0.463 -0.328,1.166 0,0.697 0.316,1.148 0.322,0.445 0.902,0.445z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
19
android/app/src/main/res/drawable/route_point_10.xml
Normal file
19
android/app/src/main/res/drawable/route_point_10.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14,14m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeAlpha="0.35"
|
||||
android:fillAlpha="0.35"/>
|
||||
<path
|
||||
android:pathData="M14,13m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#006c35"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m11.809,17h-1.693v-6.527l-2.022,0.627v-1.377l3.533,-1.266h0.182zM20.323,13.473q0,1.77 -0.732,2.707 -0.732,0.938 -2.145,0.938 -1.395,0 -2.133,-0.92 -0.738,-0.92 -0.756,-2.637v-1.57q0,-1.787 0.738,-2.713 0.744,-0.926 2.139,-0.926 1.395,0 2.133,0.92 0.738,0.914 0.756,2.631zM18.629,11.75q0,-1.061 -0.293,-1.541 -0.287,-0.486 -0.902,-0.486 -0.598,0 -0.885,0.463 -0.281,0.457 -0.299,1.436v2.074q0,1.043 0.281,1.553 0.287,0.504 0.914,0.504 0.621,0 0.896,-0.486 0.275,-0.486 0.287,-1.488z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
19
android/app/src/main/res/drawable/route_point_11.xml
Normal file
19
android/app/src/main/res/drawable/route_point_11.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14,14m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeAlpha="0.35"
|
||||
android:fillAlpha="0.35"/>
|
||||
<path
|
||||
android:pathData="M14,13m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#006c35"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m11.809,17h-1.693v-6.527l-2.022,0.627v-1.377l3.533,-1.266h0.182zM18.694,17h-1.693v-6.527l-2.022,0.627v-1.377l3.533,-1.266h0.182z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
19
android/app/src/main/res/drawable/route_point_12.xml
Normal file
19
android/app/src/main/res/drawable/route_point_12.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14,14m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeAlpha="0.35"
|
||||
android:fillAlpha="0.35"/>
|
||||
<path
|
||||
android:pathData="M14,13m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#006c35"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m11.809,17h-1.693v-6.527l-2.022,0.627v-1.377l3.533,-1.266h0.182zM20.428,17h-5.848v-1.16l2.76,-2.941q0.568,-0.621 0.838,-1.084 0.275,-0.463 0.275,-0.879 0,-0.568 -0.287,-0.891 -0.287,-0.328 -0.82,-0.328 -0.574,0 -0.908,0.398 -0.328,0.393 -0.328,1.037h-1.699q0,-0.779 0.369,-1.424 0.375,-0.645 1.055,-1.008 0.68,-0.369 1.541,-0.369 1.318,0 2.045,0.633 0.732,0.633 0.732,1.787 0,0.633 -0.328,1.289t-1.125,1.529l-1.939,2.045h3.668z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
19
android/app/src/main/res/drawable/route_point_13.xml
Normal file
19
android/app/src/main/res/drawable/route_point_13.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14,14m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeAlpha="0.35"
|
||||
android:fillAlpha="0.35"/>
|
||||
<path
|
||||
android:pathData="M14,13m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#006c35"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m11.809,17h-1.693v-6.527l-2.022,0.627v-1.377l3.533,-1.266h0.182zM16.303,11.984h0.902q0.645,0 0.955,-0.322 0.311,-0.322 0.311,-0.855 0,-0.516 -0.311,-0.803 -0.305,-0.287 -0.844,-0.287 -0.486,0 -0.814,0.27 -0.328,0.264 -0.328,0.691h-1.693q0,-0.668 0.357,-1.195 0.363,-0.533 1.008,-0.832 0.65,-0.299 1.43,-0.299 1.354,0 2.121,0.65 0.768,0.645 0.768,1.781 0,0.586 -0.357,1.078 -0.357,0.492 -0.938,0.756 0.721,0.258 1.072,0.773 0.357,0.516 0.357,1.219 0,1.137 -0.832,1.822 -0.826,0.686 -2.191,0.686 -1.277,0 -2.092,-0.674 -0.809,-0.674 -0.809,-1.781h1.693q0,0.48 0.357,0.785 0.363,0.305 0.891,0.305 0.604,0 0.943,-0.316 0.346,-0.322 0.346,-0.85 0,-1.277 -1.406,-1.277h-0.896z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
19
android/app/src/main/res/drawable/route_point_14.xml
Normal file
19
android/app/src/main/res/drawable/route_point_14.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14,14m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeAlpha="0.35"
|
||||
android:fillAlpha="0.35"/>
|
||||
<path
|
||||
android:pathData="M14,13m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#006c35"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m11.809,17h-1.693v-6.527l-2.022,0.627v-1.377l3.533,-1.266h0.182zM19.59,13.789h0.967v1.365h-0.967v1.846h-1.693v-1.846h-3.498l-0.076,-1.066 3.557,-5.619h1.711zM16.01,13.789h1.887v-3.012l-0.111,0.193z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
19
android/app/src/main/res/drawable/route_point_15.xml
Normal file
19
android/app/src/main/res/drawable/route_point_15.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14,14m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeAlpha="0.35"
|
||||
android:fillAlpha="0.35"/>
|
||||
<path
|
||||
android:pathData="M14,13m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#006c35"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m11.809,17h-1.693v-6.527l-2.022,0.627v-1.377l3.533,-1.266h0.182zM14.832,12.805 L15.325,8.469h4.781v1.412h-3.393l-0.211,1.834q0.604,-0.322 1.283,-0.322 1.219,0 1.91,0.756 0.691,0.756 0.691,2.115 0,0.826 -0.352,1.482 -0.346,0.65 -0.996,1.014 -0.65,0.357 -1.535,0.357 -0.773,0 -1.436,-0.311 -0.662,-0.316 -1.049,-0.885 -0.381,-0.568 -0.404,-1.295h1.676q0.053,0.533 0.369,0.832 0.322,0.293 0.838,0.293 0.574,0 0.885,-0.41 0.311,-0.416 0.311,-1.172 0,-0.727 -0.357,-1.113 -0.357,-0.387 -1.014,-0.387 -0.604,0 -0.979,0.316l-0.164,0.152z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
19
android/app/src/main/res/drawable/route_point_16.xml
Normal file
19
android/app/src/main/res/drawable/route_point_16.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14,14m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeAlpha="0.35"
|
||||
android:fillAlpha="0.35"/>
|
||||
<path
|
||||
android:pathData="M14,13m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#006c35"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m11.809,17h-1.693v-6.527l-2.022,0.627v-1.377l3.533,-1.266h0.182zM19.174,8.381v1.395h-0.164q-1.148,0.018 -1.852,0.598 -0.697,0.58 -0.838,1.611 0.68,-0.691 1.717,-0.691 1.113,0 1.77,0.797t0.656,2.098q0,0.832 -0.363,1.506 -0.357,0.674 -1.02,1.049 -0.656,0.375 -1.488,0.375 -1.348,0 -2.18,-0.938 -0.826,-0.938 -0.826,-2.502v-0.609q0,-1.389 0.521,-2.449 0.527,-1.066 1.506,-1.646 0.984,-0.586 2.279,-0.592zM17.522,12.652q-0.41,0 -0.744,0.217 -0.334,0.211 -0.492,0.563v0.516q0,0.85 0.334,1.33 0.334,0.475 0.938,0.475 0.545,0 0.879,-0.428 0.34,-0.434 0.34,-1.119 0,-0.697 -0.34,-1.125 -0.34,-0.428 -0.914,-0.428z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
19
android/app/src/main/res/drawable/route_point_17.xml
Normal file
19
android/app/src/main/res/drawable/route_point_17.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14,14m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeAlpha="0.35"
|
||||
android:fillAlpha="0.35"/>
|
||||
<path
|
||||
android:pathData="M14,13m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#006c35"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m11.809,17h-1.693v-6.527l-2.022,0.627v-1.377l3.533,-1.266h0.182zM20.381,9.418 L17.083,17h-1.787l3.305,-7.16h-4.242v-1.371h6.023z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
19
android/app/src/main/res/drawable/route_point_18.xml
Normal file
19
android/app/src/main/res/drawable/route_point_18.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14,14m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeAlpha="0.35"
|
||||
android:fillAlpha="0.35"/>
|
||||
<path
|
||||
android:pathData="M14,13m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#006c35"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m11.809,17h-1.693v-6.527l-2.022,0.627v-1.377l3.533,-1.266h0.182zM20.141,10.736q0,0.621 -0.311,1.102 -0.311,0.48 -0.855,0.768 0.621,0.299 0.984,0.826 0.363,0.521 0.363,1.23 0,1.137 -0.773,1.799 -0.773,0.656 -2.103,0.656 -1.33,0 -2.109,-0.662 -0.779,-0.662 -0.779,-1.793 0,-0.709 0.363,-1.236 0.363,-0.527 0.979,-0.82 -0.545,-0.287 -0.855,-0.768 -0.305,-0.48 -0.305,-1.102 0,-1.09 0.727,-1.734 0.727,-0.65 1.975,-0.65 1.242,0 1.969,0.645 0.732,0.639 0.732,1.74zM18.623,14.539q0,-0.557 -0.322,-0.891 -0.322,-0.334 -0.867,-0.334 -0.539,0 -0.861,0.334 -0.322,0.328 -0.322,0.891 0,0.545 0.316,0.879 0.316,0.334 0.879,0.334 0.551,0 0.861,-0.322 0.316,-0.322 0.316,-0.891zM18.448,10.818q0,-0.498 -0.264,-0.797 -0.264,-0.305 -0.744,-0.305 -0.475,0 -0.738,0.293 -0.264,0.293 -0.264,0.809 0,0.51 0.264,0.82t0.744,0.311q0.48,0 0.738,-0.311 0.264,-0.311 0.264,-0.82z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
19
android/app/src/main/res/drawable/route_point_19.xml
Normal file
19
android/app/src/main/res/drawable/route_point_19.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14,14m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeAlpha="0.35"
|
||||
android:fillAlpha="0.35"/>
|
||||
<path
|
||||
android:pathData="M14,13m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#006c35"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m11.809,17h-1.693v-6.527l-2.022,0.627v-1.377l3.533,-1.266h0.182zM18.541,13.59q-0.662,0.65 -1.547,0.65 -1.131,0 -1.811,-0.773 -0.68,-0.779 -0.68,-2.098 0,-0.838 0.363,-1.535 0.369,-0.703 1.025,-1.09 0.656,-0.393 1.477,-0.393 0.844,0 1.5,0.422t1.02,1.213q0.363,0.791 0.369,1.811v0.627q0,2.133 -1.061,3.352 -1.061,1.219 -3.006,1.301l-0.416,0.006v-1.412l0.375,-0.006q2.209,-0.1 2.391,-2.074zM17.411,12.945q0.41,0 0.703,-0.211 0.299,-0.211 0.451,-0.51v-0.697q0,-0.861 -0.328,-1.336 -0.328,-0.475 -0.879,-0.475 -0.51,0 -0.838,0.469 -0.328,0.463 -0.328,1.166 0,0.697 0.316,1.148 0.322,0.445 0.902,0.445z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
19
android/app/src/main/res/drawable/route_point_20.xml
Normal file
19
android/app/src/main/res/drawable/route_point_20.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="28dp"
|
||||
android:height="28dp"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14,14m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeAlpha="0.35"
|
||||
android:fillAlpha="0.35"/>
|
||||
<path
|
||||
android:pathData="M14,13m-11,0a11,11 0,1 1,22 0a11,11 0,1 1,-22 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#006c35"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:pathData="m8.598,16.168q0,-0.404 0.27,-0.656 0.275,-0.252 0.686,-0.252 0.416,0 0.686,0.252 0.275,0.252 0.275,0.656 0,0.398 -0.27,0.65 -0.27,0.246 -0.691,0.246 -0.416,0 -0.686,-0.246 -0.27,-0.252 -0.27,-0.65zM8.598,11.369q0,-0.404 0.27,-0.656 0.275,-0.252 0.686,-0.252 0.416,0 0.686,0.252 0.275,0.252 0.275,0.656 0,0.398 -0.27,0.65 -0.27,0.246 -0.691,0.246 -0.416,0 -0.686,-0.246 -0.27,-0.252 -0.27,-0.65zM15.195,14.029h-3.299v-1.365h3.299zM19.473,13.666q0,1.324 -0.381,2.549 -0.381,1.225 -1.096,2.162 -0.715,0.938 -1.529,1.289l-0.328,-0.896q0.832,-0.627 1.313,-1.934 0.48,-1.307 0.498,-3.006v-0.311q0,-1.752 -0.48,-3.088 -0.475,-1.336 -1.33,-2.004l0.328,-0.896q0.797,0.346 1.5,1.254 0.709,0.908 1.096,2.115 0.393,1.207 0.41,2.502z"
|
||||
android:fillColor="#fff"/>
|
||||
</vector>
|
BIN
android/app/src/main/res/drawable/route_point_finish.png
Normal file
BIN
android/app/src/main/res/drawable/route_point_finish.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.2 KiB |
BIN
android/app/src/main/res/drawable/route_point_start.png
Normal file
BIN
android/app/src/main/res/drawable/route_point_start.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
|
@ -1,77 +1,139 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/altitude_chart_panel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginTop="@dimen/margin_half"
|
||||
android:layout_marginBottom="@dimen/margin_half"
|
||||
android:paddingStart="@dimen/altitude_chart_container_padding_left"
|
||||
android:paddingEnd="@dimen/altitude_chart_container_padding_left"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
tools:showIn="@layout/fragment_routing">
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/altitude_chart_panel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginTop="@dimen/margin_half"
|
||||
android:layout_marginBottom="@dimen/margin_half"
|
||||
android:paddingStart="@dimen/altitude_chart_container_padding_left"
|
||||
android:paddingEnd="@dimen/altitude_chart_container_padding_left"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
tools:showIn="@layout/fragment_routing">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:maxHeight="100dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/route_plan_list"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:scrollbars="vertical"
|
||||
app:layout_constraintHeight="true"
|
||||
app:layout_constraintHeight_default="wrap"
|
||||
app:layout_constraintHeight_max="100dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:itemCount="3"
|
||||
tools:listitem="@layout/route_plan_list_item"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/time_elevation_line"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginEnd="@dimen/margin_base"
|
||||
android:layout_gravity="center_vertical" >
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
tools:text="5 h 55 min • 1555km"
|
||||
tools:visibility="visible" />
|
||||
android:id="@+id/altitude_line"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/altitude_chart"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="0dp"
|
||||
android:scaleType="fitXY"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/altitude_difference"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_height="@dimen/altitude_chart_time_distance_height"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3"
|
||||
android:fontFamily="@string/robotoMedium"
|
||||
android:text="↗"
|
||||
android:textColor="?colorAccent"
|
||||
tools:ignore="HardcodedText"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/altitude_chart_time_distance_height"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3"
|
||||
android:fontFamily="@string/robotoMedium"
|
||||
android:text="↘"
|
||||
android:textColor="?colorAccent"
|
||||
tools:ignore="HardcodedText"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/altitude_diff_ascent"
|
||||
android:layout_gravity="end"
|
||||
android:layout_height="@dimen/altitude_chart_time_distance_height"
|
||||
android:layout_width="wrap_content"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3"
|
||||
android:fontFamily="@string/robotoMedium"
|
||||
android:textColor="?colorAccent"
|
||||
android:gravity="center"
|
||||
tools:text="↗ 43 m ↘ 88 m"
|
||||
tools:visibility="visible" />
|
||||
tools:text="1043 m"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/altitude_diff_descent"
|
||||
android:layout_gravity="end"
|
||||
android:layout_height="@dimen/altitude_chart_time_distance_height"
|
||||
android:layout_width="wrap_content"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3"
|
||||
android:fontFamily="@string/robotoMedium"
|
||||
android:textColor="?colorAccent"
|
||||
android:gravity="start"
|
||||
android:visibility="visible"
|
||||
tools:text="88 m"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/altitude_chart"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center_vertical" />
|
||||
<Button
|
||||
android:id="@+id/start"
|
||||
style="@style/MwmWidget.Button.Primary"
|
||||
android:layout_gravity="top"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:layout_marginStart="@dimen/margin_base"
|
||||
android:minWidth="@dimen/start_button_width"
|
||||
android:text="@string/p2p_start"
|
||||
tools:showIn="@layout/menu_route_plan_line" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time_vehicle"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
tools:text="5 h 55 min • 1555km"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/start"
|
||||
style="@style/MwmWidget.Button.Primary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="@dimen/margin_base"
|
||||
android:minWidth="@dimen/start_button_width"
|
||||
android:text="@string/p2p_start"
|
||||
tools:showIn="@layout/menu_route_plan_line" />
|
||||
</LinearLayout>
|
||||
|
|
|
@ -1,85 +1,124 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/altitude_chart_panel"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/altitude_chart_panel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginBottom="@dimen/margin_half"
|
||||
android:layout_marginTop="@dimen/margin_half"
|
||||
android:paddingStart="@dimen/altitude_chart_container_padding_left"
|
||||
android:paddingEnd="@dimen/altitude_chart_container_padding_left"
|
||||
android:orientation="vertical"
|
||||
tools:showIn="@layout/fragment_routing">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="0dp"
|
||||
android:maxHeight="150dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/route_plan_list"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:scrollbars="vertical"
|
||||
app:layout_constraintHeight="true"
|
||||
app:layout_constraintHeight_max="150dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:itemCount="4"
|
||||
tools:listitem="@layout/route_plan_list_item"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/start"
|
||||
style="@style/MwmWidget.Button.Primary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
android:layout_marginStart="@dimen/margin_half"
|
||||
android:minWidth="@dimen/start_button_width"
|
||||
android:text="@string/p2p_start"
|
||||
tools:showIn="@layout/menu_route_plan_line"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/altitude_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginBottom="@dimen/margin_half"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="@dimen/margin_half"
|
||||
android:paddingStart="@dimen/altitude_chart_container_padding_left"
|
||||
android:paddingEnd="@dimen/altitude_chart_container_padding_left"
|
||||
android:orientation="vertical"
|
||||
tools:showIn="@layout/fragment_routing">
|
||||
android:layout_marginBottom="@dimen/margin_half">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/altitude_chart"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="0dp"
|
||||
android:scaleType="fitXY"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/time_elevation_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="@dimen/margin_half"
|
||||
android:layout_marginBottom="@dimen/margin_half">
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
tools:text="5 h 55 min • 1555km"
|
||||
tools:visibility="visible" />
|
||||
android:layout_marginEnd="2dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/altitude_chart_time_distance_height"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3"
|
||||
android:fontFamily="@string/robotoMedium"
|
||||
android:text="↗"
|
||||
android:textColor="?colorAccent"
|
||||
tools:ignore="HardcodedText"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/altitude_chart_time_distance_height"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3"
|
||||
android:fontFamily="@string/robotoMedium"
|
||||
android:text="↘"
|
||||
android:textColor="?colorAccent"
|
||||
tools:ignore="HardcodedText"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/altitude_difference"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/altitude_chart_time_distance_height"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3"
|
||||
android:fontFamily="@string/robotoMedium"
|
||||
android:textColor="?colorAccent"
|
||||
android:layout_gravity="end"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
tools:text="↗ 43 m ↘ 88 m"
|
||||
tools:visibility="visible" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical" >
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="1">
|
||||
<ImageView
|
||||
android:id="@+id/altitude_chart"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent" />
|
||||
<TextView
|
||||
android:id="@+id/time_vehicle"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
tools:text="5 h 55 min • 1555km"
|
||||
tools:visibility="visible" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/altitude_diff_ascent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/altitude_chart_time_distance_height"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3"
|
||||
android:fontFamily="@string/robotoMedium"
|
||||
android:textColor="?colorAccent"
|
||||
android:layout_gravity="end"
|
||||
tools:text="1043 m"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/altitude_diff_descent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/altitude_chart_time_distance_height"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3"
|
||||
android:fontFamily="@string/robotoMedium"
|
||||
android:textColor="?colorAccent"
|
||||
android:layout_gravity="end"
|
||||
tools:text="88 m"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/start"
|
||||
style="@style/MwmWidget.Button.Primary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:layout_marginStart="@dimen/margin_half"
|
||||
android:minWidth="@dimen/start_button_width"
|
||||
android:text="@string/p2p_start"
|
||||
tools:showIn="@layout/menu_route_plan_line"
|
||||
android:layout_gravity="center_vertical" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
|
77
android/app/src/main/res/layout/route_plan_list_item.xml
Normal file
77
android/app/src/main/res/layout/route_plan_list_item.xml
Normal file
|
@ -0,0 +1,77 @@
|
|||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:srcCompat="@drawable/route_point_finish" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/eta"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:text="11:59 PM"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/icon"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/separator1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="·"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/eta"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="9h 59min"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"
|
||||
app:layout_constraintStart_toEndOf="@id/separator1"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/separator2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="·"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/time"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/distance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="999 km"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"
|
||||
app:layout_constraintStart_toEndOf="@id/separator2"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -11,15 +11,34 @@
|
|||
android:paddingBottom="@dimen/margin_half"
|
||||
android:paddingTop="@dimen/margin_half_plus">
|
||||
<TextView
|
||||
android:id="@+id/total_time"
|
||||
android:id="@+id/estimated_time_of_arrival"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
style="@style/MwmWidget.TextView.PlanDetail.Number.Time"
|
||||
tools:text="11:59 AM"/>
|
||||
<TextView
|
||||
android:id="@+id/dot1"
|
||||
style="@style/MwmWidget.TextView.PlanDetail.Number.Secondary"
|
||||
android:layout_marginStart="@dimen/margin_quarter_plus"
|
||||
android:layout_marginTop="@dimen/margin_eighth"
|
||||
android:layout_marginEnd="@dimen/margin_quarter_plus"
|
||||
android:text="•"
|
||||
app:layout_constraintStart_toEndOf="@id/estimated_time_of_arrival"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="HardcodedText"/>
|
||||
<TextView
|
||||
android:id="@+id/total_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/margin_quarter_plus"
|
||||
app:layout_constraintStart_toEndOf="@id/dot1"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
style="@style/MwmWidget.TextView.PlanDetail.Number.Time"
|
||||
tools:text="40 min"/>
|
||||
<TextView
|
||||
android:id="@+id/dot"
|
||||
android:id="@+id/dot2"
|
||||
style="@style/MwmWidget.TextView.PlanDetail.Number.Secondary"
|
||||
android:layout_marginStart="@dimen/margin_quarter_plus"
|
||||
android:layout_marginTop="@dimen/margin_eighth"
|
||||
|
@ -35,7 +54,7 @@
|
|||
android:layout_marginStart="@dimen/margin_quarter_plus"
|
||||
app:srcCompat="@drawable/ic_20px_route_planning_walk"
|
||||
app:layout_constraintBottom_toBottomOf="@id/total_time"
|
||||
app:layout_constraintStart_toEndOf="@id/dot"
|
||||
app:layout_constraintStart_toEndOf="@id/dot2"
|
||||
app:tint="?iconTint"/>
|
||||
<TextView
|
||||
android:id="@+id/total_distance"
|
||||
|
|
25
android/app/src/main/res/values/arrays.xml
Normal file
25
android/app/src/main/res/values/arrays.xml
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<integer-array name="route_stop_icons">
|
||||
<item>@drawable/route_point_01</item>
|
||||
<item>@drawable/route_point_02</item>
|
||||
<item>@drawable/route_point_03</item>
|
||||
<item>@drawable/route_point_04</item>
|
||||
<item>@drawable/route_point_05</item>
|
||||
<item>@drawable/route_point_06</item>
|
||||
<item>@drawable/route_point_07</item>
|
||||
<item>@drawable/route_point_08</item>
|
||||
<item>@drawable/route_point_09</item>
|
||||
<item>@drawable/route_point_10</item>
|
||||
<item>@drawable/route_point_11</item>
|
||||
<item>@drawable/route_point_12</item>
|
||||
<item>@drawable/route_point_13</item>
|
||||
<item>@drawable/route_point_14</item>
|
||||
<item>@drawable/route_point_15</item>
|
||||
<item>@drawable/route_point_16</item>
|
||||
<item>@drawable/route_point_17</item>
|
||||
<item>@drawable/route_point_18</item>
|
||||
<item>@drawable/route_point_19</item>
|
||||
<item>@drawable/route_point_20</item>
|
||||
</integer-array>
|
||||
</resources>
|
|
@ -22,6 +22,7 @@
|
|||
#include "indexer/map_style_reader.hpp"
|
||||
|
||||
#include "platform/country_file.hpp"
|
||||
#include "platform/distance.hpp"
|
||||
#include "platform/platform.hpp"
|
||||
#include "platform/socket.hpp"
|
||||
|
||||
|
@ -820,9 +821,42 @@ bool RoutingManager::IsMyPosition(RouteMarkType type, size_t intermediateIndex)
|
|||
vector<RouteMarkData> RoutingManager::GetRoutePoints() const
|
||||
{
|
||||
vector<RouteMarkData> result;
|
||||
RoutePointsLayout routePoints(*m_bmManager);
|
||||
for (auto const & p : routePoints.GetRoutePoints())
|
||||
result.push_back(p->GetMarkData());
|
||||
RoutePointsLayout routePointsLayout(*m_bmManager);
|
||||
|
||||
auto const & routePoints = routePointsLayout.GetRoutePoints();
|
||||
|
||||
size_t subrouteCount = m_routingSession.GetSubrouteCount();
|
||||
//std::vector<routing::Route::SubrouteAttrs> subroutes = m_routingSession.GetSubroutes();
|
||||
|
||||
// Copy subroute time & distance to mark data only if subroute and route point sizes match.
|
||||
bool bCopy = (routePoints.size() == subrouteCount + 1);
|
||||
|
||||
for(int point = 0; point < (int)routePoints.size(); point++)
|
||||
{
|
||||
auto markData = routePoints[point]->GetMarkData();
|
||||
|
||||
if (bCopy)
|
||||
{
|
||||
if (point == 0)
|
||||
{
|
||||
// This is the first starting point. Time & distance are 0.
|
||||
markData.m_timeSec = 0;
|
||||
markData.m_distance = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get subroute time & distance pair.
|
||||
auto timeDistancePair = m_routingSession.GetSubrouteTotalTimeAndDistance(point - 1);
|
||||
markData.m_timeSec = timeDistancePair.first;
|
||||
markData.m_distance = platform::Distance::CreateFormatted(timeDistancePair.second).ToString();
|
||||
}
|
||||
|
||||
LOG(LINFO, ("point", point, "timeSec", markData.m_timeSec, "distance", markData.m_distance));
|
||||
}
|
||||
|
||||
result.push_back(markData);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -125,6 +125,7 @@ public:
|
|||
|
||||
routing::RoutingSession const & RoutingSession() const { return m_routingSession; }
|
||||
routing::RoutingSession & RoutingSession() { return m_routingSession; }
|
||||
//std::vector<routing::Route::SubrouteAttrs> GetSubroutes() { return m_routingSession.GetSubroutes(); }
|
||||
void SetRouter(routing::RouterType type);
|
||||
routing::RouterType GetRouter() const { return m_currentRouterType; }
|
||||
bool IsRoutingActive() const { return m_routingSession.IsActive(); }
|
||||
|
|
|
@ -24,6 +24,8 @@ struct RouteMarkData
|
|||
bool m_isPassed = false;
|
||||
bool m_replaceWithMyPositionAfterRestart = false;
|
||||
m2::PointD m_position;
|
||||
long m_timeSec = 0;
|
||||
std::string m_distance;
|
||||
};
|
||||
|
||||
class RouteMarkPoint : public UserMark
|
||||
|
|
|
@ -65,6 +65,13 @@ double Route::GetTotalDistanceMeters() const
|
|||
return m_poly.GetTotalDistanceMeters();
|
||||
}
|
||||
|
||||
double Route::GetTotalDistanceToSegmentMeters(size_t segIdx) const
|
||||
{
|
||||
if (!IsValid())
|
||||
return 0.0;
|
||||
return m_routeSegments[segIdx].GetDistFromBeginningMeters();
|
||||
}
|
||||
|
||||
double Route::GetCurrentDistanceFromBeginMeters() const
|
||||
{
|
||||
if (!IsValid())
|
||||
|
@ -160,6 +167,13 @@ double Route::GetCurrentTimeToSegmentSec(size_t segIdx) const
|
|||
return endTimeSec - passedTimeSec;
|
||||
}
|
||||
|
||||
double Route::GetTotalTimeToSegmentSec(size_t segIdx) const
|
||||
{
|
||||
if (!IsValid())
|
||||
return 0.0;
|
||||
return m_routeSegments[segIdx].GetTimeFromBeginningSec();
|
||||
}
|
||||
|
||||
void Route::GetCurrentSpeedLimit(SpeedInUnits & speedLimit) const
|
||||
{
|
||||
if (!IsValid())
|
||||
|
@ -452,6 +466,14 @@ Route::SubrouteSettings const Route::GetSubrouteSettings(size_t segmentIdx) cons
|
|||
return SubrouteSettings(m_routingSettings, m_router, m_subrouteUid);
|
||||
}
|
||||
|
||||
std::pair<long, double> Route::GetSubrouteTotalTimeAndDistance(size_t subrouteIdx) const
|
||||
{
|
||||
size_t endSegmentIdx = m_subrouteAttrs.at(subrouteIdx).GetEndSegmentIdx() - 1;
|
||||
long timeSec = GetTotalTimeToSegmentSec(endSegmentIdx);
|
||||
double distanceMeters = GetTotalDistanceToSegmentMeters(endSegmentIdx);
|
||||
return std::pair<long, double>(timeSec, distanceMeters);
|
||||
}
|
||||
|
||||
bool Route::IsSubroutePassed(size_t subrouteIdx) const
|
||||
{
|
||||
size_t const endSegmentIdx = GetSubrouteAttrs(subrouteIdx).GetEndSegmentIdx();
|
||||
|
@ -532,7 +554,7 @@ std::string Route::DebugPrintTurns() const
|
|||
{
|
||||
auto const & turn = m_routeSegments[i].GetTurn();
|
||||
|
||||
// Always print first elemenst as Start.
|
||||
// Always print first element as Start.
|
||||
if (i == 0 || !turn.IsTurnNone())
|
||||
{
|
||||
res += DebugPrint(mercator::ToLatLon(m_routeSegments[i].GetJunction()));
|
||||
|
|
|
@ -353,7 +353,10 @@ public:
|
|||
/// \brief estimated time to reach segment.
|
||||
double GetCurrentTimeToSegmentSec(size_t segIdx) const;
|
||||
|
||||
/// \brief estimated time to the nearest turn.
|
||||
/// \brief total route time to reach segment.
|
||||
double GetTotalTimeToSegmentSec(size_t segIdx) const;
|
||||
|
||||
/// \brief estimated time to the nearest turn.
|
||||
double GetCurrentTimeToNearestTurnSec() const;
|
||||
|
||||
FollowedPolyline const & GetFollowedPolyline() const { return m_poly; }
|
||||
|
@ -363,11 +366,13 @@ public:
|
|||
|
||||
size_t GetCurrentSubrouteIdx() const { return m_currentSubrouteIdx; }
|
||||
std::vector<SubrouteAttrs> const & GetSubroutes() const { return m_subrouteAttrs; }
|
||||
std::pair<long, double> GetSubrouteTotalTimeAndDistance(size_t subrouteIdx) const;
|
||||
|
||||
std::vector<double> const & GetSegDistanceMeters() const { return m_poly.GetSegDistanceMeters(); }
|
||||
bool IsValid() const { return m_poly.IsValid(); }
|
||||
|
||||
double GetTotalDistanceMeters() const;
|
||||
double GetTotalDistanceToSegmentMeters(size_t segIdx) const;
|
||||
double GetCurrentDistanceFromBeginMeters() const;
|
||||
double GetCurrentDistanceToEndMeters() const;
|
||||
double GetMercatorDistanceFromBegin() const;
|
||||
|
|
|
@ -174,6 +174,12 @@ public:
|
|||
|
||||
double GetCompletionPercent() const;
|
||||
|
||||
size_t GetSubrouteCount() const { return m_route->GetSubrouteCount(); }
|
||||
std::pair<long, double> GetSubrouteTotalTimeAndDistance(size_t subrouteIdx) const
|
||||
{
|
||||
return m_route->GetSubrouteTotalTimeAndDistance(subrouteIdx);
|
||||
}
|
||||
|
||||
private:
|
||||
struct DoReadyCallback
|
||||
{
|
||||
|
|
Reference in a new issue