Loading core/java/android/widget/TextView.java +5 −5 Original line number Original line Diff line number Diff line Loading @@ -8574,11 +8574,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener final String originalText = mText.subSequence(spanStart, spanEnd).toString(); final String originalText = mText.subSequence(spanStart, spanEnd).toString(); ((Editable) mText).replace(spanStart, spanEnd, suggestion); ((Editable) mText).replace(spanStart, spanEnd, suggestion); // Swap text content between actual text and Suggestion span // Notify source IME of the suggestion pick. Do this before swaping texts. String[] suggestions = suggestionInfo.suggestionSpan.getSuggestions(); suggestions[suggestionInfo.suggestionIndex] = originalText; // Notify source IME of the suggestion pick if (!TextUtils.isEmpty( if (!TextUtils.isEmpty( suggestionInfo.suggestionSpan.getNotificationTargetClassName())) { suggestionInfo.suggestionSpan.getNotificationTargetClassName())) { InputMethodManager imm = InputMethodManager.peekInstance(); InputMethodManager imm = InputMethodManager.peekInstance(); Loading @@ -8586,6 +8582,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener suggestionInfo.suggestionIndex); suggestionInfo.suggestionIndex); } } // Swap text content between actual text and Suggestion span String[] suggestions = suggestionInfo.suggestionSpan.getSuggestions(); suggestions[suggestionInfo.suggestionIndex] = originalText; // Restore previous SuggestionSpans // Restore previous SuggestionSpans final int lengthDifference = suggestion.length() - (spanEnd - spanStart); final int lengthDifference = suggestion.length() - (spanEnd - spanStart); for (int i = 0; i < length; i++) { for (int i = 0; i < length; i++) { Loading Loading
core/java/android/widget/TextView.java +5 −5 Original line number Original line Diff line number Diff line Loading @@ -8574,11 +8574,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener final String originalText = mText.subSequence(spanStart, spanEnd).toString(); final String originalText = mText.subSequence(spanStart, spanEnd).toString(); ((Editable) mText).replace(spanStart, spanEnd, suggestion); ((Editable) mText).replace(spanStart, spanEnd, suggestion); // Swap text content between actual text and Suggestion span // Notify source IME of the suggestion pick. Do this before swaping texts. String[] suggestions = suggestionInfo.suggestionSpan.getSuggestions(); suggestions[suggestionInfo.suggestionIndex] = originalText; // Notify source IME of the suggestion pick if (!TextUtils.isEmpty( if (!TextUtils.isEmpty( suggestionInfo.suggestionSpan.getNotificationTargetClassName())) { suggestionInfo.suggestionSpan.getNotificationTargetClassName())) { InputMethodManager imm = InputMethodManager.peekInstance(); InputMethodManager imm = InputMethodManager.peekInstance(); Loading @@ -8586,6 +8582,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener suggestionInfo.suggestionIndex); suggestionInfo.suggestionIndex); } } // Swap text content between actual text and Suggestion span String[] suggestions = suggestionInfo.suggestionSpan.getSuggestions(); suggestions[suggestionInfo.suggestionIndex] = originalText; // Restore previous SuggestionSpans // Restore previous SuggestionSpans final int lengthDifference = suggestion.length() - (spanEnd - spanStart); final int lengthDifference = suggestion.length() - (spanEnd - spanStart); for (int i = 0; i < length; i++) { for (int i = 0; i < length; i++) { Loading