Optimization
All calls to this methods are made with an actual String. No sense beating ourselves with an interface stick. Change-Id: I6ef98286be6f81f73864b04f3a17e68f36a6e542main
parent
123407261c
commit
4e74658883
|
@ -121,21 +121,21 @@ public class SuggestedWords {
|
||||||
|
|
||||||
public static class SuggestedWordInfo {
|
public static class SuggestedWordInfo {
|
||||||
public final CharSequence mWord;
|
public final CharSequence mWord;
|
||||||
private final CharSequence mDebugString;
|
private final String mDebugString;
|
||||||
|
|
||||||
public SuggestedWordInfo(final CharSequence word) {
|
public SuggestedWordInfo(final CharSequence word) {
|
||||||
mWord = word;
|
mWord = word;
|
||||||
mDebugString = "";
|
mDebugString = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public SuggestedWordInfo(final CharSequence word, final CharSequence debugString) {
|
public SuggestedWordInfo(final CharSequence word, final String debugString) {
|
||||||
mWord = word;
|
mWord = word;
|
||||||
if (null == debugString) throw new NullPointerException("");
|
if (null == debugString) throw new NullPointerException("");
|
||||||
mDebugString = debugString;
|
mDebugString = debugString;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDebugString() {
|
public String getDebugString() {
|
||||||
return mDebugString.toString();
|
return mDebugString;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -502,11 +502,11 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
|
||||||
hintView, 1.0f - mCenterSuggestionWeight, ViewGroup.LayoutParams.MATCH_PARENT);
|
hintView, 1.0f - mCenterSuggestionWeight, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static CharSequence getDebugInfo(SuggestedWords suggestions, int pos) {
|
private static String getDebugInfo(SuggestedWords suggestions, int pos) {
|
||||||
if (DBG && pos < suggestions.size()) {
|
if (DBG && pos < suggestions.size()) {
|
||||||
final SuggestedWordInfo wordInfo = suggestions.getInfo(pos);
|
final SuggestedWordInfo wordInfo = suggestions.getInfo(pos);
|
||||||
if (wordInfo != null) {
|
if (wordInfo != null) {
|
||||||
final CharSequence debugInfo = wordInfo.getDebugString();
|
final String debugInfo = wordInfo.getDebugString();
|
||||||
if (!TextUtils.isEmpty(debugInfo)) {
|
if (!TextUtils.isEmpty(debugInfo)) {
|
||||||
return debugInfo;
|
return debugInfo;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue