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

Commit 675aa8d1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Set upper-limit for the single line edit text." into rvc-qpr-dev am: 00440b4a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12122216

Change-Id: Ic16b4cd03eeb7e476c5dff095fd837570d7842e7
parents c3f6e77b 00440b4a
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -395,6 +395,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    private static final int EMS = LINES;
    private static final int EMS = LINES;
    private static final int PIXELS = 2;
    private static final int PIXELS = 2;
    // Maximum text length for single line input.
    private static final int MAX_LENGTH_FOR_SINGLE_LINE_EDIT_TEXT = 5000;
    private static final RectF TEMP_RECTF = new RectF();
    private static final RectF TEMP_RECTF = new RectF();
    /** @hide */
    /** @hide */
@@ -1633,6 +1636,12 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            setTransformationMethod(PasswordTransformationMethod.getInstance());
            setTransformationMethod(PasswordTransformationMethod.getInstance());
        }
        }
        // For addressing b/145128646
        // For the performance reason, we limit characters for single line text field.
        if (bufferType == BufferType.EDITABLE && singleLine && maxlength == -1) {
            maxlength = MAX_LENGTH_FOR_SINGLE_LINE_EDIT_TEXT;
        }
        if (maxlength >= 0) {
        if (maxlength >= 0) {
            setFilters(new InputFilter[] { new InputFilter.LengthFilter(maxlength) });
            setFilters(new InputFilter[] { new InputFilter.LengthFilter(maxlength) });
        } else {
        } else {
+6 −1
Original line number Original line Diff line number Diff line
@@ -1259,7 +1259,12 @@
        <!-- Can be combined with <var>text</var> and its variations to
        <!-- Can be combined with <var>text</var> and its variations to
             allow multiple lines of text in the field.  If this flag is not set,
             allow multiple lines of text in the field.  If this flag is not set,
             the text field will be constrained to a single line.  Corresponds to
             the text field will be constrained to a single line.  Corresponds to
             {@link android.text.InputType#TYPE_TEXT_FLAG_MULTI_LINE}. -->
             {@link android.text.InputType#TYPE_TEXT_FLAG_MULTI_LINE}.

             Note: If this flag is not set and the text field doesn't have max length limit, the
             framework automatically set maximum length of the characters to 5000 for the
             performance reasons.
             -->
        <flag name="textMultiLine" value="0x00020001" />
        <flag name="textMultiLine" value="0x00020001" />
        <!-- Can be combined with <var>text</var> and its variations to
        <!-- Can be combined with <var>text</var> and its variations to
             indicate that though the regular text view should not be multiple
             indicate that though the regular text view should not be multiple