Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7252930 authored by Sam Mortimer's avatar Sam Mortimer Committed by Daniel Hillenbrand
Browse files

LineageParts: Add volume panel left/right setting

Change-Id: I306ce115cc00e5cab2bc46e209f1b5b20a0117b3
parent 19c9d338
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -219,6 +219,8 @@
    <string name="power_end_call_summary">End the current call by pressing the power button</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="volume_panel_on_left_title">Show panel on left</string>
    <string name="volume_panel_on_left_summary">Display volume panel on the left side of the screen</string>
    <string name="button_wake_title">Wake device</string>
    <string name="volume_answer_call_title">Answer call</string>
    <string name="volume_answer_call_summary">Answer incoming calls by pressing the volume buttons</string>
+5 −0
Original line number Diff line number Diff line
@@ -287,6 +287,11 @@
            android:key="swap_volume_buttons"
            android:title="@string/swap_volume_buttons_title"
            android:summary="@string/swap_volume_buttons_summary" />

        <SwitchPreference
            android:key="volume_panel_on_left"
            android:title="@string/volume_panel_on_left_title"
            android:summary="@string/volume_panel_on_left_summary" />
    </PreferenceCategory>

    <PreferenceCategory
+16 −0
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ public class ButtonSettings extends SettingsPreferenceFragment implements
    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 KEY_VOLUME_PANEL_ON_LEFT = "volume_panel_on_left";
    private static final String DISABLE_NAV_KEYS = "disable_nav_keys";
    private static final String KEY_NAVIGATION_HOME_LONG_PRESS = "navigation_home_long_press";
    private static final String KEY_NAVIGATION_HOME_DOUBLE_TAP = "navigation_home_double_tap";
@@ -110,6 +111,7 @@ public class ButtonSettings extends SettingsPreferenceFragment implements
    private SwitchPreference mVolumeWakeScreen;
    private SwitchPreference mVolumeMusicControls;
    private SwitchPreference mSwapVolumeButtons;
    private SwitchPreference mVolumePanelOnLeft;
    private SwitchPreference mDisableNavigationKeys;
    private ListPreference mNavigationHomeLongPressAction;
    private ListPreference mNavigationHomeDoubleTapAction;
@@ -379,6 +381,15 @@ public class ButtonSettings extends SettingsPreferenceFragment implements
            if (mSwapVolumeButtons != null) {
                mSwapVolumeButtons.setChecked(swapVolumeKeys > 0);
            }

            final boolean volumePanelOnLeft = LineageSettings.Secure.getIntForUser(
                    getContentResolver(), LineageSettings.Secure.VOLUME_PANEL_ON_LEFT, 0,
                    UserHandle.USER_CURRENT) != 0;
            mVolumePanelOnLeft = (SwitchPreference)
                    prefScreen.findPreference(KEY_VOLUME_PANEL_ON_LEFT);
            if (mVolumePanelOnLeft != null) {
                mVolumePanelOnLeft.setChecked(volumePanelOnLeft);
            }
        } else {
            prefScreen.removePreference(volumeCategory);
        }
@@ -671,6 +682,11 @@ public class ButtonSettings extends SettingsPreferenceFragment implements
            }
            LineageSettings.System.putInt(getActivity().getContentResolver(),
                    LineageSettings.System.SWAP_VOLUME_KEYS_ON_ROTATION, value);
        } else if (preference == mVolumePanelOnLeft) {
            LineageSettings.Secure.putIntForUser(getActivity().getContentResolver(),
                    LineageSettings.Secure.VOLUME_PANEL_ON_LEFT,
                    mVolumePanelOnLeft.isChecked() ? 1 : 0, UserHandle.USER_CURRENT);
            return true;
        } else if (preference == mDisableNavigationKeys) {
            mDisableNavigationKeys.setEnabled(false);
            mNavigationPreferencesCat.setEnabled(false);