Skip to content

Commit af6d80d

Browse files
committed
option to enable/disable Launcher2 orientation
Change-Id: I86879d6abe640eca445325a42248f30911da8c29
1 parent 029bda7 commit af6d80d

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

apps/SpareParts/res/values/strings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
<string name="title_menu_unlock_screen">Menu button unlock</string>
3939
<string name="summary_on_menu_unlock_screen">Disable Menu button unlock</string>
4040
<string name="summary_off_menu_unlock_screen">Enable Menu button unlock</string>
41+
42+
<string name="title_launcher_orientation">Launcher Orientation</string>
43+
<string name="summary_on_launcher_orientation">Disable Launcher rotation"</string>
44+
<string name="summary_off_launcher_orientation">Enable Launcher rotation"</string>
4145
<!-- end extra -->
4246

4347
<string name="title_window_animations">Window animations</string>

apps/SpareParts/res/xml/spare_parts.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@
5757
android:title="@string/title_menu_unlock_screen"
5858
android:summaryOn="@string/summary_on_menu_unlock_screen"
5959
android:summaryOff="@string/summary_off_menu_unlock_screen" />
60+
61+
<CheckBoxPreference
62+
android:key="launcher_orientation"
63+
android:title="@string/title_launcher_orientation"
64+
android:summaryOn="@string/summary_on_launcher_orientation"
65+
android:summaryOff="@string/summary_off_launcher_orientation" />
66+
6067
</PreferenceCategory>
6168
<!-- end -->
6269

apps/SpareParts/src/com/android/spare_parts/SpareParts.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public class SpareParts extends PreferenceActivity
5353

5454
//extra
5555
private static final String MENU_UNLOCK_SCREEN_PREF = "menu_unlock_screen";
56+
private static final String LAUNCHER_ORIENTATION_PREF = "launcher_orientation";
5657
//end extra
5758

5859
private static final String WINDOW_ANIMATIONS_PREF = "window_animations";
@@ -67,6 +68,7 @@ public class SpareParts extends PreferenceActivity
6768

6869
//extra
6970
private CheckBoxPreference mMenuUnlockScreenPref;
71+
private CheckBoxPreference mLauncherOrientationPref;
7072
//end extra
7173

7274
private ListPreference mWindowAnimationsPref;
@@ -123,6 +125,7 @@ public void onCreate(Bundle icicle) {
123125

124126
//extra
125127
mMenuUnlockScreenPref = (CheckBoxPreference) prefSet.findPreference(MENU_UNLOCK_SCREEN_PREF);
128+
mLauncherOrientationPref = (CheckBoxPreference) prefSet.findPreference(LAUNCHER_ORIENTATION_PREF);
126129
//end extra
127130

128131
mWindowAnimationsPref = (ListPreference) prefSet.findPreference(WINDOW_ANIMATIONS_PREF);
@@ -158,6 +161,9 @@ private void updateToggles() {
158161
mMenuUnlockScreenPref.setChecked(Settings.System.getInt(
159162
getContentResolver(),
160163
Settings.System.MENU_UNLOCK_SCREEN, 0) != 0);
164+
mLauncherOrientationPref.setChecked(Settings.System.getInt(
165+
getContentResolver(),
166+
Settings.System.LAUNCHER_ORIENTATION, 0) != 0);
161167
//end extra
162168
mFancyImeAnimationsPref.setChecked(Settings.System.getInt(
163169
getContentResolver(),
@@ -264,6 +270,10 @@ public void onSharedPreferenceChanged(SharedPreferences preferences, String key)
264270
Settings.System.putInt(getContentResolver(),
265271
Settings.System.MENU_UNLOCK_SCREEN,
266272
mMenuUnlockScreenPref.isChecked() ? 1 : 0);
273+
} else if (LAUNCHER_ORIENTATION_PREF.equals(key)) {
274+
Settings.System.putInt(getContentResolver(),
275+
Settings.System.LAUNCHER_ORIENTATION,
276+
mLauncherOrientationPref.isChecked() ? 1 : 0);
267277
//end extra
268278
} else if (FANCY_IME_ANIMATIONS_PREF.equals(key)) {
269279
Settings.System.putInt(getContentResolver(),

0 commit comments

Comments
 (0)