mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-14 14:02:44 +00:00
Show suggestion strip on password input when paste enabled
This commit is contained in:
parent
31b4a28471
commit
ff7406fb98
2 changed files with 4 additions and 2 deletions
|
@ -1588,10 +1588,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
currentSettingsValues.mInputAttributes.mShouldShowSuggestions
|
currentSettingsValues.mInputAttributes.mShouldShowSuggestions
|
||||||
&& currentSettingsValues.isSuggestionsEnabledPerUserSettings();
|
&& currentSettingsValues.isSuggestionsEnabledPerUserSettings();
|
||||||
final boolean shouldShowSuggestionsStripUnlessPassword = currentSettingsValues.mShowsVoiceInputKey
|
final boolean shouldShowSuggestionsStripUnlessPassword = currentSettingsValues.mShowsVoiceInputKey
|
||||||
|
|| currentSettingsValues.mShowsPasteKey
|
||||||
|| shouldShowSuggestionCandidates
|
|| shouldShowSuggestionCandidates
|
||||||
|| currentSettingsValues.isApplicationSpecifiedCompletionsOn();
|
|| currentSettingsValues.isApplicationSpecifiedCompletionsOn();
|
||||||
final boolean shouldShowSuggestionsStrip = shouldShowSuggestionsStripUnlessPassword
|
final boolean shouldShowSuggestionsStrip = shouldShowSuggestionsStripUnlessPassword
|
||||||
&& !currentSettingsValues.mInputAttributes.mIsPasswordField;
|
&& (!currentSettingsValues.mInputAttributes.mIsPasswordField || currentSettingsValues.mShowsPasteKey);
|
||||||
mSuggestionStripView.updateVisibility(shouldShowSuggestionsStrip, isFullscreenMode());
|
mSuggestionStripView.updateVisibility(shouldShowSuggestionsStrip, isFullscreenMode());
|
||||||
if (!shouldShowSuggestionsStrip) {
|
if (!shouldShowSuggestionsStrip) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -443,7 +443,8 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
|
||||||
}
|
}
|
||||||
if (view == mPasteKey) {
|
if (view == mPasteKey) {
|
||||||
CharSequence selectionSequence = mListener.getSelection();
|
CharSequence selectionSequence = mListener.getSelection();
|
||||||
if (selectionSequence != null && selectionSequence.length() > 0) {
|
if (selectionSequence != null && selectionSequence.length() > 0
|
||||||
|
&& !Settings.getInstance().getCurrent().mInputAttributes.mIsPasswordField) {
|
||||||
ClipboardManager clipboardManager = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
|
ClipboardManager clipboardManager = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
clipboardManager.setPrimaryClip(ClipData.newPlainText(selectionSequence, selectionSequence));
|
clipboardManager.setPrimaryClip(ClipData.newPlainText(selectionSequence, selectionSequence));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue