Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4231461 authored by Fabrice Di Meglio's avatar Fabrice Di Meglio
Browse files

Fix bug #2246815 Error popups on EditText should span the width of the screen...

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

Part 2

- use "textview_error_popup_default_width" as a dimension resource instead of a basic constant

Change-Id: Ieb89fc416105716ab491749a82390a7e784b1755
parent 33438be0
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -4050,8 +4050,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        int wid = tv.getPaddingLeft() + tv.getPaddingRight();
        int ht = tv.getPaddingTop() + tv.getPaddingBottom();

        int defaultWidthInPixels = (int) (DEFAULT_ERROR_POPUP_MAX_WIDTH_IN_DP *
                getResources().getDisplayMetrics().density);
        int defaultWidthInPixels = getResources().getDimensionPixelSize(
                com.android.internal.R.dimen.textview_error_popup_default_width);
        Layout l = new StaticLayout(text, tv.getPaint(), defaultWidthInPixels,
                                    Layout.Alignment.ALIGN_NORMAL, 1, 0, true);
        float max = 0;
@@ -11417,6 +11417,4 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    private CorrectionHighlighter mCorrectionHighlighter;
    // 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 DEFAULT_ERROR_POPUP_MAX_WIDTH_IN_DP = 240;
}
+3 −0
Original line number Diff line number Diff line
@@ -175,4 +175,7 @@
    <!-- Width of the icon in a dropdown list -->
    <dimen name="dropdownitem_icon_width">32dip</dimen>

    <!-- Default width for a textview error popup -->
    <dimen name="textview_error_popup_default_width">240dip</dimen>

</resources>