diff options
| author | Clara Bayarri <clarabayarri@google.com> | 2015-03-24 16:01:02 +0000 |
|---|---|---|
| committer | Clara Bayarri <clarabayarri@google.com> | 2015-03-24 16:01:02 +0000 |
| commit | 08fe91875382dbd952fcf540610e642c40085b4d (patch) | |
| tree | 7ef4f95968e789bfcb1666d2722a40e195886fcc | |
| parent | a7b212d9f10bb4f2b7fb2f926587f6e904a85579 (diff) | |
| download | frameworks_base-08fe91875382dbd952fcf540610e642c40085b4d.zip frameworks_base-08fe91875382dbd952fcf540610e642c40085b4d.tar.gz frameworks_base-08fe91875382dbd952fcf540610e642c40085b4d.tar.bz2 | |
Editor: Cleanup the unused ActionPopupWindow
This is unused since we removed the paste popup
Change-Id: Id609d43a9f9f9bc31b2f40286ca1fe88773ad1dd
| -rw-r--r-- | core/java/android/widget/Editor.java | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index 3fca463..789fe65 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -3066,97 +3066,6 @@ public class Editor { showSuggestions(); } - private class ActionPopupWindow extends PinnedPopupWindow implements OnClickListener { - private static final int POPUP_TEXT_LAYOUT = - com.android.internal.R.layout.text_edit_action_popup_text; - private TextView mPasteTextView; - private TextView mReplaceTextView; - - @Override - protected void createPopupWindow() { - mPopupWindow = new PopupWindow(mTextView.getContext(), null, - com.android.internal.R.attr.textSelectHandleWindowStyle); - mPopupWindow.setClippingEnabled(true); - } - - @Override - protected void initContentView() { - LinearLayout linearLayout = new LinearLayout(mTextView.getContext()); - linearLayout.setOrientation(LinearLayout.HORIZONTAL); - mContentView = linearLayout; - mContentView.setBackgroundResource( - com.android.internal.R.drawable.text_edit_paste_window); - - LayoutInflater inflater = (LayoutInflater) mTextView.getContext(). - getSystemService(Context.LAYOUT_INFLATER_SERVICE); - - LayoutParams wrapContent = new LayoutParams( - ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); - - mPasteTextView = (TextView) inflater.inflate(POPUP_TEXT_LAYOUT, null); - mPasteTextView.setLayoutParams(wrapContent); - mContentView.addView(mPasteTextView); - mPasteTextView.setText(com.android.internal.R.string.paste); - mPasteTextView.setOnClickListener(this); - - mReplaceTextView = (TextView) inflater.inflate(POPUP_TEXT_LAYOUT, null); - mReplaceTextView.setLayoutParams(wrapContent); - mContentView.addView(mReplaceTextView); - mReplaceTextView.setText(com.android.internal.R.string.replace); - mReplaceTextView.setOnClickListener(this); - } - - @Override - public void show() { - boolean canPaste = mTextView.canPaste(); - boolean canSuggest = mTextView.isSuggestionsEnabled() && isCursorInsideSuggestionSpan(); - mPasteTextView.setVisibility(canPaste ? View.VISIBLE : View.GONE); - mReplaceTextView.setVisibility(canSuggest ? View.VISIBLE : View.GONE); - - if (!canPaste && !canSuggest) return; - - super.show(); - } - - @Override - public void onClick(View view) { - if (view == mPasteTextView && mTextView.canPaste()) { - mTextView.onTextContextMenuItem(TextView.ID_PASTE); - hide(); - } else if (view == mReplaceTextView) { - onReplace(); - } - } - - @Override - protected int getTextOffset() { - return (mTextView.getSelectionStart() + mTextView.getSelectionEnd()) / 2; - } - - @Override - protected int getVerticalLocalPosition(int line) { - return mTextView.getLayout().getLineTop(line) - mContentView.getMeasuredHeight(); - } - - @Override - protected int clipVertically(int positionY) { - if (positionY < 0) { - final int offset = getTextOffset(); - final Layout layout = mTextView.getLayout(); - final int line = layout.getLineForOffset(offset); - positionY += layout.getLineBottom(line) - layout.getLineTop(line); - positionY += mContentView.getMeasuredHeight(); - - // Assumes insertion and selection handles share the same height - final Drawable handle = mTextView.getContext().getDrawable( - mTextView.mTextSelectHandleRes); - positionY += handle.getIntrinsicHeight(); - } - - return positionY; - } - } - /** * A listener to call {@link InputMethodManager#updateCursorAnchorInfo(View, CursorAnchorInfo)} * while the input method is requesting the cursor/anchor position. Does nothing as long as @@ -4065,7 +3974,6 @@ public class Editor { } class SelectionModifierCursorController implements CursorController { - private static final int DELAY_BEFORE_REPLACE_ACTION = 200; // milliseconds // The cursor controller handles, lazily created when shown. private SelectionStartHandleView mStartHandle; private SelectionEndHandleView mEndHandle; |
