Remove touch coordinate from pickSuggestionManually
Change-Id: I33b1b4bc6fdfd263c4b2bb7125c07b4bddcf3c9fmain
parent
48643b0e0d
commit
6785b90727
|
@ -1883,8 +1883,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
// Called from {@link SuggestionStripView} through the {@link SuggestionStripView#Listener}
|
// Called from {@link SuggestionStripView} through the {@link SuggestionStripView#Listener}
|
||||||
// interface
|
// interface
|
||||||
@Override
|
@Override
|
||||||
public void pickSuggestionManually(final int index, final CharSequence suggestion,
|
public void pickSuggestionManually(final int index, final CharSequence suggestion) {
|
||||||
final int x, final int y) {
|
|
||||||
final SuggestedWords suggestedWords = mSuggestionStripView.getSuggestions();
|
final SuggestedWords suggestedWords = mSuggestionStripView.getSuggestions();
|
||||||
// If this is a punctuation picked from the suggestion strip, pass it to onCodeInput
|
// If this is a punctuation picked from the suggestion strip, pass it to onCodeInput
|
||||||
if (suggestion.length() == 1 && isShowingPunctuationList()) {
|
if (suggestion.length() == 1 && isShowingPunctuationList()) {
|
||||||
|
@ -1893,7 +1892,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
LatinImeLogger.logOnManualSuggestion("", suggestion.toString(), index, suggestedWords);
|
LatinImeLogger.logOnManualSuggestion("", suggestion.toString(), index, suggestedWords);
|
||||||
// Rely on onCodeInput to do the complicated swapping/stripping logic consistently.
|
// Rely on onCodeInput to do the complicated swapping/stripping logic consistently.
|
||||||
if (ProductionFlag.IS_EXPERIMENTAL) {
|
if (ProductionFlag.IS_EXPERIMENTAL) {
|
||||||
ResearchLogger.latinIME_punctuationSuggestion(index, suggestion, x, y);
|
ResearchLogger.latinIME_punctuationSuggestion(index, suggestion);
|
||||||
}
|
}
|
||||||
final int primaryCode = suggestion.charAt(0);
|
final int primaryCode = suggestion.charAt(0);
|
||||||
onCodeInput(primaryCode,
|
onCodeInput(primaryCode,
|
||||||
|
@ -1926,8 +1925,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
mConnection.commitCompletion(completionInfo);
|
mConnection.commitCompletion(completionInfo);
|
||||||
mConnection.endBatchEdit();
|
mConnection.endBatchEdit();
|
||||||
if (ProductionFlag.IS_EXPERIMENTAL) {
|
if (ProductionFlag.IS_EXPERIMENTAL) {
|
||||||
ResearchLogger.latinIME_pickApplicationSpecifiedCompletion(index,
|
ResearchLogger.latinIME_pickApplicationSpecifiedCompletion(
|
||||||
completionInfo.getText(), x, y);
|
index, completionInfo.getText());
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1938,7 +1937,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
LatinImeLogger.logOnManualSuggestion(replacedWord,
|
LatinImeLogger.logOnManualSuggestion(replacedWord,
|
||||||
suggestion.toString(), index, suggestedWords);
|
suggestion.toString(), index, suggestedWords);
|
||||||
if (ProductionFlag.IS_EXPERIMENTAL) {
|
if (ProductionFlag.IS_EXPERIMENTAL) {
|
||||||
ResearchLogger.latinIME_pickSuggestionManually(replacedWord, index, suggestion, x, y);
|
ResearchLogger.latinIME_pickSuggestionManually(replacedWord, index, suggestion);
|
||||||
}
|
}
|
||||||
mExpectingUpdateSelection = true;
|
mExpectingUpdateSelection = true;
|
||||||
commitChosenWord(suggestion, LastComposedWord.COMMIT_TYPE_MANUAL_PICK,
|
commitChosenWord(suggestion, LastComposedWord.COMMIT_TYPE_MANUAL_PICK,
|
||||||
|
|
|
@ -72,7 +72,7 @@ public class SuggestionStripView extends RelativeLayout implements OnClickListen
|
||||||
OnLongClickListener {
|
OnLongClickListener {
|
||||||
public interface Listener {
|
public interface Listener {
|
||||||
public boolean addWordToUserDictionary(String word);
|
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}.
|
// 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) {
|
public boolean onCustomRequest(int requestCode) {
|
||||||
final int index = requestCode;
|
final int index = requestCode;
|
||||||
final CharSequence word = mSuggestedWords.getWord(index);
|
final CharSequence word = mSuggestedWords.getWord(index);
|
||||||
// TODO: change caller path so coordinates are passed through here
|
mListener.pickSuggestionManually(index, word);
|
||||||
mListener.pickSuggestionManually(index, word, NOT_A_TOUCH_COORDINATE,
|
|
||||||
NOT_A_TOUCH_COORDINATE);
|
|
||||||
dismissMoreSuggestions();
|
dismissMoreSuggestions();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -874,7 +872,7 @@ public class SuggestionStripView extends RelativeLayout implements OnClickListen
|
||||||
return;
|
return;
|
||||||
|
|
||||||
final CharSequence word = mSuggestedWords.getWord(index);
|
final CharSequence word = mSuggestedWords.getWord(index);
|
||||||
mListener.pickSuggestionManually(index, word, mLastX, mLastY);
|
mListener.pickSuggestionManually(index, word);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -50,6 +50,7 @@ import android.widget.Toast;
|
||||||
|
|
||||||
import com.android.inputmethod.keyboard.Key;
|
import com.android.inputmethod.keyboard.Key;
|
||||||
import com.android.inputmethod.keyboard.Keyboard;
|
import com.android.inputmethod.keyboard.Keyboard;
|
||||||
|
import com.android.inputmethod.keyboard.KeyboardActionListener;
|
||||||
import com.android.inputmethod.keyboard.KeyboardId;
|
import com.android.inputmethod.keyboard.KeyboardId;
|
||||||
import com.android.inputmethod.keyboard.KeyboardSwitcher;
|
import com.android.inputmethod.keyboard.KeyboardSwitcher;
|
||||||
import com.android.inputmethod.keyboard.KeyboardView;
|
import com.android.inputmethod.keyboard.KeyboardView;
|
||||||
|
@ -1062,9 +1063,11 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
"LatinIMEPickApplicationSpecifiedCompletion", "index", "text", "x", "y"
|
"LatinIMEPickApplicationSpecifiedCompletion", "index", "text", "x", "y"
|
||||||
};
|
};
|
||||||
public static void latinIME_pickApplicationSpecifiedCompletion(final int index,
|
public static void latinIME_pickApplicationSpecifiedCompletion(final int index,
|
||||||
final CharSequence cs, int x, int y) {
|
final CharSequence cs) {
|
||||||
final Object[] values = {
|
final Object[] values = {
|
||||||
index, cs, x, y
|
index, cs,
|
||||||
|
KeyboardActionListener.SUGGESTION_STRIP_COORDINATE,
|
||||||
|
KeyboardActionListener.SUGGESTION_STRIP_COORDINATE
|
||||||
};
|
};
|
||||||
final ResearchLogger researchLogger = getInstance();
|
final ResearchLogger researchLogger = getInstance();
|
||||||
researchLogger.enqueuePotentiallyPrivateEvent(
|
researchLogger.enqueuePotentiallyPrivateEvent(
|
||||||
|
@ -1075,10 +1078,12 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
"LatinIMEPickSuggestionManually", "replacedWord", "index", "suggestion", "x", "y"
|
"LatinIMEPickSuggestionManually", "replacedWord", "index", "suggestion", "x", "y"
|
||||||
};
|
};
|
||||||
public static void latinIME_pickSuggestionManually(final String replacedWord,
|
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 = {
|
final Object[] values = {
|
||||||
scrubDigitsFromString(replacedWord), index, suggestion == null ? null :
|
scrubDigitsFromString(replacedWord), index,
|
||||||
scrubDigitsFromString(suggestion.toString()), x, y
|
(suggestion == null ? null : scrubDigitsFromString(suggestion.toString())),
|
||||||
|
KeyboardActionListener.SUGGESTION_STRIP_COORDINATE,
|
||||||
|
KeyboardActionListener.SUGGESTION_STRIP_COORDINATE
|
||||||
};
|
};
|
||||||
final ResearchLogger researchLogger = getInstance();
|
final ResearchLogger researchLogger = getInstance();
|
||||||
researchLogger.enqueuePotentiallyPrivateEvent(EVENTKEYS_LATINIME_PICKSUGGESTIONMANUALLY,
|
researchLogger.enqueuePotentiallyPrivateEvent(EVENTKEYS_LATINIME_PICKSUGGESTIONMANUALLY,
|
||||||
|
@ -1089,9 +1094,11 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
"LatinIMEPunctuationSuggestion", "index", "suggestion", "x", "y"
|
"LatinIMEPunctuationSuggestion", "index", "suggestion", "x", "y"
|
||||||
};
|
};
|
||||||
public static void latinIME_punctuationSuggestion(final int index,
|
public static void latinIME_punctuationSuggestion(final int index,
|
||||||
final CharSequence suggestion, int x, int y) {
|
final CharSequence suggestion) {
|
||||||
final Object[] values = {
|
final Object[] values = {
|
||||||
index, suggestion, x, y
|
index, suggestion,
|
||||||
|
KeyboardActionListener.SUGGESTION_STRIP_COORDINATE,
|
||||||
|
KeyboardActionListener.SUGGESTION_STRIP_COORDINATE
|
||||||
};
|
};
|
||||||
getInstance().enqueueEvent(EVENTKEYS_LATINIME_PUNCTUATIONSUGGESTION, values);
|
getInstance().enqueueEvent(EVENTKEYS_LATINIME_PUNCTUATIONSUGGESTION, values);
|
||||||
}
|
}
|
||||||
|
|
|
@ -260,9 +260,7 @@ public class InputTestsBase extends ServiceTestCase<LatinIME> {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void pickSuggestionManually(final int index, final CharSequence suggestion) {
|
protected void pickSuggestionManually(final int index, final CharSequence suggestion) {
|
||||||
mLatinIME.pickSuggestionManually(index, suggestion,
|
mLatinIME.pickSuggestionManually(index, suggestion);
|
||||||
KeyboardActionListener.NOT_A_TOUCH_COORDINATE,
|
|
||||||
KeyboardActionListener.NOT_A_TOUCH_COORDINATE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helper to avoid writing the try{}catch block each time
|
// Helper to avoid writing the try{}catch block each time
|
||||||
|
|
Loading…
Reference in New Issue