mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-11 05:23:07 +02:00
Add play in earth with photo overlays
This commit is contained in:
@@ -109,7 +109,8 @@ public class ListItemUtils {
|
||||
|
||||
// Set category/description
|
||||
TextView descriptionTextView = (TextView) view.findViewById(R.id.list_item_description);
|
||||
setTextView(descriptionTextView, getDescription(isRecording, category, description));
|
||||
setTextView(descriptionTextView,
|
||||
isRecording ? null : StringUtils.getCategoryDescription(category, description));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,30 +147,6 @@ public class ListItemUtils {
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the description text.
|
||||
*
|
||||
* @param isRecording true if recording
|
||||
* @param category the category
|
||||
* @param description the description
|
||||
*/
|
||||
private static String getDescription(boolean isRecording, String category, String description) {
|
||||
if (isRecording) {
|
||||
return null;
|
||||
}
|
||||
if (category == null || category.length() == 0) {
|
||||
return description;
|
||||
}
|
||||
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
|
||||
buffer.append("[" + category + "]");
|
||||
if (description != null && description.length() != 0) {
|
||||
buffer.append(" " + description);
|
||||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the start time text.
|
||||
*
|
||||
|
||||
@@ -228,6 +228,26 @@ public class StringUtils {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a string for category and description.
|
||||
*
|
||||
* @param category the category
|
||||
* @param description the description
|
||||
*/
|
||||
public static String getCategoryDescription(String category, String description) {
|
||||
if (category == null || category.length() == 0) {
|
||||
return description;
|
||||
}
|
||||
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
|
||||
buffer.append("[" + category + "]");
|
||||
if (description != null && description.length() != 0) {
|
||||
buffer.append(" " + description);
|
||||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats the given text as a XML CDATA element. This includes adding the
|
||||
* starting and ending CDATA tags. Please notice that this may result in
|
||||
|
||||
Reference in New Issue
Block a user