aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2012-08-21 17:13:45 +0900
committerTadashi G. Takaoka <takaoka@google.com>2012-08-21 17:13:45 +0900
commit6785b9072762e15bb49657ce7b7d228dab76e44a (patch)
tree9c1e94ca9bcaf2462ecc8c2a391688d985ec03c7 /java/src
parent48643b0e0d73703f4b3357add9f793d521eedf96 (diff)
downloadlatinime-6785b9072762e15bb49657ce7b7d228dab76e44a.tar.gz
latinime-6785b9072762e15bb49657ce7b7d228dab76e44a.tar.xz
latinime-6785b9072762e15bb49657ce7b7d228dab76e44a.zip
Remove touch coordinate from pickSuggestionManually
Change-Id: I33b1b4bc6fdfd263c4b2bb7125c07b4bddcf3c9f
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java11
-rw-r--r--java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java8
-rw-r--r--java/src/com/android/inputmethod/research/ResearchLogger.java21
3 files changed, 22 insertions, 18 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index a7896ad52..58df15929 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1883,8 +1883,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// Called from {@link SuggestionStripView} through the {@link SuggestionStripView#Listener}
// interface
@Override
- public void pickSuggestionManually(final int index, final CharSequence suggestion,
- final int x, final int y) {
+ public void pickSuggestionManually(final int index, final CharSequence suggestion) {
final SuggestedWords suggestedWords = mSuggestionStripView.getSuggestions();
// If this is a punctuation picked from the suggestion strip, pass it to onCodeInput
if (suggestion.length() == 1 && isShowingPunctuationList()) {
@@ -1893,7 +1892,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
LatinImeLogger.logOnManualSuggestion("", suggestion.toString(), index, suggestedWords);
// Rely on onCodeInput to do the complicated swapping/stripping logic consistently.
if (ProductionFlag.IS_EXPERIMENTAL) {
- ResearchLogger.latinIME_punctuationSuggestion(index, suggestion, x, y);
+ ResearchLogger.latinIME_punctuationSuggestion(index, suggestion);
}
final int primaryCode = suggestion.charAt(0);
onCodeInput(primaryCode,
@@ -1926,8 +1925,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mConnection.commitCompletion(completionInfo);
mConnection.endBatchEdit();
if (ProductionFlag.IS_EXPERIMENTAL) {
- ResearchLogger.latinIME_pickApplicationSpecifiedCompletion(index,
- completionInfo.getText(), x, y);
+ ResearchLogger.latinIME_pickApplicationSpecifiedCompletion(
+ index, completionInfo.getText());
}
return;
}
@@ -1938,7 +1937,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
LatinImeLogger.logOnManualSuggestion(replacedWord,
suggestion.toString(), index, suggestedWords);
if (ProductionFlag.IS_EXPERIMENTAL) {
- ResearchLogger.latinIME_pickSuggestionManually(replacedWord, index, suggestion, x, y);
+ ResearchLogger.latinIME_pickSuggestionManually(replacedWord, index, suggestion);
}
mExpectingUpdateSelection = true;
commitChosenWord(suggestion, LastComposedWord.COMMIT_TYPE_MANUAL_PICK,
diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
index b57ffd2de..bd9a0da13 100644
--- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
+++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
@@ -72,7 +72,7 @@ public class SuggestionStripView extends RelativeLayout implements OnClickListen
OnLongClickListener {
public interface Listener {
public boolean addWordToUserDictionary(String word);
- public void pickSuggestionManually(int index, CharSequence word, int x, int y);
+ public void pickSuggestionManually(int index, CharSequence word);
}
// The maximum number of suggestions available. See {@link Suggest#mPrefMaxSuggestions}.
@@ -726,9 +726,7 @@ public class SuggestionStripView extends RelativeLayout implements OnClickListen
public boolean onCustomRequest(int requestCode) {
final int index = requestCode;
final CharSequence word = mSuggestedWords.getWord(index);
- // TODO: change caller path so coordinates are passed through here
- mListener.pickSuggestionManually(index, word, NOT_A_TOUCH_COORDINATE,
- NOT_A_TOUCH_COORDINATE);
+ mListener.pickSuggestionManually(index, word);
dismissMoreSuggestions();
return true;
}
@@ -874,7 +872,7 @@ public class SuggestionStripView extends RelativeLayout implements OnClickListen
return;
final CharSequence word = mSuggestedWords.getWord(index);
- mListener.pickSuggestionManually(index, word, mLastX, mLastY);
+ mListener.pickSuggestionManually(index, word);
}
@Override
diff --git a/java/src/com/android/inputmethod/research/ResearchLogger.java b/java/src/com/android/inputmethod/research/ResearchLogger.java
index cf6f31a0a..384a2b1a4 100644
--- a/java/src/com/android/inputmethod/research/ResearchLogger.java
+++ b/java/src/com/android/inputmethod/research/ResearchLogger.java
@@ -50,6 +50,7 @@ import android.widget.Toast;
import com.android.inputmethod.keyboard.Key;
import com.android.inputmethod.keyboard.Keyboard;
+import com.android.inputmethod.keyboard.KeyboardActionListener;
import com.android.inputmethod.keyboard.KeyboardId;
import com.android.inputmethod.keyboard.KeyboardSwitcher;
import com.android.inputmethod.keyboard.KeyboardView;
@@ -1062,9 +1063,11 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
"LatinIMEPickApplicationSpecifiedCompletion", "index", "text", "x", "y"
};
public static void latinIME_pickApplicationSpecifiedCompletion(final int index,
- final CharSequence cs, int x, int y) {
+ final CharSequence cs) {
final Object[] values = {
- index, cs, x, y
+ index, cs,
+ KeyboardActionListener.SUGGESTION_STRIP_COORDINATE,
+ KeyboardActionListener.SUGGESTION_STRIP_COORDINATE
};
final ResearchLogger researchLogger = getInstance();
researchLogger.enqueuePotentiallyPrivateEvent(
@@ -1075,10 +1078,12 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
"LatinIMEPickSuggestionManually", "replacedWord", "index", "suggestion", "x", "y"
};
public static void latinIME_pickSuggestionManually(final String replacedWord,
- final int index, CharSequence suggestion, int x, int y) {
+ final int index, CharSequence suggestion) {
final Object[] values = {
- scrubDigitsFromString(replacedWord), index, suggestion == null ? null :
- scrubDigitsFromString(suggestion.toString()), x, y
+ scrubDigitsFromString(replacedWord), index,
+ (suggestion == null ? null : scrubDigitsFromString(suggestion.toString())),
+ KeyboardActionListener.SUGGESTION_STRIP_COORDINATE,
+ KeyboardActionListener.SUGGESTION_STRIP_COORDINATE
};
final ResearchLogger researchLogger = getInstance();
researchLogger.enqueuePotentiallyPrivateEvent(EVENTKEYS_LATINIME_PICKSUGGESTIONMANUALLY,
@@ -1089,9 +1094,11 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
"LatinIMEPunctuationSuggestion", "index", "suggestion", "x", "y"
};
public static void latinIME_punctuationSuggestion(final int index,
- final CharSequence suggestion, int x, int y) {
+ final CharSequence suggestion) {
final Object[] values = {
- index, suggestion, x, y
+ index, suggestion,
+ KeyboardActionListener.SUGGESTION_STRIP_COORDINATE,
+ KeyboardActionListener.SUGGESTION_STRIP_COORDINATE
};
getInstance().enqueueEvent(EVENTKEYS_LATINIME_PUNCTUATIONSUGGESTION, values);
}