Move MoreSuggestionsListener to MoreSuggestionsView

Change-Id: I3b5bc630bf73a357ed0beeec0b555149ef248313
main
Tadashi G. Takaoka 2014-05-27 14:49:25 +09:00
parent 9647d7fbee
commit 01748cde4e
3 changed files with 7 additions and 8 deletions

View File

@ -23,23 +23,17 @@ import android.graphics.drawable.Drawable;
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.internal.KeyboardBuilder; import com.android.inputmethod.keyboard.internal.KeyboardBuilder;
import com.android.inputmethod.keyboard.internal.KeyboardIconsSet; import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
import com.android.inputmethod.keyboard.internal.KeyboardParams; import com.android.inputmethod.keyboard.internal.KeyboardParams;
import com.android.inputmethod.latin.Constants; import com.android.inputmethod.latin.Constants;
import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.SuggestedWords; import com.android.inputmethod.latin.SuggestedWords;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
import com.android.inputmethod.latin.utils.TypefaceUtils; import com.android.inputmethod.latin.utils.TypefaceUtils;
public final class MoreSuggestions extends Keyboard { public final class MoreSuggestions extends Keyboard {
public final SuggestedWords mSuggestedWords; public final SuggestedWords mSuggestedWords;
public static abstract class MoreSuggestionsListener extends KeyboardActionListener.Adapter {
public abstract void onSuggestionSelected(final int index, final SuggestedWordInfo info);
}
MoreSuggestions(final MoreSuggestionsParam params, final SuggestedWords suggestedWords) { MoreSuggestions(final MoreSuggestionsParam params, final SuggestedWords suggestedWords) {
super(params); super(params);
mSuggestedWords = suggestedWords; mSuggestedWords = suggestedWords;

View File

@ -22,11 +22,12 @@ import android.util.Log;
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.MoreKeysKeyboardView; import com.android.inputmethod.keyboard.MoreKeysKeyboardView;
import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.SuggestedWords; import com.android.inputmethod.latin.SuggestedWords;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
import com.android.inputmethod.latin.suggestions.MoreSuggestions.MoreSuggestionKey; import com.android.inputmethod.latin.suggestions.MoreSuggestions.MoreSuggestionKey;
import com.android.inputmethod.latin.suggestions.MoreSuggestions.MoreSuggestionsListener;
/** /**
* A view that renders a virtual {@link MoreSuggestions}. It handles rendering of keys and detecting * A view that renders a virtual {@link MoreSuggestions}. It handles rendering of keys and detecting
@ -35,6 +36,10 @@ import com.android.inputmethod.latin.suggestions.MoreSuggestions.MoreSuggestions
public final class MoreSuggestionsView extends MoreKeysKeyboardView { public final class MoreSuggestionsView extends MoreKeysKeyboardView {
private static final String TAG = MoreSuggestionsView.class.getSimpleName(); private static final String TAG = MoreSuggestionsView.class.getSimpleName();
public static abstract class MoreSuggestionsListener extends KeyboardActionListener.Adapter {
public abstract void onSuggestionSelected(final int index, final SuggestedWordInfo info);
}
public MoreSuggestionsView(final Context context, final AttributeSet attrs) { public MoreSuggestionsView(final Context context, final AttributeSet attrs) {
this(context, attrs, R.attr.moreKeysKeyboardViewStyle); this(context, attrs, R.attr.moreKeysKeyboardViewStyle);
} }

View File

@ -49,7 +49,7 @@ import com.android.inputmethod.latin.SuggestedWords;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
import com.android.inputmethod.latin.define.ProductionFlag; import com.android.inputmethod.latin.define.ProductionFlag;
import com.android.inputmethod.latin.settings.Settings; import com.android.inputmethod.latin.settings.Settings;
import com.android.inputmethod.latin.suggestions.MoreSuggestions.MoreSuggestionsListener; import com.android.inputmethod.latin.suggestions.MoreSuggestionsView.MoreSuggestionsListener;
import com.android.inputmethod.latin.utils.ImportantNoticeUtils; import com.android.inputmethod.latin.utils.ImportantNoticeUtils;
import com.android.inputmethod.research.ResearchLogger; import com.android.inputmethod.research.ResearchLogger;