Loading core/java/android/widget/Editor.java +10 −11 Original line number Diff line number Diff line Loading @@ -3251,6 +3251,7 @@ public class Editor { private final SuggestionSpanInfo mMisspelledSpanInfo = new SuggestionSpanInfo(); private int mContainerMarginWidth; private int mContainerMarginTop; private LinearLayout mContainerView; private class CustomPopupWindow extends PopupWindow { @Override Loading Loading @@ -3288,20 +3289,19 @@ public class Editor { protected void initContentView() { final LayoutInflater inflater = (LayoutInflater) mTextView.getContext(). getSystemService(Context.LAYOUT_INFLATER_SERVICE); final ViewGroup relativeLayout = (ViewGroup) inflater.inflate( mContentView = (ViewGroup) inflater.inflate( mTextView.mTextEditSuggestionContainerLayout, null); final LinearLayout suggestionWindowContainer = (LinearLayout) relativeLayout.findViewById( mContainerView = (LinearLayout) mContentView.findViewById( com.android.internal.R.id.suggestionWindowContainer); ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) suggestionWindowContainer.getLayoutParams(); (ViewGroup.MarginLayoutParams) mContainerView.getLayoutParams(); mContainerMarginWidth = lp.leftMargin + lp.rightMargin; mContainerMarginTop = lp.topMargin; mClippingLimitLeft = lp.leftMargin; mClippingLimitRight = lp.rightMargin; mSuggestionListView = (ListView) relativeLayout.findViewById( mSuggestionListView = (ListView) mContentView.findViewById( com.android.internal.R.id.suggestionContainer); mSuggestionsAdapter = new SuggestionAdapter(); Loading @@ -3314,9 +3314,7 @@ public class Editor { mSuggestionInfos[i] = new SuggestionInfo(); } mContentView = relativeLayout; mAddToDictionaryButton = (TextView) relativeLayout.findViewById( mAddToDictionaryButton = (TextView) mContentView.findViewById( com.android.internal.R.id.addToDictionaryButton); mAddToDictionaryButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Loading Loading @@ -3349,7 +3347,7 @@ public class Editor { } }); mDeleteButton = (TextView) relativeLayout.findViewById( mDeleteButton = (TextView) mContentView.findViewById( com.android.internal.R.id.deleteButton); mDeleteButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Loading Loading @@ -3461,7 +3459,8 @@ public class Editor { mDeleteButton.measure(horizontalMeasure, verticalMeasure); width = Math.max(width, mDeleteButton.getMeasuredWidth()); width += mContainerMarginWidth; width += mContainerView.getPaddingLeft() + mContainerView.getPaddingRight() + mContainerMarginWidth; // Enforce the width based on actual text widths mContentView.measure( Loading core/res/res/layout/text_edit_suggestion_container.xml +1 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ android:layout_height="wrap_content"> <LinearLayout android:id="@+id/suggestionWindowContainer" android:layout_width="wrap_content" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:elevation="@android:dimen/text_edit_floating_toolbar_elevation" Loading core/res/res/layout/text_edit_suggestion_container_material.xml +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ android:layout_height="wrap_content"> <LinearLayout android:id="@+id/suggestionWindowContainer" android:layout_width="wrap_content" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?android:attr/floatingToolbarPopupBackgroundDrawable" android:elevation="@android:dimen/text_edit_floating_toolbar_elevation" Loading Loading
core/java/android/widget/Editor.java +10 −11 Original line number Diff line number Diff line Loading @@ -3251,6 +3251,7 @@ public class Editor { private final SuggestionSpanInfo mMisspelledSpanInfo = new SuggestionSpanInfo(); private int mContainerMarginWidth; private int mContainerMarginTop; private LinearLayout mContainerView; private class CustomPopupWindow extends PopupWindow { @Override Loading Loading @@ -3288,20 +3289,19 @@ public class Editor { protected void initContentView() { final LayoutInflater inflater = (LayoutInflater) mTextView.getContext(). getSystemService(Context.LAYOUT_INFLATER_SERVICE); final ViewGroup relativeLayout = (ViewGroup) inflater.inflate( mContentView = (ViewGroup) inflater.inflate( mTextView.mTextEditSuggestionContainerLayout, null); final LinearLayout suggestionWindowContainer = (LinearLayout) relativeLayout.findViewById( mContainerView = (LinearLayout) mContentView.findViewById( com.android.internal.R.id.suggestionWindowContainer); ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) suggestionWindowContainer.getLayoutParams(); (ViewGroup.MarginLayoutParams) mContainerView.getLayoutParams(); mContainerMarginWidth = lp.leftMargin + lp.rightMargin; mContainerMarginTop = lp.topMargin; mClippingLimitLeft = lp.leftMargin; mClippingLimitRight = lp.rightMargin; mSuggestionListView = (ListView) relativeLayout.findViewById( mSuggestionListView = (ListView) mContentView.findViewById( com.android.internal.R.id.suggestionContainer); mSuggestionsAdapter = new SuggestionAdapter(); Loading @@ -3314,9 +3314,7 @@ public class Editor { mSuggestionInfos[i] = new SuggestionInfo(); } mContentView = relativeLayout; mAddToDictionaryButton = (TextView) relativeLayout.findViewById( mAddToDictionaryButton = (TextView) mContentView.findViewById( com.android.internal.R.id.addToDictionaryButton); mAddToDictionaryButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Loading Loading @@ -3349,7 +3347,7 @@ public class Editor { } }); mDeleteButton = (TextView) relativeLayout.findViewById( mDeleteButton = (TextView) mContentView.findViewById( com.android.internal.R.id.deleteButton); mDeleteButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Loading Loading @@ -3461,7 +3459,8 @@ public class Editor { mDeleteButton.measure(horizontalMeasure, verticalMeasure); width = Math.max(width, mDeleteButton.getMeasuredWidth()); width += mContainerMarginWidth; width += mContainerView.getPaddingLeft() + mContainerView.getPaddingRight() + mContainerMarginWidth; // Enforce the width based on actual text widths mContentView.measure( Loading
core/res/res/layout/text_edit_suggestion_container.xml +1 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ android:layout_height="wrap_content"> <LinearLayout android:id="@+id/suggestionWindowContainer" android:layout_width="wrap_content" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:elevation="@android:dimen/text_edit_floating_toolbar_elevation" Loading
core/res/res/layout/text_edit_suggestion_container_material.xml +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ android:layout_height="wrap_content"> <LinearLayout android:id="@+id/suggestionWindowContainer" android:layout_width="wrap_content" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?android:attr/floatingToolbarPopupBackgroundDrawable" android:elevation="@android:dimen/text_edit_floating_toolbar_elevation" Loading