diff options
author | Bananeweizen <bananeweizen@gmx.de> | 2012-11-30 14:42:43 +0100 |
---|---|---|
committer | Bananeweizen <bananeweizen@gmx.de> | 2012-11-30 14:42:43 +0100 |
commit | 62f7d6e130a1be5cd3fabdacbd664ae7326109ff (patch) | |
tree | 352a361a3a0999ff2e74fd286fa8444b509ec593 /main/src/cgeo/geocaching | |
parent | d8c53772a993ad2592cc5104e9b976004cba069e (diff) | |
download | cgeo-62f7d6e130a1be5cd3fabdacbd664ae7326109ff.zip cgeo-62f7d6e130a1be5cd3fabdacbd664ae7326109ff.tar.gz cgeo-62f7d6e130a1be5cd3fabdacbd664ae7326109ff.tar.bz2 |
new: use color markers also in log view
* simplifies recognizing log types
* makes it easier for the eye to follow the log layout
Diffstat (limited to 'main/src/cgeo/geocaching')
-rw-r--r-- | main/src/cgeo/geocaching/CacheDetailActivity.java | 23 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/cgeotrackable.java | 11 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/enumerations/LogType.java | 40 |
3 files changed, 40 insertions, 34 deletions
diff --git a/main/src/cgeo/geocaching/CacheDetailActivity.java b/main/src/cgeo/geocaching/CacheDetailActivity.java index 155fa35..ddea7fb 100644 --- a/main/src/cgeo/geocaching/CacheDetailActivity.java +++ b/main/src/cgeo/geocaching/CacheDetailActivity.java @@ -2268,23 +2268,12 @@ public class CacheDetailActivity extends AbstractActivity { } // colored marker - holder.statusMarker.setVisibility(View.VISIBLE); - if (log.type == LogType.FOUND_IT - || log.type == LogType.WEBCAM_PHOTO_TAKEN - || log.type == LogType.ATTENDED) { - holder.statusMarker.setImageResource(R.drawable.mark_green); - } else if (log.type == LogType.PUBLISH_LISTING - || log.type == LogType.ENABLE_LISTING - || log.type == LogType.OWNER_MAINTENANCE) { - holder.statusMarker.setImageResource(R.drawable.mark_green_more); - } else if (log.type == LogType.DIDNT_FIND_IT - || log.type == LogType.NEEDS_MAINTENANCE - || log.type == LogType.NEEDS_ARCHIVE) { - holder.statusMarker.setImageResource(R.drawable.mark_red); - } else if (log.type == LogType.TEMP_DISABLE_LISTING - || log.type == LogType.ARCHIVE) { - holder.statusMarker.setImageResource(R.drawable.mark_red_more); - } else { + int marker = log.type.markerId; + if (marker != 0) { + holder.statusMarker.setVisibility(View.VISIBLE); + holder.statusMarker.setImageResource(marker); + } + else { holder.statusMarker.setVisibility(View.GONE); } diff --git a/main/src/cgeo/geocaching/cgeotrackable.java b/main/src/cgeo/geocaching/cgeotrackable.java index e436249..2515bcd 100644 --- a/main/src/cgeo/geocaching/cgeotrackable.java +++ b/main/src/cgeo/geocaching/cgeotrackable.java @@ -471,6 +471,17 @@ public class cgeotrackable extends AbstractActivity { logView.setText(logText); } + ImageView statusMarker = (ImageView) rowView.findViewById(R.id.log_mark); + // colored marker + int marker = log.type.markerId; + if (marker != 0) { + statusMarker.setVisibility(View.VISIBLE); + statusMarker.setImageResource(marker); + } + else { + statusMarker.setVisibility(View.GONE); + } + // add LogImages LinearLayout logLayout = (LinearLayout) rowView.findViewById(R.id.log_layout); diff --git a/main/src/cgeo/geocaching/enumerations/LogType.java b/main/src/cgeo/geocaching/enumerations/LogType.java index 82efd7e..06bd8d3 100644 --- a/main/src/cgeo/geocaching/enumerations/LogType.java +++ b/main/src/cgeo/geocaching/enumerations/LogType.java @@ -15,41 +15,47 @@ import java.util.Map; */ public enum LogType { - FOUND_IT(2,"icon_smile","found it",R.string.log_found), - DIDNT_FIND_IT(3, "icon_sad", "didn't find it", R.string.log_dnf), + FOUND_IT(2, "icon_smile", "found it", R.string.log_found, R.drawable.mark_green), + DIDNT_FIND_IT(3, "icon_sad", "didn't find it", R.string.log_dnf, R.drawable.mark_red), NOTE(4,"icon_note","write note",R.string.log_note), - PUBLISH_LISTING(1003, "icon_greenlight", "publish listing", R.string.log_published), - ENABLE_LISTING(23,"icon_enabled","enable listing",R.string.log_enabled), - ARCHIVE(5,"traffic_cone","archive",R.string.log_archived), - TEMP_DISABLE_LISTING(22,"icon_disabled","temporarily disable listing",R.string.log_disabled), - NEEDS_ARCHIVE(7,"icon_remove","needs archived",R.string.log_needs_archived), + PUBLISH_LISTING(1003, "icon_greenlight", "publish listing", R.string.log_published, R.drawable.mark_green_more), + ENABLE_LISTING(23, "icon_enabled", "enable listing", R.string.log_enabled, R.drawable.mark_green_more), + ARCHIVE(5, "traffic_cone", "archive", R.string.log_archived, R.drawable.mark_red_more), + TEMP_DISABLE_LISTING(22, "icon_disabled", "temporarily disable listing", R.string.log_disabled, R.drawable.mark_red_more), + NEEDS_ARCHIVE(7, "icon_remove", "needs archived", R.string.log_needs_archived, R.drawable.mark_red), WILL_ATTEND(9,"icon_rsvp","will attend",R.string.log_attend), - ATTENDED(10,"icon_attended","attended",R.string.log_attended), - RETRIEVED_IT(13,"picked_up","retrieved it",R.string.log_retrieved), + ATTENDED(10, "icon_attended", "attended", R.string.log_attended, R.drawable.mark_green), + RETRIEVED_IT(13, "picked_up", "retrieved it", R.string.log_retrieved, R.drawable.mark_green), PLACED_IT(14,"dropped_off","placed it",R.string.log_placed), - GRABBED_IT(19,"transfer","grabbed it",R.string.log_grabbed), - NEEDS_MAINTENANCE(45,"icon_needsmaint","needs maintenance",R.string.log_maintenance_needed), - OWNER_MAINTENANCE(46,"icon_maint","owner maintenance",R.string.log_maintained), + GRABBED_IT(19, "transfer", "grabbed it", R.string.log_grabbed, R.drawable.mark_green), + NEEDS_MAINTENANCE(45, "icon_needsmaint", "needs maintenance", R.string.log_maintenance_needed, R.drawable.mark_red), + OWNER_MAINTENANCE(46, "icon_maint", "owner maintenance", R.string.log_maintained, R.drawable.mark_green_more), UPDATE_COORDINATES(47,"coord_update","update coordinates",R.string.log_update), - DISCOVERED_IT(48,"icon_discovered","discovered it",R.string.log_discovered), + DISCOVERED_IT(48, "icon_discovered", "discovered it", R.string.log_discovered, R.drawable.mark_green), POST_REVIEWER_NOTE(18,"big_smile","post reviewer note",R.string.log_reviewer), - VISIT(1001, "icon_visited", "visit", R.string.log_tb_visit), - WEBCAM_PHOTO_TAKEN(11, "icon_camera", "webcam photo taken", R.string.log_webcam), + VISIT(1001, "icon_visited", "visit", R.string.log_tb_visit, R.drawable.mark_green), + WEBCAM_PHOTO_TAKEN(11, "icon_camera", "webcam photo taken", R.string.log_webcam, R.drawable.mark_green), ANNOUNCEMENT(74, "icon_announcement", "announcement", R.string.log_announcement), MOVE_COLLECTION(69, "conflict_collection_icon_note", "unused_collection", R.string.log_movecollection), MOVE_INVENTORY(70, "conflict_inventory_icon_note", "unused_inventory", R.string.log_moveinventory), - UNKNOWN(0, "unknown", "", R.string.err_unknown); // LogType not init. yet + UNKNOWN(0, "unknown", "", R.string.err_unknown, R.drawable.mark_red); // LogType not init. yet public final int id; public final String iconName; public final String type; private final int stringId; + public final int markerId; - private LogType(int id, String iconName, String type, int stringId) { + private LogType(int id, String iconName, String type, int stringId, int markerId) { this.id = id; this.iconName = iconName; this.type = type; this.stringId = stringId; + this.markerId = markerId; + } + + private LogType(int id, String iconName, String type, int stringId) { + this(id, iconName, type, stringId, R.drawable.mark_gray); } private final static Map<String, LogType> FIND_BY_ICONNAME; |