Remove unused suggestion preview stuffs
Change-Id: Ida5668f4eba1783d96e02001a64ae713f98176b7main
parent
b6e398a71d
commit
12939572f3
Binary file not shown.
Before Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.6 KiB |
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
**
|
||||
** Copyright 2011, The Android Open Source Project
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
*/
|
||||
-->
|
||||
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18dp"
|
||||
android:textColor="?android:attr/textColorPrimaryInverse"
|
||||
android:minWidth="32dp"
|
||||
android:gravity="center"
|
||||
style="?attr/suggestionPreviewBackgroundStyle" />
|
|
@ -32,7 +32,6 @@
|
|||
<attr name="suggestionStripViewStyle" format="reference" />
|
||||
<attr name="moreSuggestionsViewStyle" format="reference" />
|
||||
<attr name="suggestionBackgroundStyle" format="reference" />
|
||||
<attr name="suggestionPreviewBackgroundStyle" format="reference" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="KeyboardView">
|
||||
|
|
|
@ -162,9 +162,6 @@
|
|||
<style name="SuggestionBackgroundStyle">
|
||||
<item name="android:background">@drawable/btn_suggestion</item>
|
||||
</style>
|
||||
<style name="SuggestionPreviewBackgroundStyle">
|
||||
<item name="android:background">@drawable/suggestion_feedback_background</item>
|
||||
</style>
|
||||
<!-- Theme "Basic high contrast" -->
|
||||
<style
|
||||
name="Keyboard.HighContrast"
|
||||
|
|
|
@ -26,6 +26,5 @@
|
|||
<item name="suggestionStripViewStyle">@style/SuggestionStripViewStyle</item>
|
||||
<item name="moreSuggestionsViewStyle">@style/MoreSuggestionsViewStyle</item>
|
||||
<item name="suggestionBackgroundStyle">@style/SuggestionBackgroundStyle</item>
|
||||
<item name="suggestionPreviewBackgroundStyle">@style/SuggestionPreviewBackgroundStyle</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
@ -26,6 +26,5 @@
|
|||
<item name="suggestionStripViewStyle">@style/SuggestionStripViewStyle</item>
|
||||
<item name="moreSuggestionsViewStyle">@style/MoreSuggestionsViewStyle</item>
|
||||
<item name="suggestionBackgroundStyle">@style/SuggestionBackgroundStyle</item>
|
||||
<item name="suggestionPreviewBackgroundStyle">@style/SuggestionPreviewBackgroundStyle</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
@ -26,6 +26,5 @@
|
|||
<item name="suggestionStripViewStyle">@style/SuggestionStripViewStyle</item>
|
||||
<item name="moreSuggestionsViewStyle">@style/MoreSuggestionsViewStyle</item>
|
||||
<item name="suggestionBackgroundStyle">@style/SuggestionBackgroundStyle</item>
|
||||
<item name="suggestionPreviewBackgroundStyle">@style/SuggestionPreviewBackgroundStyle</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
@ -26,6 +26,5 @@
|
|||
<item name="suggestionStripViewStyle">@style/SuggestionStripViewStyle.IceCreamSandwich</item>
|
||||
<item name="moreSuggestionsViewStyle">@style/MoreSuggestionsViewStyle.IceCreamSandwich</item>
|
||||
<item name="suggestionBackgroundStyle">@style/SuggestionBackgroundStyle.IceCreamSandwich</item>
|
||||
<item name="suggestionPreviewBackgroundStyle">@style/SuggestionPreviewBackgroundStyle.IceCreamSandwich</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
@ -26,6 +26,5 @@
|
|||
<item name="suggestionStripViewStyle">@style/SuggestionStripViewStyle</item>
|
||||
<item name="moreSuggestionsViewStyle">@style/MoreSuggestionsViewStyle</item>
|
||||
<item name="suggestionBackgroundStyle">@style/SuggestionBackgroundStyle</item>
|
||||
<item name="suggestionPreviewBackgroundStyle">@style/SuggestionPreviewBackgroundStyle</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
@ -26,6 +26,5 @@
|
|||
<item name="suggestionStripViewStyle">@style/SuggestionStripViewStyle</item>
|
||||
<item name="moreSuggestionsViewStyle">@style/MoreSuggestionsViewStyle</item>
|
||||
<item name="suggestionBackgroundStyle">@style/SuggestionBackgroundStyle</item>
|
||||
<item name="suggestionPreviewBackgroundStyle">@style/SuggestionPreviewBackgroundStyle</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
@ -28,7 +28,6 @@ import android.graphics.Rect;
|
|||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Message;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
|
@ -47,7 +46,6 @@ import android.view.View.OnClickListener;
|
|||
import android.view.View.OnLongClickListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.PopupWindow;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
@ -64,7 +62,6 @@ import com.android.inputmethod.latin.Constants;
|
|||
import com.android.inputmethod.latin.LatinImeLogger;
|
||||
import com.android.inputmethod.latin.R;
|
||||
import com.android.inputmethod.latin.ResourceUtils;
|
||||
import com.android.inputmethod.latin.StaticInnerHandlerWrapper;
|
||||
import com.android.inputmethod.latin.SuggestedWords;
|
||||
import com.android.inputmethod.latin.Utils;
|
||||
import com.android.inputmethod.latin.define.ProductionFlag;
|
||||
|
@ -95,43 +92,12 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
|
|||
private final ArrayList<TextView> mInfos = CollectionUtils.newArrayList();
|
||||
private final ArrayList<View> mDividers = CollectionUtils.newArrayList();
|
||||
|
||||
private final PopupWindow mPreviewPopup;
|
||||
private final TextView mPreviewText;
|
||||
|
||||
Listener mListener;
|
||||
SuggestedWords mSuggestedWords = SuggestedWords.EMPTY;
|
||||
|
||||
private final SuggestionStripViewParams mParams;
|
||||
private static final float MIN_TEXT_XSCALE = 0.70f;
|
||||
|
||||
private final UiHandler mHandler = new UiHandler(this);
|
||||
|
||||
private static final class UiHandler extends StaticInnerHandlerWrapper<SuggestionStripView> {
|
||||
private static final int MSG_HIDE_PREVIEW = 0;
|
||||
|
||||
public UiHandler(final SuggestionStripView outerInstance) {
|
||||
super(outerInstance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispatchMessage(final Message msg) {
|
||||
final SuggestionStripView suggestionStripView = getOuterInstance();
|
||||
switch (msg.what) {
|
||||
case MSG_HIDE_PREVIEW:
|
||||
suggestionStripView.hidePreview();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void cancelHidePreview() {
|
||||
removeMessages(MSG_HIDE_PREVIEW);
|
||||
}
|
||||
|
||||
public void cancelAllMessages() {
|
||||
cancelHidePreview();
|
||||
}
|
||||
}
|
||||
|
||||
private static final class SuggestionStripViewParams {
|
||||
private static final int DEFAULT_SUGGESTIONS_COUNT_IN_STRIP = 3;
|
||||
private static final float DEFAULT_CENTER_SUGGESTION_PERCENTILE = 0.40f;
|
||||
|
@ -610,13 +576,6 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
|
|||
final LayoutInflater inflater = LayoutInflater.from(context);
|
||||
inflater.inflate(R.layout.suggestions_strip, this);
|
||||
|
||||
mPreviewPopup = new PopupWindow(context);
|
||||
mPreviewText = (TextView) inflater.inflate(R.layout.suggestion_preview, null);
|
||||
mPreviewPopup.setWindowLayoutMode(
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
mPreviewPopup.setContentView(mPreviewText);
|
||||
mPreviewPopup.setBackgroundDrawable(null);
|
||||
|
||||
mSuggestionsStrip = (ViewGroup)findViewById(R.id.suggestions_strip);
|
||||
for (int pos = 0; pos < MAX_SUGGESTIONS; pos++) {
|
||||
final TextView word = (TextView)inflater.inflate(R.layout.suggestion_word, null);
|
||||
|
@ -697,10 +656,6 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
|
|||
dismissMoreSuggestions();
|
||||
}
|
||||
|
||||
void hidePreview() {
|
||||
mPreviewPopup.dismiss();
|
||||
}
|
||||
|
||||
private final KeyboardActionListener mMoreSuggestionsListener =
|
||||
new KeyboardActionListener.Adapter() {
|
||||
@Override
|
||||
|
@ -863,8 +818,6 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
|
|||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
mHandler.cancelAllMessages();
|
||||
hidePreview();
|
||||
dismissMoreSuggestions();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue