Loading res/values/cm_strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,8 @@ <string name="volbtn_cursor_control_off">Disabled</string> <string name="volbtn_cursor_control_on">Volume up/down moves cursor left/right</string> <string name="volbtn_cursor_control_on_reverse">Volume up/down moves cursor right/left</string> <string name="swap_volume_buttons_title">Reorient</string> <string name="swap_volume_buttons_summary">Swap volume buttons when the screen is rotated</string> <string name="power_end_call_title">End call</string> <string name="power_end_call_summary">Pressing the power button will end the current call</string> <string name="button_wake_title">Wake up device</string> Loading res/xml/button_settings.xml +4 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,10 @@ android:entryValues="@array/volbtn_cursor_control_values" android:persistent="false" /> <SwitchPreference android:key="swap_volume_buttons" android:title="@string/swap_volume_buttons_title" android:summary="@string/swap_volume_buttons_summary" /> </PreferenceCategory> </PreferenceScreen> src/com/android/settings/ButtonSettings.java +14 −1 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ public class ButtonSettings extends SettingsPreferenceFragment implements private static final String KEY_APP_SWITCH_PRESS = "hardware_keys_app_switch_press"; private static final String KEY_APP_SWITCH_LONG_PRESS = "hardware_keys_app_switch_long_press"; private static final String KEY_VOLUME_KEY_CURSOR_CONTROL = "volume_key_cursor_control"; private static final String KEY_SWAP_VOLUME_BUTTONS = "swap_volume_buttons"; private static final String DISABLE_NAV_KEYS = "disable_nav_keys"; private static final String KEY_NAVIGATION_BAR_LEFT = "navigation_bar_left"; private static final String KEY_POWER_END_CALL = "power_end_call"; Loading Loading @@ -103,6 +104,7 @@ public class ButtonSettings extends SettingsPreferenceFragment implements private ListPreference mAppSwitchPressAction; private ListPreference mAppSwitchLongPressAction; private ListPreference mVolumeKeyCursorControl; private SwitchPreference mSwapVolumeButtons; private SwitchPreference mDisableNavigationKeys; private SwitchPreference mNavigationBarLeftPref; private SwitchPreference mPowerEndCall; Loading Loading @@ -289,6 +291,12 @@ public class ButtonSettings extends SettingsPreferenceFragment implements Settings.System.VOLUME_KEY_CURSOR_CONTROL, 0); mVolumeKeyCursorControl = initActionList(KEY_VOLUME_KEY_CURSOR_CONTROL, cursorControlAction); int swapVolumeKeys = Settings.System.getInt(getContentResolver(), Settings.System.SWAP_VOLUME_KEYS_ON_ROTATION, 0); mSwapVolumeButtons = (SwitchPreference) prefScreen.findPreference(KEY_SWAP_VOLUME_BUTTONS); mSwapVolumeButtons.setChecked(swapVolumeKeys > 0); } else { prefScreen.removePreference(volumeCategory); } Loading Loading @@ -483,7 +491,12 @@ public class ButtonSettings extends SettingsPreferenceFragment implements @Override public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { if (preference == mDisableNavigationKeys) { if (preference == mSwapVolumeButtons) { int value = mSwapVolumeButtons.isChecked() ? (Utils.isTablet(getActivity()) ? 2 : 1) : 0; Settings.System.putInt(getActivity().getContentResolver(), Settings.System.SWAP_VOLUME_KEYS_ON_ROTATION, value); } else if (preference == mDisableNavigationKeys) { mDisableNavigationKeys.setEnabled(false); writeDisableNavkeysOption(getActivity(), mDisableNavigationKeys.isChecked()); updateDisableNavkeysOption(); Loading Loading
res/values/cm_strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,8 @@ <string name="volbtn_cursor_control_off">Disabled</string> <string name="volbtn_cursor_control_on">Volume up/down moves cursor left/right</string> <string name="volbtn_cursor_control_on_reverse">Volume up/down moves cursor right/left</string> <string name="swap_volume_buttons_title">Reorient</string> <string name="swap_volume_buttons_summary">Swap volume buttons when the screen is rotated</string> <string name="power_end_call_title">End call</string> <string name="power_end_call_summary">Pressing the power button will end the current call</string> <string name="button_wake_title">Wake up device</string> Loading
res/xml/button_settings.xml +4 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,10 @@ android:entryValues="@array/volbtn_cursor_control_values" android:persistent="false" /> <SwitchPreference android:key="swap_volume_buttons" android:title="@string/swap_volume_buttons_title" android:summary="@string/swap_volume_buttons_summary" /> </PreferenceCategory> </PreferenceScreen>
src/com/android/settings/ButtonSettings.java +14 −1 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ public class ButtonSettings extends SettingsPreferenceFragment implements private static final String KEY_APP_SWITCH_PRESS = "hardware_keys_app_switch_press"; private static final String KEY_APP_SWITCH_LONG_PRESS = "hardware_keys_app_switch_long_press"; private static final String KEY_VOLUME_KEY_CURSOR_CONTROL = "volume_key_cursor_control"; private static final String KEY_SWAP_VOLUME_BUTTONS = "swap_volume_buttons"; private static final String DISABLE_NAV_KEYS = "disable_nav_keys"; private static final String KEY_NAVIGATION_BAR_LEFT = "navigation_bar_left"; private static final String KEY_POWER_END_CALL = "power_end_call"; Loading Loading @@ -103,6 +104,7 @@ public class ButtonSettings extends SettingsPreferenceFragment implements private ListPreference mAppSwitchPressAction; private ListPreference mAppSwitchLongPressAction; private ListPreference mVolumeKeyCursorControl; private SwitchPreference mSwapVolumeButtons; private SwitchPreference mDisableNavigationKeys; private SwitchPreference mNavigationBarLeftPref; private SwitchPreference mPowerEndCall; Loading Loading @@ -289,6 +291,12 @@ public class ButtonSettings extends SettingsPreferenceFragment implements Settings.System.VOLUME_KEY_CURSOR_CONTROL, 0); mVolumeKeyCursorControl = initActionList(KEY_VOLUME_KEY_CURSOR_CONTROL, cursorControlAction); int swapVolumeKeys = Settings.System.getInt(getContentResolver(), Settings.System.SWAP_VOLUME_KEYS_ON_ROTATION, 0); mSwapVolumeButtons = (SwitchPreference) prefScreen.findPreference(KEY_SWAP_VOLUME_BUTTONS); mSwapVolumeButtons.setChecked(swapVolumeKeys > 0); } else { prefScreen.removePreference(volumeCategory); } Loading Loading @@ -483,7 +491,12 @@ public class ButtonSettings extends SettingsPreferenceFragment implements @Override public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { if (preference == mDisableNavigationKeys) { if (preference == mSwapVolumeButtons) { int value = mSwapVolumeButtons.isChecked() ? (Utils.isTablet(getActivity()) ? 2 : 1) : 0; Settings.System.putInt(getActivity().getContentResolver(), Settings.System.SWAP_VOLUME_KEYS_ON_ROTATION, value); } else if (preference == mDisableNavigationKeys) { mDisableNavigationKeys.setEnabled(false); writeDisableNavkeysOption(getActivity(), mDisableNavigationKeys.isChecked()); updateDisableNavkeysOption(); Loading