Merge "Fix bug #2246815 Error popups on EditText should span the width of the screen instead of the width of the EditText field"

This commit is contained in:
Fabrice Di Meglio
2011-09-08 18:27:29 -07:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 4 deletions

View File

@@ -4050,8 +4050,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
int wid = tv.getPaddingLeft() + tv.getPaddingRight(); int wid = tv.getPaddingLeft() + tv.getPaddingRight();
int ht = tv.getPaddingTop() + tv.getPaddingBottom(); int ht = tv.getPaddingTop() + tv.getPaddingBottom();
int defaultWidthInPixels = (int) (DEFAULT_ERROR_POPUP_MAX_WIDTH_IN_DP * int defaultWidthInPixels = getResources().getDimensionPixelSize(
getResources().getDisplayMetrics().density); com.android.internal.R.dimen.textview_error_popup_default_width);
Layout l = new StaticLayout(text, tv.getPaint(), defaultWidthInPixels, Layout l = new StaticLayout(text, tv.getPaint(), defaultWidthInPixels,
Layout.Alignment.ALIGN_NORMAL, 1, 0, true); Layout.Alignment.ALIGN_NORMAL, 1, 0, true);
float max = 0; float max = 0;
@@ -11441,6 +11441,4 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
private CorrectionHighlighter mCorrectionHighlighter; private CorrectionHighlighter mCorrectionHighlighter;
// New state used to change background based on whether this TextView is multiline. // New state used to change background based on whether this TextView is multiline.
private static final int[] MULTILINE_STATE_SET = { R.attr.state_multiline }; private static final int[] MULTILINE_STATE_SET = { R.attr.state_multiline };
private static final int DEFAULT_ERROR_POPUP_MAX_WIDTH_IN_DP = 240;
} }

View File

@@ -175,4 +175,7 @@
<!-- Width of the icon in a dropdown list --> <!-- Width of the icon in a dropdown list -->
<dimen name="dropdownitem_icon_width">32dip</dimen> <dimen name="dropdownitem_icon_width">32dip</dimen>
<!-- Default width for a textview error popup -->
<dimen name="textview_error_popup_default_width">240dip</dimen>
</resources> </resources>