mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-15 06:22:45 +00:00
parent
a3bc3b56ff
commit
bee51de8a5
8 changed files with 57 additions and 7 deletions
|
@ -268,6 +268,8 @@ class ClipboardHistoryView @JvmOverloads constructor(
|
|||
val clipContent = clipboardHistoryManager?.getHistoryEntryContent(clipId)
|
||||
keyboardActionListener?.onTextInput(clipContent?.content.toString())
|
||||
keyboardActionListener?.onReleaseKey(KeyCode.NOT_SPECIFIED, false)
|
||||
if (Settings.getInstance().current.mAlphaAfterClipHistoryEntry)
|
||||
keyboardActionListener?.onCodeInput(KeyCode.ALPHA, Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE, false)
|
||||
}
|
||||
|
||||
override fun onClipboardHistoryEntryAdded(at: Int) {
|
||||
|
|
|
@ -340,6 +340,8 @@ public final class EmojiPalettesView extends LinearLayout
|
|||
mKeyboardActionListener.onCodeInput(code, NOT_A_COORDINATE, NOT_A_COORDINATE, false);
|
||||
}
|
||||
mKeyboardActionListener.onReleaseKey(code, false);
|
||||
if (Settings.getInstance().getCurrent().mAlphaAfterEmojiInEmojiView)
|
||||
mKeyboardActionListener.onCodeInput(KeyCode.ALPHA, NOT_A_COORDINATE, NOT_A_COORDINATE, false);
|
||||
}
|
||||
|
||||
public void setHardwareAcceleratedDrawingEnabled(final boolean enabled) {
|
||||
|
|
|
@ -782,17 +782,11 @@ public final class KeyboardState {
|
|||
|| code == KeyCode.MULTIPLE_CODE_POINTS)) {
|
||||
mSwitchState = SWITCH_STATE_SYMBOL;
|
||||
}
|
||||
// Switch back to alpha keyboard mode if user types one or more non-space/enter
|
||||
// characters followed by a space/enter.
|
||||
if (isSpaceOrEnter(code)) {
|
||||
toggleAlphabetAndSymbols(autoCapsFlags, recapitalizeMode);
|
||||
mPrevSymbolsKeyboardWasShifted = false;
|
||||
}
|
||||
break;
|
||||
case SWITCH_STATE_SYMBOL:
|
||||
// Switch back to alpha keyboard mode if user types one or more non-space/enter
|
||||
// characters followed by a space/enter.
|
||||
if (isSpaceOrEnter(code)) {
|
||||
if (isSpaceOrEnter(code) && Settings.getInstance().getCurrent().mAlphaAfterSymbolAndSpace) {
|
||||
toggleAlphabetAndSymbols(autoCapsFlags, recapitalizeMode);
|
||||
mPrevSymbolsKeyboardWasShifted = false;
|
||||
}
|
||||
|
|
|
@ -149,6 +149,11 @@ class AdvancedSettingsFragment : SubScreenFragment() {
|
|||
customCurrencyDialog()
|
||||
true
|
||||
}
|
||||
|
||||
findPreference<Preference>("switch_after")?.setOnPreferenceClickListener {
|
||||
switchToMainDialog()
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
|
@ -485,6 +490,31 @@ class AdvancedSettingsFragment : SubScreenFragment() {
|
|||
d.show()
|
||||
}
|
||||
|
||||
private fun switchToMainDialog() {
|
||||
val checked = booleanArrayOf(
|
||||
sharedPreferences.getBoolean(Settings.PREF_ABC_AFTER_SYMBOL_SPACE, true),
|
||||
sharedPreferences.getBoolean(Settings.PREF_ABC_AFTER_EMOJI, false),
|
||||
sharedPreferences.getBoolean(Settings.PREF_ABC_AFTER_CLIP, false),
|
||||
)
|
||||
val titles = arrayOf(
|
||||
requireContext().getString(R.string.after_symbol_and_space),
|
||||
requireContext().getString(R.string.after_emoji),
|
||||
requireContext().getString(R.string.after_clip),
|
||||
)
|
||||
AlertDialog.Builder(requireContext())
|
||||
.setTitle(R.string.switch_keyboard_after)
|
||||
.setMultiChoiceItems(titles, checked) { _, i, b -> checked[i] = b }
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.setPositiveButton(android.R.string.ok) { _, _ ->
|
||||
sharedPreferences.edit {
|
||||
putBoolean(Settings.PREF_ABC_AFTER_SYMBOL_SPACE, checked[0])
|
||||
putBoolean(Settings.PREF_ABC_AFTER_EMOJI, checked[1])
|
||||
putBoolean(Settings.PREF_ABC_AFTER_CLIP, checked[2])
|
||||
}
|
||||
}
|
||||
.show()
|
||||
}
|
||||
|
||||
private fun setupKeyLongpressTimeoutSettings() {
|
||||
val prefs = sharedPreferences
|
||||
findPreference<SeekBarDialogPreference>(Settings.PREF_KEY_LONGPRESS_TIMEOUT)?.setInterface(object : ValueProxy {
|
||||
|
|
|
@ -156,6 +156,9 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
|
|||
public static final String PREF_AUTO_SHOW_TOOLBAR = "auto_show_toolbar";
|
||||
public static final String PREF_AUTO_HIDE_TOOLBAR = "auto_hide_toolbar";
|
||||
public static final String PREF_CLIPBOARD_TOOLBAR_KEYS = "clipboard_toolbar_keys";
|
||||
public static final String PREF_ABC_AFTER_EMOJI = "abc_after_emoji";
|
||||
public static final String PREF_ABC_AFTER_CLIP = "abc_after_clip";
|
||||
public static final String PREF_ABC_AFTER_SYMBOL_SPACE = "abc_after_symbol_space";
|
||||
|
||||
// Emoji
|
||||
public static final String PREF_EMOJI_RECENT_KEYS = "emoji_recent_keys";
|
||||
|
|
|
@ -111,6 +111,9 @@ public class SettingsValues {
|
|||
public final float mBottomPaddingScale;
|
||||
public final boolean mAutoShowToolbar;
|
||||
public final boolean mAutoHideToolbar;
|
||||
public final boolean mAlphaAfterEmojiInEmojiView;
|
||||
public final boolean mAlphaAfterClipHistoryEntry;
|
||||
public final boolean mAlphaAfterSymbolAndSpace;
|
||||
|
||||
// From the input box
|
||||
@NonNull
|
||||
|
@ -252,6 +255,9 @@ public class SettingsValues {
|
|||
mAutoShowToolbar = prefs.getBoolean(Settings.PREF_AUTO_SHOW_TOOLBAR, false);
|
||||
mAutoHideToolbar = readSuggestionsEnabled(prefs) && prefs.getBoolean(Settings.PREF_AUTO_HIDE_TOOLBAR, false);
|
||||
mHasCustomFunctionalLayout = CustomLayoutUtilsKt.hasCustomFunctionalLayout(selectedSubtype, context);
|
||||
mAlphaAfterEmojiInEmojiView = prefs.getBoolean(Settings.PREF_ABC_AFTER_EMOJI, false);
|
||||
mAlphaAfterClipHistoryEntry = prefs.getBoolean(Settings.PREF_ABC_AFTER_CLIP, false);
|
||||
mAlphaAfterSymbolAndSpace = prefs.getBoolean(Settings.PREF_ABC_AFTER_SYMBOL_SPACE, true);
|
||||
}
|
||||
|
||||
public boolean isApplicationSpecifiedCompletionsOn() {
|
||||
|
|
|
@ -523,6 +523,14 @@ disposition rather than other common dispositions for Latin languages. [CHAR LIM
|
|||
<string name="customize_currencies">Customize currencies</string>
|
||||
<!-- Info for customizing currencies -->
|
||||
<string name="customize_currencies_detail">Set main and up to 6 secondary currency symbols, separated with space</string>
|
||||
<!-- Title setting / dialog for selecting when to switch to main keyboard -->
|
||||
<string name="switch_keyboard_after">Switch to main keyboard after…</string>
|
||||
<!-- Switch to main keyboard after selecting emoji from emoji view -->
|
||||
<string name="after_emoji">Selecting emoji in emoji view</string>
|
||||
<!-- Switch to main keyboard after selecting clipboard history entry -->
|
||||
<string name="after_clip">Selecting clipboard history entry</string>
|
||||
<!-- Switch to main keyboard after entering a symbol in symbols layout and then pressing space or enter -->
|
||||
<string name="after_symbol_and_space">Pressing enter or space after other keys in symbols view</string>
|
||||
<!-- Message for selecting day or night background image -->
|
||||
<string name="day_or_night_image">Set image for day or night mode?</string>
|
||||
<!-- Button for selecting day -->
|
||||
|
|
|
@ -76,6 +76,11 @@
|
|||
android:defaultValue="true"
|
||||
android:persistent="true" />
|
||||
|
||||
<Preference
|
||||
android:key="switch_after"
|
||||
android:title="@string/switch_keyboard_after"
|
||||
android:persistent="true" />
|
||||
|
||||
<Preference
|
||||
android:key="custom_currency_key"
|
||||
android:title="@string/customize_currencies"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue