Loading res/values/strings.xml +2 −1 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2015 The CyanogenMod Project Copyright (C) 2017-2019 The LineageOS Project 2017-2020 The LineageOS Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. Loading Loading @@ -240,6 +240,7 @@ <string name="navigation_bar_home_long_press_title">Home long press action</string> <string name="navigation_bar_home_double_tap_title">Home double tap action</string> <string name="navigation_bar_app_switch_long_press_title">Recents long press action</string> <string name="navigation_bar_edge_long_swipe_title">Edge long swipe action</string> <!-- Power menu --> <string name="power_menu_title">Power menu</string> Loading res/xml/button_settings.xml +8 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,14 @@ android:entryValues="@array/hardware_keys_action_values" android:persistent="false" /> <ListPreference android:key="navigation_bar_edge_long_swipe" android:dialogTitle="@string/navigation_bar_edge_long_swipe_title" android:title="@string/navigation_bar_edge_long_swipe_title" android:entries="@array/hardware_keys_action_entries" android:entryValues="@array/hardware_keys_action_values" android:persistent="false" /> </PreferenceCategory> <PreferenceCategory Loading src/org/lineageos/lineageparts/input/ButtonSettings.java +18 −1 Original line number Diff line number Diff line /* * Copyright (C) 2016 The CyanogenMod project * Copyright (C) 2017-2018 The LineageOS project * 2017-2020 The LineageOS project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -78,6 +78,7 @@ public class ButtonSettings extends SettingsPreferenceFragment implements private static final String KEY_NAVIGATION_HOME_DOUBLE_TAP = "navigation_home_double_tap"; private static final String KEY_NAVIGATION_APP_SWITCH_LONG_PRESS = "navigation_app_switch_long_press"; private static final String KEY_EDGE_LONG_SWIPE = "navigation_bar_edge_long_swipe"; private static final String KEY_POWER_END_CALL = "power_end_call"; private static final String KEY_HOME_ANSWER_CALL = "home_answer_call"; private static final String KEY_VOLUME_MUSIC_CONTROLS = "volbtn_music_controls"; Loading Loading @@ -117,6 +118,7 @@ public class ButtonSettings extends SettingsPreferenceFragment implements private ListPreference mNavigationHomeLongPressAction; private ListPreference mNavigationHomeDoubleTapAction; private ListPreference mNavigationAppSwitchLongPressAction; private ListPreference mEdgeLongSwipeAction; private SwitchPreference mPowerEndCall; private SwitchPreference mHomeAnswerCall; private SwitchPreference mTorchLongPressPowerGesture; Loading Loading @@ -212,6 +214,9 @@ public class ButtonSettings extends SettingsPreferenceFragment implements Action appSwitchLongPressAction = Action.fromSettings(resolver, LineageSettings.System.KEY_APP_SWITCH_LONG_PRESS_ACTION, defaultAppSwitchLongPressAction); Action edgeLongSwipeAction = Action.fromSettings(resolver, LineageSettings.System.KEY_EDGE_LONG_SWIPE_ACTION, Action.NOTHING); // Navigation bar home long press mNavigationHomeLongPressAction = initList(KEY_NAVIGATION_HOME_LONG_PRESS, Loading @@ -225,6 +230,9 @@ public class ButtonSettings extends SettingsPreferenceFragment implements mNavigationAppSwitchLongPressAction = initList(KEY_NAVIGATION_APP_SWITCH_LONG_PRESS, appSwitchLongPressAction); // Edge long swipe gesture mEdgeLongSwipeAction = initList(KEY_EDGE_LONG_SWIPE, edgeLongSwipeAction); final LineageHardwareManager hardware = LineageHardwareManager.getInstance(getActivity()); // Only visible on devices that does not have a navigation bar already Loading Loading @@ -469,6 +477,9 @@ public class ButtonSettings extends SettingsPreferenceFragment implements mNavigationAppSwitchLongPressAction.setEntries(actionEntriesGo); mNavigationAppSwitchLongPressAction.setEntryValues(actionValuesGo); mEdgeLongSwipeAction.setEntries(actionEntriesGo); mEdgeLongSwipeAction.setEntryValues(actionValuesGo); } } Loading Loading @@ -569,6 +580,10 @@ public class ButtonSettings extends SettingsPreferenceFragment implements handleListChange(mTorchLongPressPowerTimeout, newValue, LineageSettings.System.TORCH_LONG_PRESS_POWER_TIMEOUT); return true; } else if (preference == mEdgeLongSwipeAction) { handleListChange(mEdgeLongSwipeAction, newValue, LineageSettings.System.KEY_EDGE_LONG_SWIPE_ACTION); return true; } return false; } Loading Loading @@ -615,10 +630,12 @@ public class ButtonSettings extends SettingsPreferenceFragment implements mNavigationPreferencesCat.addPreference(mNavigationHomeLongPressAction); mNavigationPreferencesCat.addPreference(mNavigationHomeDoubleTapAction); mNavigationPreferencesCat.addPreference(mNavigationAppSwitchLongPressAction); mNavigationPreferencesCat.addPreference(mEdgeLongSwipeAction); } else { mNavigationPreferencesCat.removePreference(mNavigationHomeLongPressAction); mNavigationPreferencesCat.removePreference(mNavigationHomeDoubleTapAction); mNavigationPreferencesCat.removePreference(mNavigationAppSwitchLongPressAction); mNavigationPreferencesCat.removePreference(mEdgeLongSwipeAction); } } if (homeCategory != null) { Loading Loading
res/values/strings.xml +2 −1 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2015 The CyanogenMod Project Copyright (C) 2017-2019 The LineageOS Project 2017-2020 The LineageOS Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. Loading Loading @@ -240,6 +240,7 @@ <string name="navigation_bar_home_long_press_title">Home long press action</string> <string name="navigation_bar_home_double_tap_title">Home double tap action</string> <string name="navigation_bar_app_switch_long_press_title">Recents long press action</string> <string name="navigation_bar_edge_long_swipe_title">Edge long swipe action</string> <!-- Power menu --> <string name="power_menu_title">Power menu</string> Loading
res/xml/button_settings.xml +8 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,14 @@ android:entryValues="@array/hardware_keys_action_values" android:persistent="false" /> <ListPreference android:key="navigation_bar_edge_long_swipe" android:dialogTitle="@string/navigation_bar_edge_long_swipe_title" android:title="@string/navigation_bar_edge_long_swipe_title" android:entries="@array/hardware_keys_action_entries" android:entryValues="@array/hardware_keys_action_values" android:persistent="false" /> </PreferenceCategory> <PreferenceCategory Loading
src/org/lineageos/lineageparts/input/ButtonSettings.java +18 −1 Original line number Diff line number Diff line /* * Copyright (C) 2016 The CyanogenMod project * Copyright (C) 2017-2018 The LineageOS project * 2017-2020 The LineageOS project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -78,6 +78,7 @@ public class ButtonSettings extends SettingsPreferenceFragment implements private static final String KEY_NAVIGATION_HOME_DOUBLE_TAP = "navigation_home_double_tap"; private static final String KEY_NAVIGATION_APP_SWITCH_LONG_PRESS = "navigation_app_switch_long_press"; private static final String KEY_EDGE_LONG_SWIPE = "navigation_bar_edge_long_swipe"; private static final String KEY_POWER_END_CALL = "power_end_call"; private static final String KEY_HOME_ANSWER_CALL = "home_answer_call"; private static final String KEY_VOLUME_MUSIC_CONTROLS = "volbtn_music_controls"; Loading Loading @@ -117,6 +118,7 @@ public class ButtonSettings extends SettingsPreferenceFragment implements private ListPreference mNavigationHomeLongPressAction; private ListPreference mNavigationHomeDoubleTapAction; private ListPreference mNavigationAppSwitchLongPressAction; private ListPreference mEdgeLongSwipeAction; private SwitchPreference mPowerEndCall; private SwitchPreference mHomeAnswerCall; private SwitchPreference mTorchLongPressPowerGesture; Loading Loading @@ -212,6 +214,9 @@ public class ButtonSettings extends SettingsPreferenceFragment implements Action appSwitchLongPressAction = Action.fromSettings(resolver, LineageSettings.System.KEY_APP_SWITCH_LONG_PRESS_ACTION, defaultAppSwitchLongPressAction); Action edgeLongSwipeAction = Action.fromSettings(resolver, LineageSettings.System.KEY_EDGE_LONG_SWIPE_ACTION, Action.NOTHING); // Navigation bar home long press mNavigationHomeLongPressAction = initList(KEY_NAVIGATION_HOME_LONG_PRESS, Loading @@ -225,6 +230,9 @@ public class ButtonSettings extends SettingsPreferenceFragment implements mNavigationAppSwitchLongPressAction = initList(KEY_NAVIGATION_APP_SWITCH_LONG_PRESS, appSwitchLongPressAction); // Edge long swipe gesture mEdgeLongSwipeAction = initList(KEY_EDGE_LONG_SWIPE, edgeLongSwipeAction); final LineageHardwareManager hardware = LineageHardwareManager.getInstance(getActivity()); // Only visible on devices that does not have a navigation bar already Loading Loading @@ -469,6 +477,9 @@ public class ButtonSettings extends SettingsPreferenceFragment implements mNavigationAppSwitchLongPressAction.setEntries(actionEntriesGo); mNavigationAppSwitchLongPressAction.setEntryValues(actionValuesGo); mEdgeLongSwipeAction.setEntries(actionEntriesGo); mEdgeLongSwipeAction.setEntryValues(actionValuesGo); } } Loading Loading @@ -569,6 +580,10 @@ public class ButtonSettings extends SettingsPreferenceFragment implements handleListChange(mTorchLongPressPowerTimeout, newValue, LineageSettings.System.TORCH_LONG_PRESS_POWER_TIMEOUT); return true; } else if (preference == mEdgeLongSwipeAction) { handleListChange(mEdgeLongSwipeAction, newValue, LineageSettings.System.KEY_EDGE_LONG_SWIPE_ACTION); return true; } return false; } Loading Loading @@ -615,10 +630,12 @@ public class ButtonSettings extends SettingsPreferenceFragment implements mNavigationPreferencesCat.addPreference(mNavigationHomeLongPressAction); mNavigationPreferencesCat.addPreference(mNavigationHomeDoubleTapAction); mNavigationPreferencesCat.addPreference(mNavigationAppSwitchLongPressAction); mNavigationPreferencesCat.addPreference(mEdgeLongSwipeAction); } else { mNavigationPreferencesCat.removePreference(mNavigationHomeLongPressAction); mNavigationPreferencesCat.removePreference(mNavigationHomeDoubleTapAction); mNavigationPreferencesCat.removePreference(mNavigationAppSwitchLongPressAction); mNavigationPreferencesCat.removePreference(mEdgeLongSwipeAction); } } if (homeCategory != null) { Loading