diff options
author | Jorge Ruesga <jorge@ruesga.com> | 2013-05-11 01:32:21 +0200 |
---|---|---|
committer | Jorge Ruesga <jorge@ruesga.com> | 2013-05-11 02:04:21 +0200 |
commit | 3c129af728081038e9f140123d9f6041e6a64e4b (patch) | |
tree | 8419b7bc6e2a32894ddc08108dbd04eafeae9dbc /src | |
parent | 4c465127aac9ea7d8576ed844facae991867cef8 (diff) | |
download | packages_apps_trebuchet-3c129af728081038e9f140123d9f6041e6a64e4b.zip packages_apps_trebuchet-3c129af728081038e9f140123d9f6041e6a64e4b.tar.gz packages_apps_trebuchet-3c129af728081038e9f140123d9f6041e6a64e4b.tar.bz2 |
Trebuchet: Properly remove grid preference on isLargeScreen devices
Actually, the preference is not been removed.
Change-Id: I0a37e953140b748ff03d6018166c004bcb4907fa
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/preference/Preferences.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/cyanogenmod/trebuchet/preference/Preferences.java b/src/com/cyanogenmod/trebuchet/preference/Preferences.java index 45174e1..6e4b29b 100644 --- a/src/com/cyanogenmod/trebuchet/preference/Preferences.java +++ b/src/com/cyanogenmod/trebuchet/preference/Preferences.java @@ -22,6 +22,7 @@ import android.content.res.Resources; import android.os.Bundle; import android.preference.Preference; import android.preference.PreferenceActivity; +import android.preference.PreferenceCategory; import android.preference.PreferenceFragment; import android.preference.PreferenceScreen; import android.text.TextUtils; @@ -127,9 +128,13 @@ public class Preferences extends PreferenceActivity addPreferencesFromResource(R.xml.preferences_homescreen); - PreferenceScreen preferenceScreen = getPreferenceScreen(); - if (LauncherApplication.isScreenLarge()) { - preferenceScreen.removePreference(findPreference("ui_homescreen_grid")); + PreferenceCategory general = (PreferenceCategory)findPreference("ui_homescreen_general"); + boolean workspaceTabletGrid = getResources().getBoolean(R.bool.config_workspaceTabletGrid); + if (general != null && (LauncherApplication.isScreenLarge() || workspaceTabletGrid == false)) { + Preference grid = findPreference("ui_homescreen_grid"); + if (grid != null) { + general.removePreference(grid); + } } } } |