Bug 5254884: suggestions are no logner copied in the clipboard
Change-Id: I621c5b4da4252876b0f424e895a4e19e2a4dda50
This commit is contained in:
@@ -9188,19 +9188,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.
|
||||
@@ -9317,7 +9321,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