From 4990b827d993d91e5bbc833b95482d38de3144ef Mon Sep 17 00:00:00 2001
From: Hannes Janetzek <hannes.janetzek@gmail.com>
Date: Fri, 25 Jan 2013 17:45:16 +0100
Subject: [PATCH] rename osmarender theme to 'default'

---
 src/org/oscim/theme/InternalRenderTheme.java          | 10 +++-------
 .../theme/osmarender/{osmarender.xml => default.xml}  |  6 +++---
 src/org/oscim/view/MapActivity.java                   | 11 +++++++----
 3 files changed, 13 insertions(+), 14 deletions(-)
 rename src/org/oscim/theme/osmarender/{osmarender.xml => default.xml} (99%)

diff --git a/src/org/oscim/theme/InternalRenderTheme.java b/src/org/oscim/theme/InternalRenderTheme.java
index 048780ee..23868e36 100644
--- a/src/org/oscim/theme/InternalRenderTheme.java
+++ b/src/org/oscim/theme/InternalRenderTheme.java
@@ -1,5 +1,6 @@
 /*
  * Copyright 2010, 2011, 2012 mapsforge.org
+ * Copyright 2013 OpenScienceMap.org
  *
  * This program is free software: you can redistribute it and/or modify it under the
  * terms of the GNU Lesser General Public License as published by the Free Software
@@ -16,17 +17,12 @@ package org.oscim.theme;
 
 import java.io.InputStream;
 
-
 /**
  * Enumeration of all internal rendering themes.
  */
 public enum InternalRenderTheme implements Theme {
-	/**
-	 * A rendering theme similar to the OpenStreetMap Osmarender style.
-	 * 
-	 * @see <a href="http://wiki.openstreetmap.org/wiki/Osmarender">Osmarender</a>
-	 */
-	OSMARENDER("/org/oscim/theme/osmarender/osmarender.xml"),
+
+	DEFAULT("/org/oscim/theme/osmarender/default.xml"),
 
 	TRONRENDER("/org/oscim/theme/osmarender/tronrender.xml");
 
diff --git a/src/org/oscim/theme/osmarender/osmarender.xml b/src/org/oscim/theme/osmarender/default.xml
similarity index 99%
rename from src/org/oscim/theme/osmarender/osmarender.xml
rename to src/org/oscim/theme/osmarender/default.xml
index 4b55678d..27cf3f48 100644
--- a/src/org/oscim/theme/osmarender/osmarender.xml
+++ b/src/org/oscim/theme/osmarender/default.xml
@@ -9,7 +9,7 @@
   
   <style-area name="residential"         fill="#f0eee8" fade="10"/>
   
-  <style-area name="railway|industrial"  fill="#e6e1e4" fade="10"/>
+  <style-area name="railway|industrial"  fill="#e6e3e5" fade="10"/>
   <!-- "#f0fae7" mint green  -->
   <style-area name="farmland"            fill="#fff8bf" fade="11" />
   
@@ -499,12 +499,12 @@
         <area fill="#e9e6e3" fade="15" /> -->
       </rule>
       
-      <!-- <rule e="way" k="*" v="*" zoom-min="17">
+       <rule e="way" k="*" v="*" zoom-min="17">
           <caption k="name" font-style="bold" font-size="10" fill="#4040ff"
           stroke="#ffffff" stroke-width="2.0" />
           <caption k="addr:housenumber" font-style="bold" font-size="10" fill="#606060" 
           stroke="#ffffff" stroke-width="2.0" />
-          </rule> -->
+          </rule>
     </rule>
 
     <!-- outline 1 - 4 -->
diff --git a/src/org/oscim/view/MapActivity.java b/src/org/oscim/view/MapActivity.java
index 968b1d59..545a49fc 100644
--- a/src/org/oscim/view/MapActivity.java
+++ b/src/org/oscim/view/MapActivity.java
@@ -100,7 +100,6 @@ public abstract class MapActivity extends Activity {
 
 	/**
 	 * This method is called once by each MapView during its setup process.
-	 * 
 	 * @param mapView
 	 *            the calling MapView.
 	 */
@@ -131,16 +130,20 @@ public abstract class MapActivity extends Activity {
 		}
 
 		String theme = sharedPreferences.getString(KEY_THEME,
-				InternalRenderTheme.OSMARENDER.name());
+				InternalRenderTheme.DEFAULT.name());
 
 		if (theme.startsWith("/")) {
 			try {
 				mapView.setRenderTheme(theme);
 			} catch (FileNotFoundException e) {
-				mapView.setRenderTheme(InternalRenderTheme.OSMARENDER);
+				mapView.setRenderTheme(InternalRenderTheme.DEFAULT);
 			}
 		} else {
-			mapView.setRenderTheme(InternalRenderTheme.valueOf(theme));
+			try {
+				mapView.setRenderTheme(InternalRenderTheme.valueOf(theme));
+			} catch (IllegalArgumentException e) {
+				mapView.setRenderTheme(InternalRenderTheme.DEFAULT);
+			}
 		}
 	}
 }