diff options
| author | rsudev <rasch@munin-soft.de> | 2013-09-13 07:47:00 +0200 |
|---|---|---|
| committer | rsudev <rasch@munin-soft.de> | 2013-09-13 07:47:00 +0200 |
| commit | 3032c32be5ba8c19eeb02c1e6d0dce3db307d511 (patch) | |
| tree | bc19b7eb9abd981f021cb9db9f20496192a16292 /main | |
| parent | e150d39ab061d08455a1d75bec811fd322a211b6 (diff) | |
| download | cgeo-3032c32be5ba8c19eeb02c1e6d0dce3db307d511.zip cgeo-3032c32be5ba8c19eeb02c1e6d0dce3db307d511.tar.gz cgeo-3032c32be5ba8c19eeb02c1e6d0dce3db307d511.tar.bz2 | |
Implements #3220, Feature request: Show mapsforge-map "bigger" on high-res-displays
Made the mapsforge textscale setting follow the device dpi, if so wanted, default true.
Diffstat (limited to 'main')
| -rw-r--r-- | main/res/values/preference_keys.xml | 1 | ||||
| -rw-r--r-- | main/res/values/strings.xml | 2 | ||||
| -rw-r--r-- | main/res/xml/preferences.xml | 6 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java | 5 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/settings/Settings.java | 4 |
5 files changed, 17 insertions, 1 deletions
diff --git a/main/res/values/preference_keys.xml b/main/res/values/preference_keys.xml index e82c9d6..140d3b3 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 554ab0e..311b95a 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 7ea3b59..0cbeb71 100644 --- a/main/res/xml/preferences.xml +++ b/main/res/xml/preferences.xml @@ -274,6 +274,12 @@ 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 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 71c6d4a..680e38f 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)); } |
