am 5b92a451: Merge "Bug 5254884: suggestions are no logner copied in the clipboard"
* commit '5b92a451c0004b53e8c10537c5254c9e6d047d19': Bug 5254884: suggestions are no logner copied in the clipboard
This commit is contained in:
@@ -9192,19 +9192,23 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
||||
return true;
|
||||
|
||||
case ID_CUT:
|
||||
setPrimaryClip(ClipData.newPlainText(null, mTransformed.subSequence(min, max)));
|
||||
setPrimaryClip(ClipData.newPlainText(null, getTransformedText(min, max)));
|
||||
((Editable) mText).delete(min, max);
|
||||
stopSelectionActionMode();
|
||||
return true;
|
||||
|
||||
case ID_COPY:
|
||||
setPrimaryClip(ClipData.newPlainText(null, mTransformed.subSequence(min, max)));
|
||||
setPrimaryClip(ClipData.newPlainText(null, getTransformedText(min, max)));
|
||||
stopSelectionActionMode();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private CharSequence getTransformedText(int start, int end) {
|
||||
return removeSuggestionSpans(mTransformed.subSequence(start, end));
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare text so that there are not zero or two spaces at beginning and end of region defined
|
||||
* by [min, max] when replacing this region by paste.
|
||||
@@ -9321,7 +9325,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
||||
// Start a drag
|
||||
final int start = getSelectionStart();
|
||||
final int end = getSelectionEnd();
|
||||
CharSequence selectedText = mTransformed.subSequence(start, end);
|
||||
CharSequence selectedText = getTransformedText(start, end);
|
||||
ClipData data = ClipData.newPlainText(null, selectedText);
|
||||
DragLocalState localState = new DragLocalState(this, start, end);
|
||||
startDrag(data, getTextThumbnailBuilder(selectedText), localState, 0);
|
||||
|
||||
Reference in New Issue
Block a user