mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-16 15:02:48 +00:00
Add toast notification when copying from clipboard (#752)
and use the toast for showing dictionary on double-long-press word: switch from one ugly workaround (popup menu) to another (hiding more suggestions panel) Co-authored-by: codokie <@> Co-authored-by: Helium314 <helium314@mailbox.org>
This commit is contained in:
parent
df6af1f07e
commit
e357f84572
11 changed files with 101 additions and 7 deletions
|
@ -10,11 +10,14 @@ import android.content.ClipData;
|
|||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.inputmethodservice.InputMethodService;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.SystemClock;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.TextUtils;
|
||||
import android.text.style.CharacterStyle;
|
||||
|
||||
import helium314.keyboard.keyboard.KeyboardSwitcher;
|
||||
import helium314.keyboard.latin.utils.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.inputmethod.CompletionInfo;
|
||||
|
@ -671,6 +674,9 @@ public final class RichInputConnection implements PrivateCommandPerformer {
|
|||
if (text == null || text.length() == 0) return;
|
||||
final ClipboardManager cm = (ClipboardManager) mParent.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
cm.setPrimaryClip(ClipData.newPlainText("copied text", text));
|
||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) {
|
||||
KeyboardSwitcher.getInstance().showToast(mParent.getString(R.string.toast_msg_clipboard_copy), true);
|
||||
}
|
||||
}
|
||||
|
||||
public void commitCorrection(final CorrectionInfo correctionInfo) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue