aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrsudev <rasch@munin-soft.de>2013-09-13 07:47:57 +0200
committerrsudev <rasch@munin-soft.de>2013-09-13 07:47:57 +0200
commit178e91c7e5810d6407ac509ffc103a99139a2b5f (patch)
tree4e4c1ce216b8cd57c4309eece05070e40f7ed901 /main
parentcf25e4b4282b1b38311e7ac854b64eb87bfad5f9 (diff)
parent3032c32be5ba8c19eeb02c1e6d0dce3db307d511 (diff)
downloadcgeo-178e91c7e5810d6407ac509ffc103a99139a2b5f.zip
cgeo-178e91c7e5810d6407ac509ffc103a99139a2b5f.tar.gz
cgeo-178e91c7e5810d6407ac509ffc103a99139a2b5f.tar.bz2
Merge branch 'issue-3220'
Diffstat (limited to 'main')
-rw-r--r--main/res/values/preference_keys.xml1
-rw-r--r--main/res/values/strings.xml2
-rw-r--r--main/res/xml/preferences.xml6
-rw-r--r--main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java5
-rw-r--r--main/src/cgeo/geocaching/settings/Settings.java4
5 files changed, 17 insertions, 1 deletions
diff --git a/main/res/values/preference_keys.xml b/main/res/values/preference_keys.xml
index e47cb9e..38012f5 100644
--- a/main/res/values/preference_keys.xml
+++ b/main/res/values/preference_keys.xml
@@ -38,6 +38,7 @@
<string name="pref_choose_list">choose_list</string>
<string name="pref_mapsource">mapsource</string>
<string name="pref_mapDirectory">mapDirectory</string>
+ <string name="pref_mapsforge_scale_text">mapsforgeScaleText</string>
<string name="pref_renderthemepath">renderthemepath</string>
<string name="pref_showwaypointsthreshold">waypointsthreshold</string>
<string name="pref_maptrail">maptrail</string>
diff --git a/main/res/values/strings.xml b/main/res/values/strings.xml
index 9d2de4a..012bfe1 100644
--- a/main/res/values/strings.xml
+++ b/main/res/values/strings.xml
@@ -478,6 +478,8 @@
<string name="settings_info_themes_title">Info on Map Themes</string>
<string name="settings_info_themes">c:geo supports custom themes for offline maps. These can be used to change the color style of the map (e.g. to have a nightview map) or to highlight certain objects like cycle paths or height lines within the map.</string>
<string name="init_mapsource_select">Select Map Source</string>
+ <string name="settings_title_scale_map_text">Scale Map Text</string>
+ <string name="settings_summary_scale_map_text">Scale text labels on offline map according to device dpi</string>
<string name="init_map_directory_description">Directory with offline maps</string>
<string name="init_gpx_exportdir">GPX Export Directory</string>
<string name="init_gpx_importdir">GPX Import Directory</string>
diff --git a/main/res/xml/preferences.xml b/main/res/xml/preferences.xml
index 6fdc701..4773acf 100644
--- a/main/res/xml/preferences.xml
+++ b/main/res/xml/preferences.xml
@@ -277,6 +277,12 @@
<Preference
android:key="@string/pref_renderthemepath"
android:title="@string/init_rendertheme_folder" />
+ <CheckBoxPreference
+ android:key="@string/pref_mapsforge_scale_text"
+ android:title="@string/settings_title_scale_map_text"
+ android:summary="@string/settings_summary_scale_map_text"
+ android:defaultValue="true" />
+
</PreferenceCategory>
<PreferenceCategory android:title="@string/settings_title_map_content" >
<Preference
diff --git a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java
index aa11405..dc4e82c 100644
--- a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java
+++ b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java
@@ -1,7 +1,6 @@
package cgeo.geocaching.maps.mapsforge;
import cgeo.geocaching.R;
-import cgeo.geocaching.settings.Settings;
import cgeo.geocaching.geopoint.Viewport;
import cgeo.geocaching.maps.CachesOverlay;
import cgeo.geocaching.maps.PositionOverlay;
@@ -15,6 +14,7 @@ import cgeo.geocaching.maps.interfaces.MapViewImpl;
import cgeo.geocaching.maps.interfaces.OnMapDragListener;
import cgeo.geocaching.maps.interfaces.OverlayImpl;
import cgeo.geocaching.maps.interfaces.OverlayImpl.OverlayType;
+import cgeo.geocaching.settings.Settings;
import cgeo.geocaching.utils.Log;
import org.apache.commons.lang3.StringUtils;
@@ -46,6 +46,9 @@ public class MapsforgeMapView extends MapView implements MapViewImpl {
public MapsforgeMapView(Context context, AttributeSet attrs) {
super(context, attrs);
gestureDetector = new GestureDetector(context, new GestureListener());
+ if (Settings.isScaleMapsforgeText()) {
+ this.setTextScale(getResources().getDisplayMetrics().density);
+ }
}
@Override
diff --git a/main/src/cgeo/geocaching/settings/Settings.java b/main/src/cgeo/geocaching/settings/Settings.java
index fe1e191..34f5dc1 100644
--- a/main/src/cgeo/geocaching/settings/Settings.java
+++ b/main/src/cgeo/geocaching/settings/Settings.java
@@ -441,6 +441,10 @@ public final class Settings {
return MapsforgeMapProvider.isValidMapFile(mapFileIn);
}
+ public static boolean isScaleMapsforgeText() {
+ return getBoolean(R.string.pref_mapsforge_scale_text, true);
+ }
+
public static CoordInputFormatEnum getCoordInputFormat() {
return CoordInputFormatEnum.fromInt(getInt(R.string.pref_coordinputformat, 0));
}