forked from upstream-mirrors/OpenTracks
UI refactoring with a Bottom App Bar.
Only one button to play/stop. Stop Activity to edit track just recorded, resuming or finishing. Logo color to FF6D00. Fixes #1078 #437 #575 #1094.
This commit is contained in:
committed by
Román Martínez
parent
a350077e5c
commit
da62d26409
@@ -45,7 +45,7 @@ public class ActivityUtils {
|
||||
|
||||
@Override
|
||||
public void onDestroyActionMode(ActionMode mode) {
|
||||
// Do nothing
|
||||
contextualActionModeCallback.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -127,5 +127,10 @@ public class ActivityUtils {
|
||||
* @param ids the selected items' ids, if available
|
||||
*/
|
||||
boolean onClick(int itemId, int[] positions, long[] ids);
|
||||
|
||||
/**
|
||||
* Invoked when contextual action mode is destroyed.
|
||||
*/
|
||||
void onDestroy();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ public class ListItemUtils {
|
||||
* @param context the context
|
||||
* @param view the list item view
|
||||
* @param isRecording true if recording
|
||||
* @param isPaused true if paused
|
||||
* @param iconId the icon id
|
||||
* @param iconContentDescriptionId the icon content description id
|
||||
* @param name the name value
|
||||
@@ -56,11 +55,11 @@ public class ListItemUtils {
|
||||
* @param description the description value
|
||||
* @param hasPhoto true if this list item has photo
|
||||
*/
|
||||
public static void setListItem(Context context, View view, boolean isRecording, boolean isPaused, int iconId, int iconContentDescriptionId, String name, String totalTime, String totalDistance, int markerCount, OffsetDateTime offsetDateTime, String category, String description, boolean hasPhoto) {
|
||||
public static void setListItem(Context context, View view, boolean isRecording, int iconId, int iconContentDescriptionId, String name, String totalTime, String totalDistance, int markerCount, OffsetDateTime offsetDateTime, String category, String description, boolean hasPhoto) {
|
||||
// Set icon
|
||||
if (isRecording) {
|
||||
iconId = isPaused ? R.drawable.ic_track_paused : R.drawable.ic_track_recording;
|
||||
iconContentDescriptionId = isPaused ? R.string.image_pause : R.string.image_record;
|
||||
iconId = R.drawable.ic_track_recording;
|
||||
iconContentDescriptionId = R.string.image_record;
|
||||
}
|
||||
|
||||
ImageView iconImageView = view.findViewById(R.id.list_item_icon);
|
||||
@@ -75,7 +74,7 @@ public class ListItemUtils {
|
||||
TextView timeDistanceTextView = view.findViewById(R.id.list_item_time_distance);
|
||||
String timeDistanceText;
|
||||
if (isRecording) {
|
||||
timeDistanceText = context.getString(isPaused ? R.string.generic_paused : R.string.generic_recording);
|
||||
timeDistanceText = context.getString(R.string.generic_recording);
|
||||
} else {
|
||||
// Match list_item_time_distance in list_item.xml
|
||||
timeDistanceText = getTimeDistance(totalTime, totalDistance);
|
||||
|
||||
Reference in New Issue
Block a user