mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-17 07:22:45 +00:00
Improve behavior for language swipe cycling
Implement logic to stop cycling through Switch languages swipe when all subtypes are cycled.
This commit is contained in:
parent
453683a925
commit
63651969a5
10 changed files with 72 additions and 2 deletions
|
@ -151,6 +151,7 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
|
|||
public static final String PREF_MORE_POPUP_KEYS = "more_popup_keys";
|
||||
|
||||
public static final String PREF_SPACE_TO_CHANGE_LANG = "prefs_long_press_keyboard_to_change_lang";
|
||||
public static final String PREF_LANGUAGE_SWIPE_DISTANCE = "language_swipe_distance";
|
||||
|
||||
public static final String PREF_ENABLE_CLIPBOARD_HISTORY = "enable_clipboard_history";
|
||||
public static final String PREF_CLIPBOARD_HISTORY_RETENTION_TIME = "clipboard_history_retention_time";
|
||||
|
@ -447,6 +448,18 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
|
|||
};
|
||||
}
|
||||
|
||||
public static int readLanguageSwipeDistance(final SharedPreferences prefs,
|
||||
final Resources res) {
|
||||
final int sensitivity = prefs.getInt(
|
||||
PREF_LANGUAGE_SWIPE_DISTANCE, UNDEFINED_PREFERENCE_VALUE_INT);
|
||||
return (sensitivity != UNDEFINED_PREFERENCE_VALUE_INT) ? sensitivity
|
||||
: readDefaultLanguageSwipeDistance(res);
|
||||
}
|
||||
|
||||
public static int readDefaultLanguageSwipeDistance(final Resources res) {
|
||||
return res.getInteger(R.integer.config_default_language_swipe_distance);
|
||||
}
|
||||
|
||||
public static boolean readDeleteSwipeEnabled(final SharedPreferences prefs) {
|
||||
return prefs.getBoolean(PREF_DELETE_SWIPE, true);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue