Merge remote-tracking branch 'origin/sasha_pasha_branch' into sasha_pasha_branch

This commit is contained in:
Alexander Sytnyk 2017-08-16 18:36:11 +03:00
commit d01f457764
3 changed files with 11 additions and 3 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="route_point">Route point</string>
<string name="edit_line">Edit Line</string>
<string name="add_point_before">Add point before</string>
<string name="add_point_after">Add point after</string>

View file

@ -407,7 +407,7 @@ public class MeasurementToolFragment extends Fragment {
});
mapActivity.showTopToolbar(toolBarController);
adapter = new MeasurementToolAdapter(getMapActivity(), measurementLayer.getMeasurementPoints());
adapter = new MeasurementToolAdapter(getMapActivity(), measurementLayer.getMeasurementPoints(), newGpxLine != null ? newGpxLine.getLineType() : null);
if (portrait) {
pointsRv = mainView.findViewById(R.id.measure_points_recycler_view);
} else {

View file

@ -17,6 +17,7 @@ import net.osmand.plus.IconsCache;
import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.TrackActivity.NewGpxLine.LineType;
import net.osmand.util.MapUtils;
import java.util.Collections;
@ -29,10 +30,12 @@ public class MeasurementToolAdapter extends RecyclerView.Adapter<MeasurementTool
private final List<WptPt> points;
private MeasurementAdapterListener listener;
private boolean nightMode;
private LineType lineType;
public MeasurementToolAdapter(MapActivity mapActivity, List<WptPt> points) {
public MeasurementToolAdapter(MapActivity mapActivity, List<WptPt> points, LineType lineType) {
this.mapActivity = mapActivity;
this.points = points;
this.lineType = lineType;
}
public void setAdapterListener(MeasurementAdapterListener listener) {
@ -80,9 +83,13 @@ public class MeasurementToolAdapter extends RecyclerView.Adapter<MeasurementTool
String pointTitle = pt.name;
if (!TextUtils.isEmpty(pointTitle)) {
holder.title.setText(pointTitle);
} else {
if (lineType == LineType.ADD_ROUTE_POINTS) {
holder.title.setText(mapActivity.getString(R.string.route_point) + " - " + (pos + 1));
} else {
holder.title.setText(mapActivity.getString(R.string.plugin_distance_point) + " - " + (pos + 1));
}
}
String pointDesc = pt.desc;
if (!TextUtils.isEmpty(pointDesc)) {
holder.descr.setText(pointDesc);