aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/settings
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2014-04-26 21:51:41 +0200
committerArne Schwabe <arne@rfc2549.org>2014-05-17 13:08:16 +0200
commit786eccacbb285696d504d08ba02c61400ce063a2 (patch)
tree1f573c98796326d9732cd56f0b3e8fa1bdfb44b9 /main/src/cgeo/geocaching/settings
parent7ed9d23ec6a4ca513ef6b8b2fced47aac26d7c49 (diff)
downloadcgeo-786eccacbb285696d504d08ba02c61400ce063a2.zip
cgeo-786eccacbb285696d504d08ba02c61400ce063a2.tar.gz
cgeo-786eccacbb285696d504d08ba02c61400ce063a2.tar.bz2
Allow the user to choose always displaying the overflow button
Manually Cherry pick from rsudev/actionbar_schwabe: Always display the overflow menu button. Allow user to decide if the overflow should be shown or not. Since this only works on 3.0-4.3 hide the option on other platforms.
Diffstat (limited to 'main/src/cgeo/geocaching/settings')
-rw-r--r--main/src/cgeo/geocaching/settings/Settings.java4
-rw-r--r--main/src/cgeo/geocaching/settings/SettingsActivity.java11
2 files changed, 15 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/settings/Settings.java b/main/src/cgeo/geocaching/settings/Settings.java
index 7a4dfdd..a527fc5 100644
--- a/main/src/cgeo/geocaching/settings/Settings.java
+++ b/main/src/cgeo/geocaching/settings/Settings.java
@@ -557,6 +557,10 @@ public class Settings {
return getBoolean(R.string.pref_units, getImperialUnitsDefault());
}
+ public static boolean isAlwaysShowOverlfowMenu() {
+ return getBoolean(R.string.pref_alwaysshowoverflowmenu, false);
+ }
+
static boolean getImperialUnitsDefault() {
final String countryCode = Locale.getDefault().getCountry();
return "US".equals(countryCode) // USA
diff --git a/main/src/cgeo/geocaching/settings/SettingsActivity.java b/main/src/cgeo/geocaching/settings/SettingsActivity.java
index 74a9b32..c7933bd 100644
--- a/main/src/cgeo/geocaching/settings/SettingsActivity.java
+++ b/main/src/cgeo/geocaching/settings/SettingsActivity.java
@@ -90,8 +90,19 @@ public class SettingsActivity extends PreferenceActivity {
SettingsActivity.addPreferencesFromResource(this, R.xml.preferences);
initPreferences();
+ /* Remove the show overflow preference on Android version where the platform always or never
+ * shows the overflow menu and the app cannot influence the behaviour
+ */
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB || Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN_MR2) {
+ Preference pref = findPreference(this, getString(R.string.pref_alwaysshowoverflowmenu));
+ PreferenceScreen appearence = (PreferenceScreen) findPreference(this, getString(R.string.pref_appearance));
+ appearence.removePreference(pref);
+
+ }
Intent intent = getIntent();
openInitialScreen(intent.getIntExtra(INTENT_OPEN_SCREEN, 0));
+
+
}
private void openInitialScreen(int initialScreen) {