aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2014-05-22 19:29:23 +0200
committerBananeweizen <bananeweizen@gmx.de>2014-05-22 19:29:23 +0200
commitaa06ae7fae28e68a2a0775d4f3c25c5d7fced949 (patch)
tree8badfc1c64ec4d5e5467b3f4bba8b570582836bd
parent775a273b4b055cf2d1ebe76f67a87f02a32f422d (diff)
downloadcgeo-aa06ae7fae28e68a2a0775d4f3c25c5d7fced949.zip
cgeo-aa06ae7fae28e68a2a0775d4f3c25c5d7fced949.tar.gz
cgeo-aa06ae7fae28e68a2a0775d4f3c25c5d7fced949.tar.bz2
fix #3877: hide menu items instead of disabling them
We probably need to do further rework on the menus, but this fixes at least the style guideline issue.
-rw-r--r--main/res/menu/map_activity.xml1
-rw-r--r--main/src/cgeo/geocaching/NavigateAnyPointActivity.java2
-rw-r--r--main/src/cgeo/geocaching/TrackableActivity.java5
-rw-r--r--main/src/cgeo/geocaching/maps/CGeoMap.java8
4 files changed, 8 insertions, 8 deletions
diff --git a/main/res/menu/map_activity.xml b/main/res/menu/map_activity.xml
index 3dfc5ae..8a41715 100644
--- a/main/res/menu/map_activity.xml
+++ b/main/res/menu/map_activity.xml
@@ -30,7 +30,6 @@
</item>
<item
android:id="@+id/menu_store_caches"
- android:enabled="false"
android:icon="@drawable/ic_menu_set_as"
cgeo:showAsAction="ifRoom|withText"
android:title="@string/caches_store_offline">
diff --git a/main/src/cgeo/geocaching/NavigateAnyPointActivity.java b/main/src/cgeo/geocaching/NavigateAnyPointActivity.java
index 80812d1..c9b1b3f 100644
--- a/main/src/cgeo/geocaching/NavigateAnyPointActivity.java
+++ b/main/src/cgeo/geocaching/NavigateAnyPointActivity.java
@@ -327,7 +327,7 @@ public class NavigateAnyPointActivity extends AbstractActionBarActivity implemen
menu.findItem(R.id.menu_default_navigation).setVisible(visible);
menu.findItem(R.id.menu_caches_around).setVisible(visible);
- menu.findItem(R.id.menu_clear_history).setEnabled(!getHistoryOfSearchedLocations().isEmpty());
+ menu.findItem(R.id.menu_clear_history).setVisible(!getHistoryOfSearchedLocations().isEmpty());
} catch (RuntimeException e) {
// nothing
}
diff --git a/main/src/cgeo/geocaching/TrackableActivity.java b/main/src/cgeo/geocaching/TrackableActivity.java
index a0adb3b..ee45ba7 100644
--- a/main/src/cgeo/geocaching/TrackableActivity.java
+++ b/main/src/cgeo/geocaching/TrackableActivity.java
@@ -25,6 +25,7 @@ import cgeo.geocaching.utils.UnknownTagsHandler;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
+
import rx.android.observables.AndroidObservable;
import rx.android.observables.ViewObservable;
import rx.functions.Action1;
@@ -261,8 +262,8 @@ public class TrackableActivity extends AbstractViewPagerActivity<TrackableActivi
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
if (trackable != null) {
- menu.findItem(R.id.menu_log_touch).setEnabled(StringUtils.isNotBlank(geocode) && trackable.isLoggable());
- menu.findItem(R.id.menu_browser_trackable).setEnabled(StringUtils.isNotBlank(trackable.getBrowserUrl()));
+ menu.findItem(R.id.menu_log_touch).setVisible(StringUtils.isNotBlank(geocode) && trackable.isLoggable());
+ menu.findItem(R.id.menu_browser_trackable).setVisible(StringUtils.isNotBlank(trackable.getBrowserUrl()));
}
return super.onPrepareOptionsMenu(menu);
}
diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java
index b4cb4b8..6e57c02 100644
--- a/main/src/cgeo/geocaching/maps/CGeoMap.java
+++ b/main/src/cgeo/geocaching/maps/CGeoMap.java
@@ -617,7 +617,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
for (MapSource mapSource : MapProviderFactory.getMapSources()) {
final MenuItem menuItem = menu.findItem(mapSource.getNumericalId());
if (menuItem != null) {
- menuItem.setEnabled(mapSource.isAvailable());
+ menuItem.setVisible(mapSource.isAvailable());
}
}
@@ -644,7 +644,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
}
final Set<String> geocodesInViewport = getGeocodesForCachesInViewport();
- menu.findItem(R.id.menu_store_caches).setEnabled(!isLoading() && CollectionUtils.isNotEmpty(geocodesInViewport) && new SearchResult(geocodesInViewport).hasUnsavedCaches());
+ 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()) {
@@ -656,9 +656,9 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
item = menu.findItem(R.id.menu_theme_mode); // show theme selection
item.setVisible(mapView.hasMapThemes());
- menu.findItem(R.id.menu_as_list).setEnabled(!isLoading());
+ menu.findItem(R.id.menu_as_list).setVisible(!isLoading());
- menu.findItem(R.id.submenu_strategy).setEnabled(isLiveEnabled);
+ menu.findItem(R.id.submenu_strategy).setVisible(isLiveEnabled);
switch (Settings.getLiveMapStrategy()) {
case FASTEST: