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:
committed by
Android (Google) Code Review
commit
2295cc77c7
@@ -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;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user