Updated icons for recents

This commit is contained in:
Denis 2015-03-05 15:15:23 +02:00
parent 57b6d5e899
commit f1ecdea03f
6 changed files with 51 additions and 16 deletions

View file

@ -26,7 +26,9 @@ public class PointDescription {
public static final String POINT_TYPE_ADDRESS = "address";
public static final String POINT_TYPE_OSM_NOTE= "osm_note";
public static final String POINT_TYPE_MARKER = "marker";
public static final String POINT_TYPE_NOTE = "avnote";
public static final String POINT_TYPE_AUDIO_NOTE = "audionote";
public static final String POINT_TYPE_VIDEO_NOTE = "videonote";
public static final String POINT_TYPE_PHOTO_NOTE = "photonote";
public static final String POINT_TYPE_LOCATION = "location";
public static final String POINT_TYPE_ALARM = "alarm";
public static final String POINT_TYPE_TARGET = "destination";
@ -111,10 +113,19 @@ public class PointDescription {
return POINT_TYPE_FAVORITE.equals(type);
}
public boolean isAvNote() {
return POINT_TYPE_NOTE.equals(type);
public boolean isAudioNote() {
return POINT_TYPE_AUDIO_NOTE.equals(type);
}
public boolean isVideoNote() {
return POINT_TYPE_VIDEO_NOTE.equals(type);
}
public boolean isPhotoNote() {
return POINT_TYPE_PHOTO_NOTE.equals(type);
}
@Override
public int hashCode() {
final int prime = 31;

View file

@ -48,7 +48,9 @@ public class SearchHistoryFragment extends ListFragment implements SearchActivit
private Drawable locationIcon;
private Drawable poiIcon;
private Drawable wptIcon;
private Drawable noteIcon;
private Drawable audioNoteIcon;
private Drawable videoNoteIcon;
private Drawable photoNoteIcon;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
@ -72,8 +74,10 @@ public class SearchHistoryFragment extends ListFragment implements SearchActivit
favoriteIcon = getResources().getDrawable(R.drawable.ic_type_favorites);
locationIcon = getResources().getDrawable(R.drawable.ic_type_coordinates);
poiIcon = getResources().getDrawable(R.drawable.ic_type_info);
wptIcon = getResources().getDrawable(R.drawable.ic_action_flage_dark);
noteIcon = getResources().getDrawable(R.drawable.ic_action_note_dark);
wptIcon = getResources().getDrawable(R.drawable.ic_type_waypoint);
audioNoteIcon = getResources().getDrawable(R.drawable.ic_type_audio);
videoNoteIcon = getResources().getDrawable(R.drawable.ic_type_video);
photoNoteIcon = getResources().getDrawable(R.drawable.ic_type_img);
if (getMyApplication().getSettings().isLightContent()) {
addressIcon = addressIcon.mutate();
addressIcon.setColorFilter(getResources().getColor(R.color.icon_color_light), PorterDuff.Mode.MULTIPLY);
@ -85,8 +89,12 @@ public class SearchHistoryFragment extends ListFragment implements SearchActivit
poiIcon.setColorFilter(getResources().getColor(R.color.icon_color_light), PorterDuff.Mode.MULTIPLY);
wptIcon = wptIcon.mutate();
wptIcon.setColorFilter(getResources().getColor(R.color.icon_color_light), PorterDuff.Mode.MULTIPLY);
noteIcon = noteIcon.mutate();
noteIcon.setColorFilter(getResources().getColor(R.color.icon_color_light), PorterDuff.Mode.MULTIPLY);
audioNoteIcon = audioNoteIcon.mutate();
audioNoteIcon.setColorFilter(getResources().getColor(R.color.icon_color_light), PorterDuff.Mode.MULTIPLY);
videoNoteIcon = videoNoteIcon.mutate();
videoNoteIcon.setColorFilter(getResources().getColor(R.color.icon_color_light), PorterDuff.Mode.MULTIPLY);
photoNoteIcon = photoNoteIcon.mutate();
photoNoteIcon.setColorFilter(getResources().getColor(R.color.icon_color_light), PorterDuff.Mode.MULTIPLY);
}
}
@ -224,9 +232,13 @@ public class SearchHistoryFragment extends ListFragment implements SearchActivit
icon.setImageDrawable(poiIcon);
} else if (historyEntry.getName().isWpt()) {
icon.setImageDrawable(wptIcon);
} else if (historyEntry.getName().isAvNote()) {
icon.setImageDrawable(noteIcon);
} else {
} else if (historyEntry.getName().isAudioNote()) {
icon.setImageDrawable(audioNoteIcon);
} else if (historyEntry.getName().isVideoNote()) {
icon.setImageDrawable(videoNoteIcon);
}else if (historyEntry.getName().isPhotoNote()) {
icon.setImageDrawable(photoNoteIcon);
} else {
icon.setImageDrawable(addressIcon);
}

View file

@ -170,10 +170,11 @@ public class AudioNotesLayer extends OsmandMapLayer implements IContextMenuProvi
@Override
public PointDescription getObjectName(Object o) {
if(o instanceof Recording){
if(((Recording)o).getName(activity).isEmpty()) {
return new PointDescription(PointDescription.POINT_TYPE_NOTE, view.getResources().getString(R.string.recording_default_name));
Recording rec = (Recording) o;
if(rec.getName(activity).isEmpty()) {
return new PointDescription(rec.getSearchHistoryType(), view.getResources().getString(R.string.recording_default_name));
}
return new PointDescription(PointDescription.POINT_TYPE_NOTE, ((Recording)o).getName(activity));
return new PointDescription(rec.getSearchHistoryType(), ((Recording)o).getName(activity));
}
return null;
}

View file

@ -21,6 +21,7 @@ import net.osmand.PlatformUtil;
import net.osmand.access.AccessibleAlertBuilder;
import net.osmand.access.AccessibleToast;
import net.osmand.data.DataTileManager;
import net.osmand.data.PointDescription;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
@ -213,6 +214,16 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
return "";
}
public String getSearchHistoryType(){
if (isPhoto()){
return PointDescription.POINT_TYPE_PHOTO_NOTE;
} else if (isVideo()) {
return PointDescription.POINT_TYPE_VIDEO_NOTE;
} else {
return PointDescription.POINT_TYPE_PHOTO_NOTE;
}
}
public boolean isPhoto() {
return file.getName().endsWith(IMG_EXTENSION);
}

View file

@ -115,7 +115,7 @@ public class DashAudioVideoNotesFragment extends DashBaseFragment {
@Override
public void onClick(View v) {
getMyApplication().getSettings().setMapLocationToShow(recording.getLatitude(), recording.getLongitude(), 15,
new PointDescription(PointDescription.POINT_TYPE_NOTE,
new PointDescription(recording.getSearchHistoryType(),
recording.getName(getActivity())), true,
recording); //$NON-NLS-1$
MapActivity.launchMapActivityMoveToTop(getActivity());

View file

@ -113,7 +113,7 @@ public class NotesFragment extends ListFragment {
private void showOnMap(Recording recording) {
getMyApplication().getSettings().setMapLocationToShow(recording.getLatitude(), recording.getLongitude(), 15,
new PointDescription(PointDescription.POINT_TYPE_NOTE, recording.getName(getActivity())), true,
new PointDescription(recording.getSearchHistoryType(), recording.getName(getActivity())), true,
recording); //$NON-NLS-1$
MapActivity.launchMapActivityMoveToTop(getActivity());
}