Cherish:Add left and right virtual buttons while typing [2/2]

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
Roman Birg
2021-10-01 12:15:51 +07:00
committed by Hưng Phan
parent 06dad1e1f6
commit d429dca7c2
3 changed files with 12 additions and 0 deletions

View File

@@ -653,6 +653,8 @@
<string name="qs_footer_text_string_summary">Set to empty for default #KeepTheLove</string> <string name="qs_footer_text_string_summary">Set to empty for default #KeepTheLove</string>
<!-- Navbar options --> <!-- Navbar options -->
<string name="navigation_bar_arrow_keys_title">Arrow keys</string>
<string name="navigation_bar_arrow_keys_summary">Show left &amp; right arrows to control the cursor while typing</string>
<string name="navigation_bar_invert_layout_title">Invert layout</string> <string name="navigation_bar_invert_layout_title">Invert layout</string>
<string name="navigation_bar_invert_layout_summary">Inverts the layout of the navigation bar and other items, such as the IME switcher</string> <string name="navigation_bar_invert_layout_summary">Inverts the layout of the navigation bar and other items, such as the IME switcher</string>
<string name="unsupported_gestures">Enable two button or three button navigation to use this feature</string> <string name="unsupported_gestures">Enable two button or three button navigation to use this feature</string>

View File

@@ -30,6 +30,12 @@
android:fragment="com.android.settings.gestures.SystemNavigationGestureSettings" android:fragment="com.android.settings.gestures.SystemNavigationGestureSettings"
settings:controller="com.android.settings.gestures.SystemNavigationPreferenceController" /> settings:controller="com.android.settings.gestures.SystemNavigationPreferenceController" />
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="navigation_bar_menu_arrow_keys"
android:title="@string/navigation_bar_arrow_keys_title"
android:summary="@string/navigation_bar_arrow_keys_summary"
android:defaultValue="false" />
<com.cherish.settings.preferences.SecureSettingSwitchPreference <com.cherish.settings.preferences.SecureSettingSwitchPreference
android:key="sysui_nav_bar_inverse" android:key="sysui_nav_bar_inverse"
android:icon="@drawable/ic_arrow" android:icon="@drawable/ic_arrow"

View File

@@ -58,6 +58,8 @@ public class ButtonSettings extends ActionFragment implements OnPreferenceChange
private static final String KEY_BACKLIGHT_TIMEOUT = "backlight_timeout"; private static final String KEY_BACKLIGHT_TIMEOUT = "backlight_timeout";
private static final String HWKEY_DISABLE = "hardware_keys_disable"; private static final String HWKEY_DISABLE = "hardware_keys_disable";
private static final String PIXEL_ANIMATION_NAVIGATION = "pixel_nav_animation"; private static final String PIXEL_ANIMATION_NAVIGATION = "pixel_nav_animation";
private static final String KEY_NAVIGATION_BAR_ARROWS = "navigation_bar_menu_arrow_keys";
private static final String INVERT_NAVIGATION = "sysui_nav_bar_inverse"; private static final String INVERT_NAVIGATION = "sysui_nav_bar_inverse";
private static final String NAVBAR_VISIBILITY = "navigation_bar_show_new"; private static final String NAVBAR_VISIBILITY = "navigation_bar_show_new";
@@ -90,6 +92,7 @@ public class ButtonSettings extends ActionFragment implements OnPreferenceChange
private SwitchPreference mNavbarVisibility; private SwitchPreference mNavbarVisibility;
private boolean mIsNavSwitchingMode = false; private boolean mIsNavSwitchingMode = false;
private Handler mHandler; private Handler mHandler;
private SystemSettingSwitchPreference mNavigationArrowKeys;
@Override @Override
public void onCreate(Bundle icicle) { public void onCreate(Bundle icicle) {
@@ -101,6 +104,7 @@ public class ButtonSettings extends ActionFragment implements OnPreferenceChange
final PreferenceScreen prefScreen = getPreferenceScreen(); final PreferenceScreen prefScreen = getPreferenceScreen();
mNavbarVisibility = (SwitchPreference) findPreference(NAVBAR_VISIBILITY); mNavbarVisibility = (SwitchPreference) findPreference(NAVBAR_VISIBILITY);
mNavigationArrowKeys = (SystemSettingSwitchPreference) findPreference(KEY_NAVIGATION_BAR_ARROWS);
boolean showing = Settings.System.getInt(getContentResolver(), boolean showing = Settings.System.getInt(getContentResolver(),
Settings.System.FORCE_SHOW_NAVBAR, Settings.System.FORCE_SHOW_NAVBAR,