Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a273319c authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Add PunctuationSuggestions class

This change must be checked in together with I366c477516.

Bug: 12640318
Change-Id: I8d3864b9d9649c9e3306e82b01a6327b11281b1f
parent 4197c6f3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -21,5 +21,6 @@
    <!-- The all letters need to be mirrored are found at
         http://www.unicode.org/Public/6.1.0/ucd/BidiMirroring.txt -->
    <!-- Symbols that are suggested between words -->
    <!-- TODO: Use !text resources to merge LTR and RTL punctuations. -->
    <string name="suggested_punctuations" translatable="false">!,?,\\,,:,;,\",(|),)|(,\',-,/,@,_</string>
</resources>
+1 −0
Original line number Diff line number Diff line
@@ -21,5 +21,6 @@
    <!-- The all letters need to be mirrored are found at
         http://www.unicode.org/Public/6.1.0/ucd/BidiMirroring.txt -->
    <!-- Symbols that are suggested between words -->
    <!-- TODO: Use !text resources to merge LTR and RTL punctuations. -->
    <string name="suggested_punctuations" translatable="false">!,?,\\,,:,;,\",(|),)|(,\',-,/,@,_</string>
</resources>
+1 −0
Original line number Diff line number Diff line
@@ -21,5 +21,6 @@
    <!-- The all letters need to be mirrored are found at
         http://www.unicode.org/Public/6.1.0/ucd/BidiMirroring.txt -->
    <!-- Symbols that are suggested between words -->
    <!-- TODO: Use !text resources to merge LTR and RTL punctuations. -->
    <string name="suggested_punctuations" translatable="false">!,?,\\,,:,;,\",(|),)|(,\',-,/,@,_</string>
</resources>
+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@
    <!-- TODO: these settings depend on the language. They should be put either in the dictionary
         header, or in the subtype maybe? -->
    <!-- Symbols that are suggested between words -->
    <!-- TODO: Use !text resources to merge LTR and RTL punctuations. -->
    <!-- TODO: We should have different punctuations list for tablet. -->
    <string name="suggested_punctuations" translatable="false">!,?,\\,,:,;,\",(,),\',-,/,@,_</string>
    <!-- Symbols that are normally preceded by a space (used to add an auto-space before these) -->
    <string name="symbols_preceded_by_space" translatable="false">([{&amp;</string>
+1 −2
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import android.text.Spanned;
import android.text.TextUtils;
import android.text.style.SuggestionSpan;

import com.android.inputmethod.latin.Dictionary;
import com.android.inputmethod.latin.LatinImeLogger;
import com.android.inputmethod.latin.SuggestedWords;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
@@ -70,7 +69,7 @@ public final class SuggestionSpanUtils {
    public static CharSequence getTextWithSuggestionSpan(final Context context,
            final String pickedWord, final SuggestedWords suggestedWords) {
        if (TextUtils.isEmpty(pickedWord) || suggestedWords.isEmpty()
                || suggestedWords.mIsPrediction || suggestedWords.mIsPunctuationSuggestions) {
                || suggestedWords.mIsPrediction || suggestedWords.isPunctuationSuggestions()) {
            return pickedWord;
        }

Loading