Skip to content
Snippets Groups Projects
Commit c59e3839 authored by satok's avatar satok Committed by Android (Google) Code Review
Browse files

Merge "Do not change the proximity orders"

parents c24f66e1 ef08dadd
No related branches found
No related tags found
No related merge requests found
...@@ -177,7 +177,6 @@ public class WordComposer { ...@@ -177,7 +177,6 @@ public class WordComposer {
private void add(int primaryCode, int[] codes, int keyX, int keyY) { private void add(int primaryCode, int[] codes, int keyX, int keyY) {
final int newIndex = mCodes.size(); final int newIndex = mCodes.size();
mTypedWord.appendCodePoint(primaryCode); mTypedWord.appendCodePoint(primaryCode);
correctPrimaryJuxtapos(primaryCode, codes);
mCodes.add(codes); mCodes.add(codes);
if (newIndex < BinaryDictionary.MAX_WORD_LENGTH) { if (newIndex < BinaryDictionary.MAX_WORD_LENGTH) {
mXCoordinates[newIndex] = keyX; mXCoordinates[newIndex] = keyX;
...@@ -238,21 +237,6 @@ public class WordComposer { ...@@ -238,21 +237,6 @@ public class WordComposer {
setComposingWord(word, keyboard, keyDetector); setComposingWord(word, keyboard, keyDetector);
} }
/**
* Swaps the first and second values in the codes array if the primary code is not the first
* value in the array but the second. This happens when the preferred key is not the key that
* the user released the finger on.
* @param primaryCode the preferred character
* @param codes array of codes based on distance from touch point
*/
private static void correctPrimaryJuxtapos(int primaryCode, int[] codes) {
if (codes.length < 2) return;
if (codes[0] > 0 && codes[1] > 0 && codes[0] != primaryCode && codes[1] == primaryCode) {
codes[1] = codes[0];
codes[0] = primaryCode;
}
}
/** /**
* Delete the last keystroke as a result of hitting backspace. * Delete the last keystroke as a result of hitting backspace.
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment