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

Commit ccb60b76 authored by Jean Chalard's avatar Jean Chalard Committed by Android (Google) Code Review
Browse files

Merge "Straighten out magic space vs real spaces behavior."

parents 9b2192bf 0730bbfb
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -23,6 +23,9 @@
    <integer name="key_tab">9</integer>
    <integer name="key_return">10</integer>
    <integer name="key_space">32</integer>
    <integer name="key_dash">45</integer>
    <integer name="key_single_quote">39</integer>
    <integer name="key_double_quote">34</integer>
    <integer name="key_shift">-1</integer>
    <integer name="key_switch_alpha_symbol">-2</integer>
    <integer name="key_delete">-5</integer>
+3 −0
Original line number Diff line number Diff line
@@ -63,6 +63,9 @@ public class Keyboard {
    public static final int CODE_TAB = '\t';
    public static final int CODE_SPACE = ' ';
    public static final int CODE_PERIOD = '.';
    public static final int CODE_DASH = '-';
    public static final int CODE_SINGLE_QUOTE = '\'';
    public static final int CODE_DOUBLE_QUOTE = '"';

    /** Special keys code.  These should be aligned with values/keycodes.xml */
    public static final int CODE_DUMMY = 0;
+1 −1
Original line number Diff line number Diff line
@@ -626,7 +626,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha

    private static boolean isQuoteCharacter(int c) {
        // Apostrophe, quotation mark.
        if (c == '\'' || c == '"')
        if (c == Keyboard.CODE_SINGLE_QUOTE || c == Keyboard.CODE_DOUBLE_QUOTE)
            return true;
        // \u2018: Left single quotation mark
        // \u2019: Right single quotation mark
+5 −2
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@ import android.provider.ContactsContract.Contacts;
import android.text.TextUtils;
import android.util.Log;

import com.android.inputmethod.keyboard.Keyboard;

public class ContactsDictionary extends ExpandableDictionary {

    private static final String[] PROJECTION = {
@@ -123,8 +125,9 @@ public class ContactsDictionary extends ExpandableDictionary {
                                for (j = i + 1; j < len; j++) {
                                    char c = name.charAt(j);

                                    if (!(c == '-' || c == '\'' ||
                                          Character.isLetter(c))) {
                                    if (!(c == Keyboard.CODE_DASH
                                            || c == Keyboard.CODE_SINGLE_QUOTE
                                            || Character.isLetter(c))) {
                                        break;
                                    }
                                }
+4 −3
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ package com.android.inputmethod.latin;
import android.content.Context;
import android.os.AsyncTask;

import com.android.inputmethod.keyboard.Keyboard;

import java.util.LinkedList;

/**
@@ -41,8 +43,6 @@ public class ExpandableDictionary extends Dictionary {
    private int mMaxDepth;
    private int mInputLength;

    private static final char QUOTE = '\'';

    private boolean mRequiresReload;

    private boolean mUpdatingDictionary;
@@ -304,7 +304,8 @@ public class ExpandableDictionary extends Dictionary {
                    getWordsRec(children, codes, word, depth + 1, completion, snr, inputIndex,
                            skipPos, callback);
                }
            } else if ((c == QUOTE && currentChars[0] != QUOTE) || depth == skipPos) {
            } else if ((c == Keyboard.CODE_SINGLE_QUOTE
                    && currentChars[0] != Keyboard.CODE_SINGLE_QUOTE) || depth == skipPos) {
                // Skip the ' and continue deeper
                word[depth] = c;
                if (children != null) {
Loading