diff options
author | John Reck <jreck@android.com> | 2014-04-09 22:13:18 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-04-09 22:13:18 +0000 |
commit | e3a17b64b3d030bbe0ba904a3353d4d68349877e (patch) | |
tree | 299d4b8b780dc5da1a2cc1c2c1158c867d78754d /src/com | |
parent | 47f40f31d445a61b37b57cfd56425353b4fec37d (diff) | |
parent | 2ccf5cdc72cfb0511b850cbea7d7de062db9a3af (diff) | |
download | packages_apps_Browser-e3a17b64b3d030bbe0ba904a3353d4d68349877e.zip packages_apps_Browser-e3a17b64b3d030bbe0ba904a3353d4d68349877e.tar.gz packages_apps_Browser-e3a17b64b3d030bbe0ba904a3353d4d68349877e.tar.bz2 |
am 2ccf5cdc: am f4abb38e: Merge "Fix the problem that the layout of the suggestion drop down list does not fit to the screen width when an orientation changes."
* commit '2ccf5cdc72cfb0511b850cbea7d7de062db9a3af':
Fix the problem that the layout of the suggestion drop down list does not fit to the screen width when an orientation changes.
Diffstat (limited to 'src/com')
-rwxr-xr-x[-rw-r--r--] | src/com/android/browser/UrlInputView.java | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/src/com/android/browser/UrlInputView.java b/src/com/android/browser/UrlInputView.java index 02bba3c..b310ba1 100644..100755 --- a/src/com/android/browser/UrlInputView.java +++ b/src/com/android/browser/UrlInputView.java @@ -76,18 +76,9 @@ public class UrlInputView extends AutoCompleteTextView private int mState; private StateListener mStateListener; - private Rect mPopupPadding; public UrlInputView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); - TypedArray a = context.obtainStyledAttributes( - attrs, com.android.internal.R.styleable.PopupWindow, - R.attr.autoCompleteTextViewStyle, 0); - - Drawable popupbg = a.getDrawable(R.styleable.PopupWindow_popupBackground); - a.recycle(); - mPopupPadding = new Rect(); - popupbg.getPadding(mPopupPadding); init(context); } @@ -110,7 +101,7 @@ public class UrlInputView extends AutoCompleteTextView setOnItemClickListener(this); mNeedsUpdate = false; addTextChangedListener(this); - + setDropDownAnchor(com.android.browser.R.id.taburlbar); mState = StateListener.STATE_NORMAL; } @@ -201,36 +192,18 @@ public class UrlInputView extends AutoCompleteTextView Configuration.ORIENTATION_LANDSCAPE) != 0; mAdapter.setLandscapeMode(mLandscape); if (isPopupShowing() && (getVisibility() == View.VISIBLE)) { - setupDropDown(); + dismissDropDown(); + showDropDown(); performFiltering(getText(), 0); } } @Override - public void showDropDown() { - setupDropDown(); - super.showDropDown(); - } - - @Override public void dismissDropDown() { super.dismissDropDown(); mAdapter.clearCache(); } - private void setupDropDown() { - int width = mContainer != null ? mContainer.getWidth() : getWidth(); - width += mPopupPadding.left + mPopupPadding.right; - if (width != getDropDownWidth()) { - setDropDownWidth(width); - } - int left = getLeft(); - left += mPopupPadding.left; - if (left != -getDropDownHorizontalOffset()) { - setDropDownHorizontalOffset(-left); - } - } - @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { finishInput(getText().toString(), null, TYPED); |