forked from upstream-mirrors/OpenTracks
Track.ActivityType and Marker.Category are shown not wrapped in [] anymore.
This commit is contained in:
@@ -186,7 +186,7 @@ public class MarkerDetailFragment extends Fragment {
|
|||||||
viewBinding.markerDetailMarkerPhoto.setImageDrawable(MarkerUtils.getDefaultPhoto(getContext()));
|
viewBinding.markerDetailMarkerPhoto.setImageDrawable(MarkerUtils.getDefaultPhoto(getContext()));
|
||||||
}
|
}
|
||||||
|
|
||||||
viewBinding.markerDetailMarkerCategory.setText(StringUtils.getCategory(marker.category()));
|
viewBinding.markerDetailMarkerCategory.setText(marker.category());
|
||||||
viewBinding.markerDetailMarkerDescription.setText(marker.description());
|
viewBinding.markerDetailMarkerDescription.setText(marker.description());
|
||||||
|
|
||||||
viewBinding.markerDetailMarkerLocation.setText(StringUtils.formatCoordinate(getContext(), marker.position()));
|
viewBinding.markerDetailMarkerLocation.setText(StringUtils.formatCoordinate(getContext(), marker.position()));
|
||||||
|
|||||||
@@ -174,14 +174,6 @@ public class StringUtils {
|
|||||||
return new Pair<>(value, context.getString(R.string.sensor_unit_power));
|
return new Pair<>(value, context.getString(R.string.sensor_unit_power));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated //TODO Move to strings.xml
|
|
||||||
public static String getCategory(String category) {
|
|
||||||
if (category == null || category.isEmpty()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return "[" + category + "]";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated //TODO use separate UI elements rather than concatenating strings.
|
@Deprecated //TODO use separate UI elements rather than concatenating strings.
|
||||||
public static String getCategoryDescription(String category, String description) {
|
public static String getCategoryDescription(String category, String description) {
|
||||||
if (category == null || category.isEmpty()) {
|
if (category == null || category.isEmpty()) {
|
||||||
@@ -189,7 +181,7 @@ public class StringUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
builder.append(getCategory(category));
|
builder.append(category);
|
||||||
if (description != null && !description.isEmpty()) {
|
if (description != null && !description.isEmpty()) {
|
||||||
builder.append(" ").append(description);
|
builder.append(" ").append(description);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user