Add long press functions to more toolbar keys, and more clipboard history toolbar keys (#691)

Co-authored-by: codokie <@>
This commit is contained in:
codokie 2024-05-01 23:44:51 +03:00 committed by GitHub
parent 6bb49ee1a0
commit 83fc10ff02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 99 additions and 47 deletions

View file

@ -653,9 +653,12 @@ public final class RichInputConnection implements PrivateCommandPerformer {
mIC.setSelection(mExpectedSelStart - range.getNumberOfCharsInWordBeforeCursor(), mExpectedSelStart + range.getNumberOfCharsInWordAfterCursor());
}
public void copyText() {
// copy selected text, and if nothing is selected copy the whole text
CharSequence text = getSelectedText(InputConnection.GET_TEXT_WITH_STYLES);
public void copyText(final boolean getSelection) {
CharSequence text = "";
if (getSelection) {
// copy selected text, and if nothing is selected copy the whole text
text = getSelectedText(InputConnection.GET_TEXT_WITH_STYLES);
}
if (text == null || text.length() == 0) {
// we have no selection, get the whole text
final ExtractedTextRequest etr = new ExtractedTextRequest();