From 8d9881707c31de1da357081701a40fe013b0f2fa Mon Sep 17 00:00:00 2001 From: Bananeweizen Date: Sun, 1 Jun 2014 17:20:20 +0200 Subject: convert map settings to checkbox based menus This avoids the confusion that is always connected with label changing menu items (Is the label showing the current state or the state that I get when clicking?) --- main/src/cgeo/geocaching/maps/CGeoMap.java | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'main/src') diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java index 87d5366..15b2667 100644 --- a/main/src/cgeo/geocaching/maps/CGeoMap.java +++ b/main/src/cgeo/geocaching/maps/CGeoMap.java @@ -645,11 +645,7 @@ public class CGeoMap extends AbstractMap implements ViewFactory { try { MenuItem item = menu.findItem(R.id.menu_trail_mode); - if (Settings.isMapTrail()) { - item.setTitle(res.getString(R.string.map_trail_hide)); - } else { - item.setTitle(res.getString(R.string.map_trail_show)); - } + item.setChecked(Settings.isMapTrail()); item = menu.findItem(R.id.menu_map_live); // live map if (isLiveEnabled) { @@ -659,21 +655,13 @@ public class CGeoMap extends AbstractMap implements ViewFactory { } item = menu.findItem(R.id.menu_mycaches_mode); // own & found caches - if (Settings.isExcludeMyCaches()) { - item.setTitle(res.getString(R.string.map_mycaches_show)); - } else { - item.setTitle(res.getString(R.string.map_mycaches_hide)); - } + item.setChecked(Settings.isExcludeMyCaches()); final Set geocodesInViewport = getGeocodesForCachesInViewport(); menu.findItem(R.id.menu_store_caches).setVisible(!isLoading() && CollectionUtils.isNotEmpty(geocodesInViewport) && new SearchResult(geocodesInViewport).hasUnsavedCaches()); item = menu.findItem(R.id.menu_circle_mode); // show circles - if (overlayCaches != null && overlayCaches.getCircles()) { - item.setTitle(res.getString(R.string.map_circles_hide)); - } else { - item.setTitle(res.getString(R.string.map_circles_show)); - } + item.setChecked(overlayCaches != null && overlayCaches.getCircles()); item = menu.findItem(R.id.menu_theme_mode); // show theme selection item.setVisible(mapView.hasMapThemes()); -- cgit v1.1