diff options
author | nebkat <nebkat@teamhacksung.org> | 2012-03-25 12:37:11 +0100 |
---|---|---|
committer | nebkat <nebkat@teamhacksung.org> | 2012-03-25 12:37:11 +0100 |
commit | 8b5c5e516cc8dae7bcf68d15dd4263f7e741b70b (patch) | |
tree | 895d72bd344a4ab044efc842473557d4a243ce02 | |
parent | d40cdc0757e25598ab1cecb2085fd80da05e3692 (diff) | |
download | android_packages_apps_Trebuchet-8b5c5e516cc8dae7bcf68d15dd4263f7e741b70b.tar.gz android_packages_apps_Trebuchet-8b5c5e516cc8dae7bcf68d15dd4263f7e741b70b.tar.bz2 android_packages_apps_Trebuchet-8b5c5e516cc8dae7bcf68d15dd4263f7e741b70b.zip |
Preferences: Hide phone preferences on tablet
Change-Id: Ifa766c1c535b8315eecb94c24b637f087771d75f
-rw-r--r-- | res/xml/preferences.xml | 6 | ||||
-rw-r--r-- | src/com/cyanogenmod/trebuchet/preference/Preferences.java | 16 |
2 files changed, 20 insertions, 2 deletions
diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index 9ce22c3af..6ab031719 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -85,7 +85,8 @@ android:summary="@string/preferences_interface_homescreen_scrolling_scroll_wallpaper_summary" android:defaultValue="true" /> </PreferenceCategory> - <PreferenceCategory android:title="@string/preferences_interface_homescreen_indicator_category"> + <PreferenceCategory android:key="ui_homescreen_indicator" + android:title="@string/preferences_interface_homescreen_indicator_category"> <CheckBoxPreference android:key="ui_homescreen_indicator_enable" android:title="@string/preferences_interface_homescreen_indicator_enable_title" android:summary="@string/preferences_interface_homescreen_indicator_enable_summary" @@ -122,7 +123,8 @@ android:title="@string/preferences_interface_drawer_scrolling_fade_adjacent_screens_title" android:summary="@string/preferences_interface_drawer_scrolling_fade_adjacent_screens_summary" /> </PreferenceCategory> - <PreferenceCategory android:title="@string/preferences_interface_drawer_indicator_category"> + <PreferenceCategory android:key="ui_drawer_indicator" + android:title="@string/preferences_interface_drawer_indicator_category"> <CheckBoxPreference android:key="ui_drawer_indicator_enable" android:title="@string/preferences_interface_drawer_indicator_enable_title" android:summary="@string/preferences_interface_drawer_indicator_enable_summary" diff --git a/src/com/cyanogenmod/trebuchet/preference/Preferences.java b/src/com/cyanogenmod/trebuchet/preference/Preferences.java index f50852472..9888e0bc9 100644 --- a/src/com/cyanogenmod/trebuchet/preference/Preferences.java +++ b/src/com/cyanogenmod/trebuchet/preference/Preferences.java @@ -21,6 +21,10 @@ import android.content.SharedPreferences; import android.os.Bundle; import android.preference.Preference; import android.preference.PreferenceActivity; +import android.preference.PreferenceGroup; + +import com.cyanogenmod.trebuchet.LauncherApplication; + import com.cyanogenmod.trebuchet.R; public class Preferences extends PreferenceActivity { @@ -38,6 +42,18 @@ public class Preferences extends PreferenceActivity { editor.putBoolean(PreferencesProvider.PREFERENCES_CHANGED, true); editor.commit(); + // Remove some preferences on large screens + if (LauncherApplication.isScreenLarge()) { + PreferenceGroup homescreen = (PreferenceGroup) findPreference("ui_homescreen"); + homescreen.removePreference(findPreference("ui_homescreen_grid")); + homescreen.removePreference(findPreference("ui_homescreen_screen_padding_vertical")); + homescreen.removePreference(findPreference("ui_homescreen_screen_padding_horizontal")); + homescreen.removePreference(findPreference("ui_homescreen_indicator")); + + PreferenceGroup drawer = (PreferenceGroup) findPreference("ui_drawer"); + drawer.removePreference(findPreference("ui_drawer_indicator")); + } + Preference version = findPreference("application_version"); version.setTitle(getString(R.string.application_name) + " " + getString(R.string.application_version)); } |