diff options
Diffstat (limited to 'main/src')
3 files changed, 75 insertions, 398 deletions
diff --git a/main/src/cgeo/geocaching/connector/oc/AttributeParser.java b/main/src/cgeo/geocaching/connector/oc/AttributeParser.java deleted file mode 100644 index 63bee77..0000000 --- a/main/src/cgeo/geocaching/connector/oc/AttributeParser.java +++ /dev/null @@ -1,327 +0,0 @@ -// This is a generated file, do not change manually! - -package cgeo.geocaching.connector.oc; - -import java.util.HashMap; -import java.util.Map; - -public class AttributeParser { - - private final static Map<String, Integer> attrMapDe; - private final static Map<String, Integer> attrMapPl; - - static { - attrMapDe = new HashMap<String, Integer>(); - attrMapPl = new HashMap<String, Integer>(); - - // last header line - attrMapDe.put("Listed at Opencaching only", 6); - attrMapDe.put("Dostępna tylko na Opencaching", 6); - attrMapDe.put("Nur bei Opencaching logbar", 6); - attrMapDe.put("Solo loggeable en Opencaching", 6); - attrMapDe.put("Loggabile solo su Opencaching", 6); - attrMapPl.put("Near a Survey Marker", 54); - attrMapPl.put("W pobliżu punktu geodezyjnego", 54); - attrMapPl.put("Whereigo Cache", 55); - attrMapPl.put("Whereigo Cache", 55); - attrMapPl.put("Whereigo Cache", 55); - attrMapDe.put("Letterbox Cache", 8); - attrMapPl.put("Letterbox Cache", 56); - attrMapDe.put("Skrzynka typu Letterbox", 8); - attrMapPl.put("Skrzynka typu Letterbox", 56); - attrMapDe.put("Letterbox (benötigt Stempel)", 8); - attrMapPl.put("Letterbox (benötigt Stempel)", 56); - attrMapDe.put("Letterbox (necesita un estampador)", 8); - attrMapPl.put("Letterbox (necesita un estampador)", 56); - attrMapDe.put("Letterbox (richiede un timbro)", 8); - attrMapPl.put("Letterbox (richiede un timbro)", 56); - attrMapPl.put("GeoHotel", 43); - attrMapPl.put("GeoHotel", 43); - attrMapPl.put("GeoHotel", 43); - attrMapPl.put("Magnetic cache", 49); - attrMapPl.put("Przyczepiona magnesem", 49); - attrMapPl.put("magnetischer Cache", 49); - attrMapPl.put("Description contains an audio file", 50); - attrMapPl.put("Opis zawiera plik audio", 50); - attrMapPl.put("Offset cache", 51); - attrMapPl.put("Offset cache", 51); - attrMapPl.put("Peilungscache", 51); - attrMapPl.put("Garmin's wireless beacon", 52); - attrMapPl.put("Beacon - Garmin Chirp", 52); - attrMapPl.put("Funksignal – Garmin Chirp", 52); - attrMapPl.put("Dead Drop USB cache", 53); - attrMapPl.put("Dead Drop USB skrzynka", 53); - attrMapDe.put("Has a moving target", 31); - attrMapDe.put("bewegliches Ziel", 31); - attrMapDe.put("Objetivo en movimiento", 31); - attrMapDe.put("Oggetto in movimento", 31); - attrMapDe.put("Webcam Cache", 32); - attrMapDe.put("Webcam Cache", 32); - attrMapDe.put("Webcam Cache", 32); - attrMapDe.put("Webcam Cache", 32); - attrMapDe.put("Other cache type", 57); - attrMapDe.put("sonstiger Cachetyp", 57); - attrMapDe.put("Otro tipo de cache", 57); - attrMapDe.put("Altro tipo di cache", 57); - attrMapDe.put("Investigation required", 54); - attrMapDe.put("Recherche", 54); - attrMapDe.put("Investigación", 54); - attrMapDe.put("Ricerca", 54); - attrMapDe.put("Puzzle / Mystery", 55); - attrMapDe.put("Rätsel", 55); - attrMapDe.put("Puzzle / Misterio", 55); - attrMapDe.put("Puzzle / Mystery", 55); - attrMapDe.put("Arithmetical problem", 56); - attrMapDe.put("Rechenaufgabe", 56); - attrMapDe.put("Problema matemático", 56); - attrMapDe.put("Problema matematico", 56); - attrMapDe.put("Ask owner for start conditions", 58); - attrMapDe.put("Startbedingungen beim Owner erfragen", 58); - attrMapDe.put("Ask owner for start conditions", 58); - attrMapDe.put("Ask owner for start conditions", 58); - attrMapPl.put("Wheelchair accessible", 44); - attrMapPl.put("Dostępna dla niepełnosprawnych", 44); - attrMapPl.put("rollstuhltauglich", 44); - attrMapDe.put("Near the parking area", 24); - attrMapDe.put("nahe beim Auto", 24); - attrMapDe.put("Cerca de un Parking", 24); - attrMapDe.put("Vicino all'area di parcheggio", 24); - attrMapPl.put("Access only by walk", 84); - attrMapPl.put("Dostępna tylko pieszo", 84); - attrMapDe.put("Long walk", 25); - attrMapDe.put("längere Wanderung", 25); - attrMapDe.put("Larga caminata", 25); - attrMapDe.put("Lunga camminata", 25); - attrMapDe.put("Swamp, marsh or wading", 26); - attrMapDe.put("sumpfig/matschiges Gelände / waten", 26); - attrMapDe.put("Pantano / terreno fangoso", 26); - attrMapDe.put("Palude o marcita", 26); - attrMapDe.put("Hilly area", 27); - attrMapDe.put("hügeliges Gelände", 27); - attrMapDe.put("Terreno montañoso", 27); - attrMapDe.put("Area collinare", 27); - attrMapDe.put("Some climbing (no gear needed)", 28); - attrMapDe.put("leichtes Klettern (ohne Ausrüstung)", 28); - attrMapDe.put("fácil de subir (sin equipo)", 28); - attrMapDe.put("Arrampicata (attrezzatura non necessaria)", 28); - attrMapDe.put("Swimming required", 29); - attrMapDe.put("Schwimmen erforderlich", 29); - attrMapDe.put("Requiere nadar", 29); - attrMapDe.put("Nuoto necessario", 29); - attrMapDe.put("Access or parking fee", 36); - attrMapDe.put("Zugangs- bzw. Parkentgelt", 36); - attrMapDe.put("Acceso o parking pagando", 36); - attrMapDe.put("Tassa di ingresso o di parcheggio", 36); - attrMapPl.put("Bikes allowed", 85); - attrMapPl.put("Dostępna rowerem", 85); - attrMapPl.put("Hidden in natural surroundings (forests, mountains, etc.)", 60); - attrMapPl.put("Umiejscowiona na łonie natury (lasy, góry, itp.)", 60); - attrMapPl.put("Historic site", 61); - attrMapPl.put("Miejsce historyczne", 61); - attrMapDe.put("Point of interest", 30); - attrMapDe.put("interessanter Ort", 30); - attrMapDe.put("Punto de interes", 30); - attrMapDe.put("Punto di interesse", 30); - attrMapDe.put("Hidden wihin enclosed rooms (caves, buildings etc.)", 33); - attrMapDe.put("in geschlossenen Räumen (Höhle, Gebäude, etc.)", 33); - attrMapDe.put("en espacios confinados (cuevas, edificios, etc)", 33); - attrMapDe.put("All'interno di stanze chiuse (caverne, edifici, ecc.)", 33); - attrMapDe.put("Hidden under water", 34); - attrMapDe.put("Im Wasser versteckt", 34); - attrMapDe.put("En el agua", 34); - attrMapDe.put("Nell'acqua", 34); - attrMapDe.put("Parking area nearby", 18); - attrMapDe.put("Parkplatz in der Nähe", 18); - attrMapDe.put("Parking cercano", 18); - attrMapDe.put("Parcheggio nei pressi", 18); - attrMapDe.put("Public transportation", 19); - attrMapDe.put("erreichbar mit ÖVM", 19); - attrMapDe.put("Transporte Público", 19); - attrMapDe.put("Trasporto pubblico", 19); - attrMapDe.put("Drinking water nearby", 20); - attrMapDe.put("Trinkwasser in der Nähe", 20); - attrMapDe.put("Agua potable en las cercanias", 20); - attrMapDe.put("Acqua potabile nei pressi", 20); - attrMapDe.put("Public restrooms nearby", 21); - attrMapDe.put("öffentliche Toilette in der Nähe", 21); - attrMapDe.put("Aseos públicos cercanos", 21); - attrMapDe.put("Bagni pubblici nei pressi", 21); - attrMapDe.put("Public phone nearby", 22); - attrMapDe.put("Telefon in der Nähe", 22); - attrMapDe.put("Teléfono Público en las cercanias", 22); - attrMapDe.put("Telefono pubblico nei pressi", 22); - attrMapDe.put("First aid available", 23); - attrMapDe.put("Erste Hilfe verfügbar", 23); - attrMapDe.put("Disponible socorro rapido", 23); - attrMapDe.put("Disponibile pronto soccorso", 23); - attrMapDe.put("Available 24/7", 38); - attrMapDe.put("rund um die Uhr machbar", 38); - attrMapDe.put("Disponible las 24 horas", 38); - attrMapDe.put("Disponibile 24 ore", 38); - attrMapDe.put("Not 24/7", 39); - attrMapPl.put("Not 24/7", 80); - attrMapDe.put("Dostępna w określonych godzinach", 39); - attrMapPl.put("Dostępna w określonych godzinach", 80); - attrMapDe.put("nur zu bestimmten Uhrzeiten", 39); - attrMapPl.put("nur zu bestimmten Uhrzeiten", 80); - attrMapDe.put("Sólo disponible a ciertas horas", 39); - attrMapPl.put("Sólo disponible a ciertas horas", 80); - attrMapDe.put("Disponibile solo in certi orari", 39); - attrMapPl.put("Disponibile solo in certi orari", 80); - attrMapDe.put("Not recommended at night", 40); - attrMapDe.put("nur tagüber", 40); - attrMapDe.put("solo por el día", 40); - attrMapDe.put("solo di giorno", 40); - attrMapPl.put("Recommended at night", 91); - attrMapPl.put("Zalecane szukanie nocą", 91); - attrMapPl.put("am besten nachts findbar", 91); - attrMapDe.put("Only at night", 1); - attrMapDe.put("nur bei Nacht", 1); - attrMapDe.put("Sólo por la noche", 1); - attrMapDe.put("Solo di notte", 1); - attrMapDe.put("All seasons", 42); - attrMapDe.put("ganzjähig zugänglich", 42); - attrMapDe.put("Todas las temporadas", 42); - attrMapDe.put("Tutte le stagioni", 42); - attrMapDe.put("Only available during specified seasons", 60); - attrMapDe.put("Nur zu bestimmten Zeiten im Jahr", 60); - attrMapDe.put("Sólo disponible durante las estaciones especificadas", 60); - attrMapDe.put("Disponibile solo in certe stagioni", 60); - attrMapDe.put("Breeding season / protected nature", 43); - attrMapDe.put("Brutsaison / Naturschutz", 43); - attrMapDe.put("Temporada de reproducción / protección de la naturaleza", 43); - attrMapDe.put("Stagione di riproduzione / natura protetta", 43); - attrMapDe.put("Available during winter", 44); - attrMapDe.put("schneesicheres Versteck", 44); - attrMapDe.put("Nieve en el escondite", 44); - attrMapDe.put("Luogo a prova di neve", 44); - attrMapDe.put("Not at high water level", 41); - attrMapDe.put("nicht bei Hochwasser oder Flut", 41); - attrMapDe.put("Compass required", 47); - attrMapPl.put("Compass required", 47); - attrMapDe.put("Potrzebny kompas", 47); - attrMapPl.put("Potrzebny kompas", 47); - attrMapDe.put("Kompass", 47); - attrMapPl.put("Kompass", 47); - attrMapDe.put("Brújula", 47); - attrMapPl.put("Brújula", 47); - attrMapDe.put("Bussola", 47); - attrMapPl.put("Bussola", 47); - attrMapPl.put("Take something to write", 48); - attrMapPl.put("Weź coś do pisania", 48); - attrMapPl.put("You may need a shovel", 81); - attrMapPl.put("Potrzebna łopatka", 81); - attrMapDe.put("Flashlight required", 48); - attrMapPl.put("Flashlight required", 82); - attrMapDe.put("Potrzebna latarka", 48); - attrMapPl.put("Potrzebna latarka", 82); - attrMapDe.put("Taschenlampe", 48); - attrMapPl.put("Taschenlampe", 82); - attrMapDe.put("Linterna", 48); - attrMapPl.put("Linterna", 82); - attrMapDe.put("Lampada tascabile", 48); - attrMapPl.put("Lampada tascabile", 82); - attrMapDe.put("Climbing gear required", 49); - attrMapDe.put("Kletterzeug", 49); - attrMapDe.put("Equipo de escalada", 49); - attrMapDe.put("Attrezzatura per arrampicata", 49); - attrMapDe.put("Cave equipment required", 50); - attrMapDe.put("Höhlenzeug", 50); - attrMapDe.put("Equipación para cuevas", 50); - attrMapDe.put("Attrezzatura per grotta", 50); - attrMapDe.put("Diving equipment required", 51); - attrMapDe.put("Taucherausrüstung", 51); - attrMapDe.put("Diving equipment", 51); - attrMapDe.put("Equipo de buceo", 51); - attrMapDe.put("Special tools required", 46); - attrMapPl.put("Special tools required", 83); - attrMapDe.put("Wymagany dodatkowy sprzęt", 46); - attrMapPl.put("Wymagany dodatkowy sprzęt", 83); - attrMapDe.put("spezielle Ausrüstung", 46); - attrMapPl.put("spezielle Ausrüstung", 83); - attrMapDe.put("Equipamiento especial", 46); - attrMapPl.put("Equipamiento especial", 83); - attrMapDe.put("Equipaggiamento speciale", 46); - attrMapPl.put("Equipaggiamento speciale", 83); - attrMapDe.put("Requires a boat", 52); - attrMapPl.put("Requires a boat", 86); - attrMapDe.put("Wymaga sprzętu pływającego", 52); - attrMapPl.put("Wymaga sprzętu pływającego", 86); - attrMapDe.put("Wasserfahrzeug", 52); - attrMapPl.put("Wasserfahrzeug", 86); - attrMapDe.put("Barca", 52); - attrMapPl.put("Barca", 86); - attrMapDe.put("Barca", 52); - attrMapPl.put("Barca", 86); - attrMapDe.put("No GPS required", 35); - attrMapDe.put("ohne GPS findbar", 35); - attrMapDe.put("Sin GPS", 35); - attrMapDe.put("Senza GPS", 35); - attrMapDe.put("Dangerous area", 9); - attrMapPl.put("Dangerous area", 90); - attrMapDe.put("Skrzynka niebezpieczna", 9); - attrMapPl.put("Skrzynka niebezpieczna", 90); - attrMapDe.put("gefährliches Gebiet", 9); - attrMapPl.put("gefährliches Gebiet", 90); - attrMapDe.put("Zona Peligrosa", 9); - attrMapPl.put("Zona Peligrosa", 90); - attrMapDe.put("Area pericolosa", 9); - attrMapPl.put("Area pericolosa", 90); - attrMapDe.put("Active railway nearby", 10); - attrMapDe.put("aktive Eisenbahnlinie in der Nähe", 10); - attrMapDe.put("Cerca del ferrocarril activo", 10); - attrMapDe.put("Ferrovia attiva nei pressi", 10); - attrMapDe.put("Cliff / Rocks", 11); - attrMapDe.put("Klippen / Felsen", 11); - attrMapDe.put("Acantilado / Rocas", 11); - attrMapDe.put("Scogliera / Rocce", 11); - attrMapDe.put("Hunting", 12); - attrMapDe.put("Jagdgebiet", 12); - attrMapDe.put("Zona de Caza", 12); - attrMapDe.put("Caccia", 12); - attrMapDe.put("Thorns", 13); - attrMapDe.put("Dornen", 13); - attrMapDe.put("Espinas", 13); - attrMapDe.put("Spine", 13); - attrMapDe.put("Ticks", 14); - attrMapDe.put("Zecken", 14); - attrMapDe.put("Garrapatas", 14); - attrMapDe.put("Zecche", 14); - attrMapDe.put("Abandoned mines", 15); - attrMapDe.put("Folgen des Bergbaus", 15); - attrMapDe.put("Mina abandonada", 15); - attrMapDe.put("Miniere abbandonate", 15); - attrMapDe.put("Poisonous plants", 16); - attrMapDe.put("giftige Pflanzen", 16); - attrMapDe.put("Planta venenosa", 16); - attrMapDe.put("Piante velenose", 16); - attrMapDe.put("Dangerous animals", 17); - attrMapDe.put("giftige/gefährliche Tiere", 17); - attrMapDe.put("Animales Peligrosos", 17); - attrMapDe.put("Animali pericolosi", 17); - attrMapPl.put("Quick cache", 40); - attrMapPl.put("Szybka skrzynka", 40); - attrMapDe.put("Overnight stay necessary", 37); - attrMapDe.put("Übernachtung erforderlich", 37); - attrMapDe.put("Necesario pernoctar", 37); - attrMapDe.put("Necessario pernottamento", 37); - attrMapPl.put("Take your children", 41); - attrMapPl.put("Można zabrać dzieci", 41); - attrMapDe.put("Suited for children (10-12 yo)", 59); - attrMapDe.put("kindgerecht (10-12 Jahre)", 59); - attrMapDe.put("Apto para niños (10-12 años)", 59); - attrMapDe.put("Suited for children (10-12 anni)", 59); - // first trailer line - - } - - public static int getOcDeId(final String name) { - - int result = 0; - - if (attrMapDe.containsKey(name)) { - result = attrMapDe.get(name); - } - return result; - } -} diff --git a/main/src/cgeo/geocaching/connector/oc/OkapiClient.java b/main/src/cgeo/geocaching/connector/oc/OkapiClient.java index 24e30e7..c33891b 100644 --- a/main/src/cgeo/geocaching/connector/oc/OkapiClient.java +++ b/main/src/cgeo/geocaching/connector/oc/OkapiClient.java @@ -65,6 +65,7 @@ final class OkapiClient { private static final SynchronizedDateFormat ISO8601DATEFORMAT = new SynchronizedDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", Locale.getDefault()); private static final String CACHE_ATTRNAMES = "attrnames"; + private static final String CACHE_ATTR_ACODES = "attr_acodes"; private static final String WPT_LOCATION = "location"; private static final String WPT_DESCRIPTION = "description"; private static final String WPT_TYPE = "type"; @@ -113,7 +114,7 @@ final class OkapiClient { private static final String SERVICE_CACHE_CORE_FIELDS = "code|name|location|type|status|difficulty|terrain|size|date_hidden"; private static final String SERVICE_CACHE_CORE_L3_FIELDS = "is_found"; private static final String SERVICE_CACHE_ADDITIONAL_FIELDS = "owner|founds|notfounds|rating|rating_votes|recommendations|description|hint|images|latest_logs|alt_wpts|attrnames|req_passwd"; - private static final String SERVICE_CACHE_ADDITIONAL_CURRENT_FIELDS = "gc_code|attribution_note"; + private static final String SERVICE_CACHE_ADDITIONAL_CURRENT_FIELDS = "gc_code|attribution_note|attr_acodes"; private static final String SERVICE_CACHE_ADDITIONAL_L3_FIELDS = "is_watched|my_notes"; private static final String METHOD_SEARCH_ALL = "services/caches/search/all"; @@ -348,7 +349,7 @@ final class OkapiClient { } } - cache.setAttributes(parseAttributes(response.getJSONArray(CACHE_ATTRNAMES))); + cache.setAttributes(parseAttributes(response.getJSONArray(CACHE_ATTRNAMES), response.optJSONArray(CACHE_ATTR_ACODES))); cache.setLogs(parseLogs(response.getJSONArray(CACHE_LATEST_LOGS))); //TODO: Store license per cache //cache.setLicense(response.getString("attribution_note")); @@ -509,17 +510,20 @@ final class OkapiClient { return null; } - private static List<String> parseAttributes(final JSONArray nameList) { + private static List<String> parseAttributes(final JSONArray nameList, final JSONArray acodeList) { final List<String> result = new ArrayList<String>(); for (int i = 0; i < nameList.length(); i++) { try { final String name = nameList.getString(i); - final CacheAttribute attr = CacheAttribute.getByOcId(AttributeParser.getOcDeId(name)); + final int acode = acodeList != null ? Integer.parseInt(acodeList.getString(i).substring(1)) : CacheAttribute.NO_ID; + final CacheAttribute attr = CacheAttribute.getByOcACode(acode); if (attr != null) { result.add(attr.rawName); + } else { + result.add(name); } } catch (final JSONException e) { Log.e("OkapiClient.parseAttributes", e); diff --git a/main/src/cgeo/geocaching/enumerations/CacheAttribute.java b/main/src/cgeo/geocaching/enumerations/CacheAttribute.java index 1ddfeaf..31fc023 100644 --- a/main/src/cgeo/geocaching/enumerations/CacheAttribute.java +++ b/main/src/cgeo/geocaching/enumerations/CacheAttribute.java @@ -1,7 +1,7 @@ package cgeo.geocaching.enumerations; -import cgeo.geocaching.R; import cgeo.geocaching.CgeoApplication; +import cgeo.geocaching.R; import org.apache.commons.lang3.StringUtils; @@ -15,7 +15,7 @@ public enum CacheAttribute { // THIS LIST IS GENERATED: don't change anything here but read // project/attributes/readme.txt DOGS(1, -1, "dogs", R.drawable.attribute_dogs, R.string.attribute_dogs_yes, R.string.attribute_dogs_no), - BICYCLES(32, -1, "bicycles", R.drawable.attribute_bicycles, R.string.attribute_bicycles_yes, R.string.attribute_bicycles_no), + BICYCLES(32, 27, "bicycles", R.drawable.attribute_bicycles, R.string.attribute_bicycles_yes, R.string.attribute_bicycles_no), MOTORCYCLES(33, -1, "motorcycles", R.drawable.attribute_motorcycles, R.string.attribute_motorcycles_yes, R.string.attribute_motorcycles_no), QUADS(34, -1, "quads", R.drawable.attribute_quads, R.string.attribute_quads_yes, R.string.attribute_quads_no), JEEPS(35, -1, "jeeps", R.drawable.attribute_jeeps, R.string.attribute_jeeps_yes, R.string.attribute_jeeps_no), @@ -23,91 +23,91 @@ public enum CacheAttribute { HORSES(37, -1, "horses", R.drawable.attribute_horses, R.string.attribute_horses_yes, R.string.attribute_horses_no), CAMPFIRES(38, -1, "campfires", R.drawable.attribute_campfires, R.string.attribute_campfires_yes, R.string.attribute_campfires_no), RV(46, -1, "rv", R.drawable.attribute_rv, R.string.attribute_rv_yes, R.string.attribute_rv_no), - KIDS(6, 59, "kids", R.drawable.attribute_kids, R.string.attribute_kids_yes, R.string.attribute_kids_no), + KIDS(6, 71, "kids", R.drawable.attribute_kids, R.string.attribute_kids_yes, R.string.attribute_kids_no), ONEHOUR(7, -1, "onehour", R.drawable.attribute_onehour, R.string.attribute_onehour_yes, R.string.attribute_onehour_no), SCENIC(8, -1, "scenic", R.drawable.attribute_scenic, R.string.attribute_scenic_yes, R.string.attribute_scenic_no), - HIKING(9, 25, "hiking", R.drawable.attribute_hiking, R.string.attribute_hiking_yes, R.string.attribute_hiking_no), + HIKING(9, 21, "hiking", R.drawable.attribute_hiking, R.string.attribute_hiking_yes, R.string.attribute_hiking_no), CLIMBING(10, -1, "climbing", R.drawable.attribute_climbing, R.string.attribute_climbing_yes, R.string.attribute_climbing_no), WADING(11, -1, "wading", R.drawable.attribute_wading, R.string.attribute_wading_yes, R.string.attribute_wading_no), - SWIMMING(12, 29, "swimming", R.drawable.attribute_swimming, R.string.attribute_swimming_yes, R.string.attribute_swimming_no), - AVAILABLE(13, 38, "available", R.drawable.attribute_available, R.string.attribute_available_yes, R.string.attribute_available_no), - NIGHT(14, -1, "night", R.drawable.attribute_night, R.string.attribute_night_yes, R.string.attribute_night_no), + SWIMMING(12, 25, "swimming", R.drawable.attribute_swimming, R.string.attribute_swimming_yes, R.string.attribute_swimming_no), + AVAILABLE(13, 39, "available", R.drawable.attribute_available, R.string.attribute_available_yes, R.string.attribute_available_no), + NIGHT(14, 42, "night", R.drawable.attribute_night, R.string.attribute_night_yes, R.string.attribute_night_no), WINTER(15, -1, "winter", R.drawable.attribute_winter, R.string.attribute_winter_yes, R.string.attribute_winter_no), STEALTH(40, -1, "stealth", R.drawable.attribute_stealth, R.string.attribute_stealth_yes, R.string.attribute_stealth_no), FIRSTAID(42, -1, "firstaid", R.drawable.attribute_firstaid, R.string.attribute_firstaid_yes, R.string.attribute_firstaid_no), COW(43, -1, "cow", R.drawable.attribute_cow, R.string.attribute_cow_yes, R.string.attribute_cow_no), FIELD_PUZZLE(47, -1, "field_puzzle", R.drawable.attribute_field_puzzle, R.string.attribute_field_puzzle_yes, R.string.attribute_field_puzzle_no), - NIGHTCACHE(52, 1, "nightcache", R.drawable.attribute_nightcache, R.string.attribute_nightcache_yes, R.string.attribute_nightcache_no), - PARKNGRAB(53, 24, "parkngrab", R.drawable.attribute_parkngrab, R.string.attribute_parkngrab_yes, R.string.attribute_parkngrab_no), + NIGHTCACHE(52, 43, "nightcache", R.drawable.attribute_nightcache, R.string.attribute_nightcache_yes, R.string.attribute_nightcache_no), + PARKNGRAB(53, 19, "parkngrab", R.drawable.attribute_parkngrab, R.string.attribute_parkngrab_yes, R.string.attribute_parkngrab_no), ABANDONEDBUILDING(54, -1, "abandonedbuilding", R.drawable.attribute_abandonedbuilding, R.string.attribute_abandonedbuilding_yes, R.string.attribute_abandonedbuilding_no), HIKE_SHORT(55, -1, "hike_short", R.drawable.attribute_hike_short, R.string.attribute_hike_short_yes, R.string.attribute_hike_short_no), HIKE_MED(56, -1, "hike_med", R.drawable.attribute_hike_med, R.string.attribute_hike_med_yes, R.string.attribute_hike_med_no), HIKE_LONG(57, -1, "hike_long", R.drawable.attribute_hike_long, R.string.attribute_hike_long_yes, R.string.attribute_hike_long_no), - SEASONAL(62, 60, "seasonal", R.drawable.attribute_seasonal, R.string.attribute_seasonal_yes, R.string.attribute_seasonal_no), + SEASONAL(62, 45, "seasonal", R.drawable.attribute_seasonal, R.string.attribute_seasonal_yes, R.string.attribute_seasonal_no), TOURISTOK(63, -1, "touristok", R.drawable.attribute_touristok, R.string.attribute_touristok_yes, R.string.attribute_touristok_no), FRONTYARD(65, -1, "frontyard", R.drawable.attribute_frontyard, R.string.attribute_frontyard_yes, R.string.attribute_frontyard_no), TEAMWORK(66, -1, "teamwork", R.drawable.attribute_teamwork, R.string.attribute_teamwork_yes, R.string.attribute_teamwork_no), LANDF(45, -1, "landf", R.drawable.attribute_landf, R.string.attribute_landf_yes, R.string.attribute_landf_no), PARTNERSHIP(61, -1, "partnership", R.drawable.attribute_partnership, R.string.attribute_partnership_yes, R.string.attribute_partnership_no), - FEE(2, 36, "fee", R.drawable.attribute_fee, R.string.attribute_fee_yes, R.string.attribute_fee_no), - RAPPELLING(3, 49, "rappelling", R.drawable.attribute_rappelling, R.string.attribute_rappelling_yes, R.string.attribute_rappelling_no), - BOAT(4, 52, "boat", R.drawable.attribute_boat, R.string.attribute_boat_yes, R.string.attribute_boat_no), - SCUBA(5, 51, "scuba", R.drawable.attribute_scuba, R.string.attribute_scuba_yes, R.string.attribute_scuba_no), - FLASHLIGHT(44, 48, "flashlight", R.drawable.attribute_flashlight, R.string.attribute_flashlight_yes, R.string.attribute_flashlight_no), + FEE(2, 26, "fee", R.drawable.attribute_fee, R.string.attribute_fee_yes, R.string.attribute_fee_no), + RAPPELLING(3, 53, "rappelling", R.drawable.attribute_rappelling, R.string.attribute_rappelling_yes, R.string.attribute_rappelling_no), + BOAT(4, 57, "boat", R.drawable.attribute_boat, R.string.attribute_boat_yes, R.string.attribute_boat_no), + SCUBA(5, 55, "scuba", R.drawable.attribute_scuba, R.string.attribute_scuba_yes, R.string.attribute_scuba_no), + FLASHLIGHT(44, 52, "flashlight", R.drawable.attribute_flashlight, R.string.attribute_flashlight_yes, R.string.attribute_flashlight_no), UV(48, -1, "uv", R.drawable.attribute_uv, R.string.attribute_uv_yes, R.string.attribute_uv_no), SNOWSHOES(49, -1, "snowshoes", R.drawable.attribute_snowshoes, R.string.attribute_snowshoes_yes, R.string.attribute_snowshoes_no), SKIIS(50, -1, "skiis", R.drawable.attribute_skiis, R.string.attribute_skiis_yes, R.string.attribute_skiis_no), - S_TOOL(51, 46, "s_tool", R.drawable.attribute_s_tool, R.string.attribute_s_tool_yes, R.string.attribute_s_tool_no), - WIRELESSBEACON(60, -1, "wirelessbeacon", R.drawable.attribute_wirelessbeacon, R.string.attribute_wirelessbeacon_yes, R.string.attribute_wirelessbeacon_no), + S_TOOL(51, 56, "s_tool", R.drawable.attribute_s_tool, R.string.attribute_s_tool_yes, R.string.attribute_s_tool_no), + WIRELESSBEACON(60, 9, "wirelessbeacon", R.drawable.attribute_wirelessbeacon, R.string.attribute_wirelessbeacon_yes, R.string.attribute_wirelessbeacon_no), TREECLIMBING(64, -1, "treeclimbing", R.drawable.attribute_treeclimbing, R.string.attribute_treeclimbing_yes, R.string.attribute_treeclimbing_no), - POISONOAK(17, 16, "poisonoak", R.drawable.attribute_poisonoak, R.string.attribute_poisonoak_yes, R.string.attribute_poisonoak_no), - DANGEROUSANIMALS(18, 17, "dangerousanimals", R.drawable.attribute_dangerousanimals, R.string.attribute_dangerousanimals_yes, R.string.attribute_dangerousanimals_no), - TICKS(19, 14, "ticks", R.drawable.attribute_ticks, R.string.attribute_ticks_yes, R.string.attribute_ticks_no), - MINE(20, 15, "mine", R.drawable.attribute_mine, R.string.attribute_mine_yes, R.string.attribute_mine_no), - CLIFF(21, 11, "cliff", R.drawable.attribute_cliff, R.string.attribute_cliff_yes, R.string.attribute_cliff_no), - HUNTING(22, 12, "hunting", R.drawable.attribute_hunting, R.string.attribute_hunting_yes, R.string.attribute_hunting_no), - DANGER(23, 9, "danger", R.drawable.attribute_danger, R.string.attribute_danger_yes, R.string.attribute_danger_no), - THORN(39, 13, "thorn", R.drawable.attribute_thorn, R.string.attribute_thorn_yes, R.string.attribute_thorn_no), - WHEELCHAIR(24, -1, "wheelchair", R.drawable.attribute_wheelchair, R.string.attribute_wheelchair_yes, R.string.attribute_wheelchair_no), - PARKING(25, 18, "parking", R.drawable.attribute_parking, R.string.attribute_parking_yes, R.string.attribute_parking_no), - PUBLIC(26, 19, "public", R.drawable.attribute_public, R.string.attribute_public_yes, R.string.attribute_public_no), - WATER(27, 20, "water", R.drawable.attribute_water, R.string.attribute_water_yes, R.string.attribute_water_no), - RESTROOMS(28, 21, "restrooms", R.drawable.attribute_restrooms, R.string.attribute_restrooms_yes, R.string.attribute_restrooms_no), - PHONE(29, 22, "phone", R.drawable.attribute_phone, R.string.attribute_phone_yes, R.string.attribute_phone_no), + POISONOAK(17, 66, "poisonoak", R.drawable.attribute_poisonoak, R.string.attribute_poisonoak_yes, R.string.attribute_poisonoak_no), + DANGEROUSANIMALS(18, 67, "dangerousanimals", R.drawable.attribute_dangerousanimals, R.string.attribute_dangerousanimals_yes, R.string.attribute_dangerousanimals_no), + TICKS(19, 64, "ticks", R.drawable.attribute_ticks, R.string.attribute_ticks_yes, R.string.attribute_ticks_no), + MINE(20, 65, "mine", R.drawable.attribute_mine, R.string.attribute_mine_yes, R.string.attribute_mine_no), + CLIFF(21, 61, "cliff", R.drawable.attribute_cliff, R.string.attribute_cliff_yes, R.string.attribute_cliff_no), + HUNTING(22, 62, "hunting", R.drawable.attribute_hunting, R.string.attribute_hunting_yes, R.string.attribute_hunting_no), + DANGER(23, 59, "danger", R.drawable.attribute_danger, R.string.attribute_danger_yes, R.string.attribute_danger_no), + THORN(39, 63, "thorn", R.drawable.attribute_thorn, R.string.attribute_thorn_yes, R.string.attribute_thorn_no), + WHEELCHAIR(24, 18, "wheelchair", R.drawable.attribute_wheelchair, R.string.attribute_wheelchair_yes, R.string.attribute_wheelchair_no), + PARKING(25, 33, "parking", R.drawable.attribute_parking, R.string.attribute_parking_yes, R.string.attribute_parking_no), + PUBLIC(26, 34, "public", R.drawable.attribute_public, R.string.attribute_public_yes, R.string.attribute_public_no), + WATER(27, 35, "water", R.drawable.attribute_water, R.string.attribute_water_yes, R.string.attribute_water_no), + RESTROOMS(28, 36, "restrooms", R.drawable.attribute_restrooms, R.string.attribute_restrooms_yes, R.string.attribute_restrooms_no), + PHONE(29, 37, "phone", R.drawable.attribute_phone, R.string.attribute_phone_yes, R.string.attribute_phone_no), PICNIC(30, -1, "picnic", R.drawable.attribute_picnic, R.string.attribute_picnic_yes, R.string.attribute_picnic_no), CAMPING(31, -1, "camping", R.drawable.attribute_camping, R.string.attribute_camping_yes, R.string.attribute_camping_no), STROLLER(41, -1, "stroller", R.drawable.attribute_stroller, R.string.attribute_stroller_yes, R.string.attribute_stroller_no), FUEL(58, -1, "fuel", R.drawable.attribute_fuel, R.string.attribute_fuel_yes, R.string.attribute_fuel_no), FOOD(59, -1, "food", R.drawable.attribute_food, R.string.attribute_food_yes, R.string.attribute_food_no), - OC_ONLY(-1, 6, "oc_only", R.drawable.attribute_oc_only, R.string.attribute_oc_only_yes, R.string.attribute_oc_only_no), - LINK_ONLY(-1, 7, "link_only", R.drawable.attribute_link_only, R.string.attribute_link_only_yes, R.string.attribute_link_only_no), - LETTERBOX(-1, 8, "letterbox", R.drawable.attribute_letterbox, R.string.attribute_letterbox_yes, R.string.attribute_letterbox_no), - RAILWAY(-1, 10, "railway", R.drawable.attribute_railway, R.string.attribute_railway_yes, R.string.attribute_railway_no), - SYRINGE(-1, 23, "syringe", R.drawable.attribute_syringe, R.string.attribute_syringe_yes, R.string.attribute_syringe_no), - SWAMP(-1, 26, "swamp", R.drawable.attribute_swamp, R.string.attribute_swamp_yes, R.string.attribute_swamp_no), - HILLS(-1, 27, "hills", R.drawable.attribute_hills, R.string.attribute_hills_yes, R.string.attribute_hills_no), - EASY_CLIMBING(-1, 28, "easy_climbing", R.drawable.attribute_easy_climbing, R.string.attribute_easy_climbing_yes, R.string.attribute_easy_climbing_no), + OC_ONLY(-1, -1, "oc_only", R.drawable.attribute_oc_only, R.string.attribute_oc_only_yes, R.string.attribute_oc_only_no), + LINK_ONLY(-1, -1, "link_only", R.drawable.attribute_link_only, R.string.attribute_link_only_yes, R.string.attribute_link_only_no), + LETTERBOX(-1, 4, "letterbox", R.drawable.attribute_letterbox, R.string.attribute_letterbox_yes, R.string.attribute_letterbox_no), + RAILWAY(-1, 60, "railway", R.drawable.attribute_railway, R.string.attribute_railway_yes, R.string.attribute_railway_no), + SYRINGE(-1, 38, "syringe", R.drawable.attribute_syringe, R.string.attribute_syringe_yes, R.string.attribute_syringe_no), + SWAMP(-1, 22, "swamp", R.drawable.attribute_swamp, R.string.attribute_swamp_yes, R.string.attribute_swamp_no), + HILLS(-1, 23, "hills", R.drawable.attribute_hills, R.string.attribute_hills_yes, R.string.attribute_hills_no), + EASY_CLIMBING(-1, 24, "easy_climbing", R.drawable.attribute_easy_climbing, R.string.attribute_easy_climbing_yes, R.string.attribute_easy_climbing_no), POI(-1, 30, "poi", R.drawable.attribute_poi, R.string.attribute_poi_yes, R.string.attribute_poi_no), - MOVING_TARGET(-1, 31, "moving_target", R.drawable.attribute_moving_target, R.string.attribute_moving_target_yes, R.string.attribute_moving_target_no), - WEBCAM(-1, 32, "webcam", R.drawable.attribute_webcam, R.string.attribute_webcam_yes, R.string.attribute_webcam_no), - INSIDE(-1, 33, "inside", R.drawable.attribute_inside, R.string.attribute_inside_yes, R.string.attribute_inside_no), - IN_WATER(-1, 34, "in_water", R.drawable.attribute_in_water, R.string.attribute_in_water_yes, R.string.attribute_in_water_no), - NO_GPS(-1, 35, "no_gps", R.drawable.attribute_no_gps, R.string.attribute_no_gps_yes, R.string.attribute_no_gps_no), - OVERNIGHT(-1, 37, "overnight", R.drawable.attribute_overnight, R.string.attribute_overnight_yes, R.string.attribute_overnight_no), - SPECIFIC_TIMES(-1, 39, "specific_times", R.drawable.attribute_specific_times, R.string.attribute_specific_times_yes, R.string.attribute_specific_times_no), - DAY(-1, 40, "day", R.drawable.attribute_day, R.string.attribute_day_yes, R.string.attribute_day_no), - TIDE(-1, 41, "tide", R.drawable.attribute_tide, R.string.attribute_tide_yes, R.string.attribute_tide_no), - ALL_SEASONS(-1, 42, "all_seasons", R.drawable.attribute_all_seasons, R.string.attribute_all_seasons_yes, R.string.attribute_all_seasons_no), - BREEDING(-1, 43, "breeding", R.drawable.attribute_breeding, R.string.attribute_breeding_yes, R.string.attribute_breeding_no), - SNOW_PROOF(-1, 44, "snow_proof", R.drawable.attribute_snow_proof, R.string.attribute_snow_proof_yes, R.string.attribute_snow_proof_no), - COMPASS(-1, 47, "compass", R.drawable.attribute_compass, R.string.attribute_compass_yes, R.string.attribute_compass_no), - CAVE(-1, 50, "cave", R.drawable.attribute_cave, R.string.attribute_cave_yes, R.string.attribute_cave_no), - AIRCRAFT(-1, 53, "aircraft", R.drawable.attribute_aircraft, R.string.attribute_aircraft_yes, R.string.attribute_aircraft_no), - INVESTIGATION(-1, 54, "investigation", R.drawable.attribute_investigation, R.string.attribute_investigation_yes, R.string.attribute_investigation_no), - PUZZLE(-1, 55, "puzzle", R.drawable.attribute_puzzle, R.string.attribute_puzzle_yes, R.string.attribute_puzzle_no), - ARITHMETIC(-1, 56, "arithmetic", R.drawable.attribute_arithmetic, R.string.attribute_arithmetic_yes, R.string.attribute_arithmetic_no), - OTHER_CACHE(-1, 57, "other_cache", R.drawable.attribute_other_cache, R.string.attribute_other_cache_yes, R.string.attribute_other_cache_no), - ASK_OWNER(-1, 58, "ask_owner", R.drawable.attribute_ask_owner, R.string.attribute_ask_owner_yes, R.string.attribute_ask_owner_no), + MOVING_TARGET(-1, 11, "moving_target", R.drawable.attribute_moving_target, R.string.attribute_moving_target_yes, R.string.attribute_moving_target_no), + WEBCAM(-1, 12, "webcam", R.drawable.attribute_webcam, R.string.attribute_webcam_yes, R.string.attribute_webcam_no), + INSIDE(-1, 31, "inside", R.drawable.attribute_inside, R.string.attribute_inside_yes, R.string.attribute_inside_no), + IN_WATER(-1, 32, "in_water", R.drawable.attribute_in_water, R.string.attribute_in_water_yes, R.string.attribute_in_water_no), + NO_GPS(-1, 58, "no_gps", R.drawable.attribute_no_gps, R.string.attribute_no_gps_yes, R.string.attribute_no_gps_no), + OVERNIGHT(-1, 69, "overnight", R.drawable.attribute_overnight, R.string.attribute_overnight_yes, R.string.attribute_overnight_no), + SPECIFIC_TIMES(-1, 40, "specific_times", R.drawable.attribute_specific_times, R.string.attribute_specific_times_yes, R.string.attribute_specific_times_no), + DAY(-1, 41, "day", R.drawable.attribute_day, R.string.attribute_day_yes, R.string.attribute_day_no), + TIDE(-1, 48, "tide", R.drawable.attribute_tide, R.string.attribute_tide_yes, R.string.attribute_tide_no), + ALL_SEASONS(-1, 44, "all_seasons", R.drawable.attribute_all_seasons, R.string.attribute_all_seasons_yes, R.string.attribute_all_seasons_no), + BREEDING(-1, 46, "breeding", R.drawable.attribute_breeding, R.string.attribute_breeding_yes, R.string.attribute_breeding_no), + SNOW_PROOF(-1, 47, "snow_proof", R.drawable.attribute_snow_proof, R.string.attribute_snow_proof_yes, R.string.attribute_snow_proof_no), + COMPASS(-1, 49, "compass", R.drawable.attribute_compass, R.string.attribute_compass_yes, R.string.attribute_compass_no), + CAVE(-1, 54, "cave", R.drawable.attribute_cave, R.string.attribute_cave_yes, R.string.attribute_cave_no), + AIRCRAFT(-1, -1, "aircraft", R.drawable.attribute_aircraft, R.string.attribute_aircraft_yes, R.string.attribute_aircraft_no), + INVESTIGATION(-1, 14, "investigation", R.drawable.attribute_investigation, R.string.attribute_investigation_yes, R.string.attribute_investigation_no), + PUZZLE(-1, 15, "puzzle", R.drawable.attribute_puzzle, R.string.attribute_puzzle_yes, R.string.attribute_puzzle_no), + ARITHMETIC(-1, 16, "arithmetic", R.drawable.attribute_arithmetic, R.string.attribute_arithmetic_yes, R.string.attribute_arithmetic_no), + OTHER_CACHE(-1, 13, "other_cache", R.drawable.attribute_other_cache, R.string.attribute_other_cache_yes, R.string.attribute_other_cache_no), + ASK_OWNER(-1, 17, "ask_owner", R.drawable.attribute_ask_owner, R.string.attribute_ask_owner_yes, R.string.attribute_ask_owner_no), UNKNOWN(-1, -1, "unknown", R.drawable.attribute_unknown, R.string.attribute_unknown_yes, R.string.attribute_unknown_no), GEOTOUR(67, -1, "geotour", R.drawable.attribute_geotour, R.string.attribute_geotour_yes, R.string.attribute_geotour_no); // THIS LIST IS GENERATED: don't change anything here but read @@ -119,16 +119,16 @@ public enum CacheAttribute { public static final int NO_ID = -1; public final int gcid; - public final int ocid; + public final int ocacode; public final String rawName; public final int drawableId; public final int stringIdYes; public final int stringIdNo; - CacheAttribute(final int gcid, final int ocid, final String rawName, + CacheAttribute(final int gcid, final int ocacode, final String rawName, final int drawableId, final int stringIdYes, final int stringIdNo) { this.gcid = gcid; - this.ocid = ocid; + this.ocacode = ocacode; this.rawName = rawName; this.drawableId = drawableId; this.stringIdYes = stringIdYes; @@ -149,7 +149,7 @@ public enum CacheAttribute { private final static Map<String, CacheAttribute> FIND_BY_GCRAWNAME; private final static SparseArray<CacheAttribute> FIND_BY_GCID = new SparseArray<CacheAttribute>(); - private final static SparseArray<CacheAttribute> FIND_BY_OCID = new SparseArray<CacheAttribute>(); + private final static SparseArray<CacheAttribute> FIND_BY_OCACODE = new SparseArray<CacheAttribute>(); static { final HashMap<String, CacheAttribute> mapGcRawNames = new HashMap<String, CacheAttribute>(); for (CacheAttribute attr : values()) { @@ -157,8 +157,8 @@ public enum CacheAttribute { if (attr.gcid != NO_ID) { FIND_BY_GCID.put(attr.gcid, attr); } - if (attr.ocid != NO_ID) { - FIND_BY_OCID.put(attr.ocid, attr); + if (attr.ocacode != NO_ID) { + FIND_BY_OCACODE.put(attr.ocacode, attr); } } FIND_BY_GCRAWNAME = Collections.unmodifiableMap(mapGcRawNames); @@ -172,8 +172,8 @@ public enum CacheAttribute { return FIND_BY_GCID.get(gcid); } - public static CacheAttribute getByOcId(final int ocid) { - return FIND_BY_OCID.get(ocid); + public static CacheAttribute getByOcACode(final int ocAcode) { + return FIND_BY_OCACODE.get(ocAcode); } public static String trimAttributeName(String attributeName) { |
