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 final CharSequence mWord;
|
||||
private final CharSequence mDebugString;
|
||||
private final String mDebugString;
|
||||
|
||||
public SuggestedWordInfo(final CharSequence word) {
|
||||
mWord = word;
|
||||
mDebugString = "";
|
||||
}
|
||||
|
||||
public SuggestedWordInfo(final CharSequence word, final CharSequence debugString) {
|
||||
public SuggestedWordInfo(final CharSequence word, final String debugString) {
|
||||
mWord = word;
|
||||
if (null == debugString) throw new NullPointerException("");
|
||||
mDebugString = debugString;
|
||||
}
|
||||
|
||||
public String getDebugString() {
|
||||
return mDebugString.toString();
|
||||
return mDebugString;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -502,11 +502,11 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
|
|||
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()) {
|
||||
final SuggestedWordInfo wordInfo = suggestions.getInfo(pos);
|
||||
if (wordInfo != null) {
|
||||
final CharSequence debugInfo = wordInfo.getDebugString();
|
||||
final String debugInfo = wordInfo.getDebugString();
|
||||
if (!TextUtils.isEmpty(debugInfo)) {
|
||||
return debugInfo;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue