TextInputLayout: If text length reached maximum and error appears on clear one symbol action the counter of...
up vote
0
down vote
favorite
<android.support.design.widget.TextInputLayout
android:id="@+id/tilTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
app:counterEnabled="true"
app:counterMaxLength="32"
app:errorEnabled="true"
app:helperTextEnabled="true"
app:helperText="@string/enter_title">
<EditText
android:id="@+id/etTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/title"
android:imeOptions="actionNext"
android:maxLines="2"
android:drawablePadding="@dimen/chat_general_margin"
android:drawableEnd="@drawable/ic_remove_channel"
android:textCursorDrawable="@drawable/cursor"/>
</android.support.design.widget.TextInputLayout>
CounterMaxLength is 32. There is no error on max textlength = 32. The error appears on 33rd symbol, but new symbol, 33rd one, is not showed (so we have 32 symbols still), but the counter shows 33. On the last symbol clear it shows 2 symbols less - from 33 to 31.
Any settings to fix? Is this behaviour described in docs?
I am not looking for workarounds rather for more accurate settings for TextInputLayout component. Thank you
android-xml android-textinputlayout androidx material-components-android
add a comment |
up vote
0
down vote
favorite
<android.support.design.widget.TextInputLayout
android:id="@+id/tilTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
app:counterEnabled="true"
app:counterMaxLength="32"
app:errorEnabled="true"
app:helperTextEnabled="true"
app:helperText="@string/enter_title">
<EditText
android:id="@+id/etTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/title"
android:imeOptions="actionNext"
android:maxLines="2"
android:drawablePadding="@dimen/chat_general_margin"
android:drawableEnd="@drawable/ic_remove_channel"
android:textCursorDrawable="@drawable/cursor"/>
</android.support.design.widget.TextInputLayout>
CounterMaxLength is 32. There is no error on max textlength = 32. The error appears on 33rd symbol, but new symbol, 33rd one, is not showed (so we have 32 symbols still), but the counter shows 33. On the last symbol clear it shows 2 symbols less - from 33 to 31.
Any settings to fix? Is this behaviour described in docs?
I am not looking for workarounds rather for more accurate settings for TextInputLayout component. Thank you
android-xml android-textinputlayout androidx material-components-android
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
<android.support.design.widget.TextInputLayout
android:id="@+id/tilTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
app:counterEnabled="true"
app:counterMaxLength="32"
app:errorEnabled="true"
app:helperTextEnabled="true"
app:helperText="@string/enter_title">
<EditText
android:id="@+id/etTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/title"
android:imeOptions="actionNext"
android:maxLines="2"
android:drawablePadding="@dimen/chat_general_margin"
android:drawableEnd="@drawable/ic_remove_channel"
android:textCursorDrawable="@drawable/cursor"/>
</android.support.design.widget.TextInputLayout>
CounterMaxLength is 32. There is no error on max textlength = 32. The error appears on 33rd symbol, but new symbol, 33rd one, is not showed (so we have 32 symbols still), but the counter shows 33. On the last symbol clear it shows 2 symbols less - from 33 to 31.
Any settings to fix? Is this behaviour described in docs?
I am not looking for workarounds rather for more accurate settings for TextInputLayout component. Thank you
android-xml android-textinputlayout androidx material-components-android
<android.support.design.widget.TextInputLayout
android:id="@+id/tilTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
app:counterEnabled="true"
app:counterMaxLength="32"
app:errorEnabled="true"
app:helperTextEnabled="true"
app:helperText="@string/enter_title">
<EditText
android:id="@+id/etTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/title"
android:imeOptions="actionNext"
android:maxLines="2"
android:drawablePadding="@dimen/chat_general_margin"
android:drawableEnd="@drawable/ic_remove_channel"
android:textCursorDrawable="@drawable/cursor"/>
</android.support.design.widget.TextInputLayout>
CounterMaxLength is 32. There is no error on max textlength = 32. The error appears on 33rd symbol, but new symbol, 33rd one, is not showed (so we have 32 symbols still), but the counter shows 33. On the last symbol clear it shows 2 symbols less - from 33 to 31.
Any settings to fix? Is this behaviour described in docs?
I am not looking for workarounds rather for more accurate settings for TextInputLayout component. Thank you
<android.support.design.widget.TextInputLayout
android:id="@+id/tilTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
app:counterEnabled="true"
app:counterMaxLength="32"
app:errorEnabled="true"
app:helperTextEnabled="true"
app:helperText="@string/enter_title">
<EditText
android:id="@+id/etTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/title"
android:imeOptions="actionNext"
android:maxLines="2"
android:drawablePadding="@dimen/chat_general_margin"
android:drawableEnd="@drawable/ic_remove_channel"
android:textCursorDrawable="@drawable/cursor"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/tilTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
app:counterEnabled="true"
app:counterMaxLength="32"
app:errorEnabled="true"
app:helperTextEnabled="true"
app:helperText="@string/enter_title">
<EditText
android:id="@+id/etTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/title"
android:imeOptions="actionNext"
android:maxLines="2"
android:drawablePadding="@dimen/chat_general_margin"
android:drawableEnd="@drawable/ic_remove_channel"
android:textCursorDrawable="@drawable/cursor"/>
</android.support.design.widget.TextInputLayout>
android-xml android-textinputlayout androidx material-components-android
android-xml android-textinputlayout androidx material-components-android
asked Nov 22 at 14:38
anna_manzhula
869
869
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53433265%2ftextinputlayout-if-text-length-reached-maximum-and-error-appears-on-clear-one-s%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown