aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
diff options
context:
space:
mode:
authorDan Zivkovic <zivkovic@google.com>2015-02-03 10:18:06 -0800
committerDan Zivkovic <zivkovic@google.com>2015-02-03 15:12:01 -0800
commit23574d1231296e090e6efb41a50c7885a116ddb4 (patch)
tree5578fff08ae893e6b3a090c1bc3c11df6f12471d /java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
parent48cc0d642081df20c66aab0a453942e54f390a0b (diff)
downloadlatinime-23574d1231296e090e6efb41a50c7885a116ddb4.tar.gz
latinime-23574d1231296e090e6efb41a50c7885a116ddb4.tar.xz
latinime-23574d1231296e090e6efb41a50c7885a116ddb4.zip
LatinIME portion of "green plus" feature.
Removes the feature that adds strings to the user dictionary, aka the "green highlight with a plus sign". Bug 19237189. Change-Id: I2387129a3add2d69d625f2ff16ed8cab3f10a735
Diffstat (limited to 'java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java')
-rw-r--r--java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java53
1 files changed, 3 insertions, 50 deletions
diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
index b71bd1f50..4b849496c 100644
--- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
+++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
@@ -58,7 +58,6 @@ import java.util.ArrayList;
public final class SuggestionStripView extends RelativeLayout implements OnClickListener,
OnLongClickListener {
public interface Listener {
- public void addWordToUserDictionary(String word);
public void showImportantNoticeContents();
public void pickSuggestionManually(SuggestedWordInfo word);
public void onCodeInput(int primaryCode, int x, int y, boolean isKeyRepeat);
@@ -69,7 +68,6 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
private final ViewGroup mSuggestionsStrip;
private final ImageButton mVoiceKey;
- private final ViewGroup mAddToDictionaryStrip;
private final View mImportantNoticeStrip;
MainKeyboardView mMainKeyboardView;
@@ -91,15 +89,12 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
private static class StripVisibilityGroup {
private final View mSuggestionStripView;
private final View mSuggestionsStrip;
- private final View mAddToDictionaryStrip;
private final View mImportantNoticeStrip;
public StripVisibilityGroup(final View suggestionStripView,
- final ViewGroup suggestionsStrip, final ViewGroup addToDictionaryStrip,
- final View importantNoticeStrip) {
+ final ViewGroup suggestionsStrip, final View importantNoticeStrip) {
mSuggestionStripView = suggestionStripView;
mSuggestionsStrip = suggestionsStrip;
- mAddToDictionaryStrip = addToDictionaryStrip;
mImportantNoticeStrip = importantNoticeStrip;
showSuggestionsStrip();
}
@@ -109,35 +104,22 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
: ViewCompat.LAYOUT_DIRECTION_LTR;
ViewCompat.setLayoutDirection(mSuggestionStripView, layoutDirection);
ViewCompat.setLayoutDirection(mSuggestionsStrip, layoutDirection);
- ViewCompat.setLayoutDirection(mAddToDictionaryStrip, layoutDirection);
ViewCompat.setLayoutDirection(mImportantNoticeStrip, layoutDirection);
}
public void showSuggestionsStrip() {
mSuggestionsStrip.setVisibility(VISIBLE);
- mAddToDictionaryStrip.setVisibility(INVISIBLE);
- mImportantNoticeStrip.setVisibility(INVISIBLE);
- }
-
- public void showAddToDictionaryStrip() {
- mSuggestionsStrip.setVisibility(INVISIBLE);
- mAddToDictionaryStrip.setVisibility(VISIBLE);
mImportantNoticeStrip.setVisibility(INVISIBLE);
}
public void showImportantNoticeStrip() {
mSuggestionsStrip.setVisibility(INVISIBLE);
- mAddToDictionaryStrip.setVisibility(INVISIBLE);
mImportantNoticeStrip.setVisibility(VISIBLE);
}
public boolean isShowingImportantNoticeStrip() {
return mImportantNoticeStrip.getVisibility() == VISIBLE;
}
-
- public boolean isShowingAddToDictionaryStrip() {
- return mAddToDictionaryStrip.getVisibility() == VISIBLE;
- }
}
/**
@@ -158,10 +140,9 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
mSuggestionsStrip = (ViewGroup)findViewById(R.id.suggestions_strip);
mVoiceKey = (ImageButton)findViewById(R.id.suggestions_strip_voice_key);
- mAddToDictionaryStrip = (ViewGroup)findViewById(R.id.add_to_dictionary_strip);
mImportantNoticeStrip = findViewById(R.id.important_notice_strip);
mStripVisibilityGroup = new StripVisibilityGroup(this, mSuggestionsStrip,
- mAddToDictionaryStrip, mImportantNoticeStrip);
+ mImportantNoticeStrip);
for (int pos = 0; pos < SuggestedWords.MAX_SUGGESTIONS; pos++) {
final TextView word = new TextView(context, null, R.attr.suggestionWordStyle);
@@ -227,27 +208,6 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
mLayoutHelper.setMoreSuggestionsHeight(remainingHeight);
}
- public boolean isShowingAddToDictionaryHint() {
- return mStripVisibilityGroup.isShowingAddToDictionaryStrip();
- }
-
- public void showAddToDictionaryHint(final String word, final boolean shouldShowWordToSave) {
- mLayoutHelper.layoutAddToDictionaryHint(word, mAddToDictionaryStrip, shouldShowWordToSave);
- // {@link TextView#setTag()} is used to hold the word to be added to dictionary. The word
- // will be extracted at {@link #onClick(View)}.
- mAddToDictionaryStrip.setTag(word);
- mAddToDictionaryStrip.setOnClickListener(this);
- mStripVisibilityGroup.showAddToDictionaryStrip();
- }
-
- public boolean dismissAddToDictionaryHint() {
- if (isShowingAddToDictionaryHint()) {
- clear();
- return true;
- }
- return false;
- }
-
// This method checks if we should show the important notice (checks on permanent storage if
// it has been shown once already or not, and if in the setup wizard). If applicable, it shows
// the notice. In all cases, it returns true if it was shown, false otherwise.
@@ -494,15 +454,8 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
false /* isKeyRepeat */);
return;
}
- final Object tag = view.getTag();
- // {@link String} tag is set at {@link #suggestAddingToDictionary(String,CharSequence)}.
- if (tag instanceof String) {
- final String wordToSave = (String)tag;
- mListener.addWordToUserDictionary(wordToSave);
- clear();
- return;
- }
+ final Object tag = view.getTag();
// {@link Integer} tag is set at
// {@link SuggestionStripLayoutHelper#setupWordViewsTextAndColor(SuggestedWords,int)} and
// {@link SuggestionStripLayoutHelper#layoutPunctuationSuggestions(SuggestedWords,ViewGroup}