question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[TextInputLayout] Some attributes doesn't work

See original GitHub issue

Description: Some attributes of TextInputLayout doesn’t work about ‘error’.

I find issue about here attributes. app:boxStrokeErrorColor="@color/errorStroke" app:errorIconTint="@color/errorIconTint"

It dosen’t work well. Is there anything else I can do to use these attributes?

Expected behavior: I think it have to change Error icon color, and stroke color when error occured.

Source code: The code snippet which is causing this issue. Please consider attaching a minimal sample app that reproduces the issue.

Android API version: 28

Material Library version: 1.2.0-alpha06

Device: All device

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
upseliseevcommented, Jan 13, 2021

I’m running into a similar error as OP on 1.3.0-beta01. I’m setting the boxStrokeErrorColor through a style though.

0reactions
natansaldacommented, Feb 13, 2022

boxStrokeErrorColor attribute not working on material 1.5.0 for me either. I have this in my styles:

    <style name="RegistrationInputLayout" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox">
        <item name="boxCornerRadiusBottomStart">10dp</item>
        <item name="boxCornerRadiusBottomEnd">10dp</item>
        <item name="boxCornerRadiusTopStart">10dp</item>
        <item name="boxCornerRadiusTopEnd">10dp</item>
        <item name="boxStrokeColor">@color/registration_input_color</item>
        <item name="boxStrokeErrorColor">@color/registration_input_error_color</item>
        <item name="hintTextColor">@color/registration_input_color</item>
    </style>

I would expect the outline to go red when error is displayed, but instead it stays the same color as usual: Screenshot 2022-02-13 at 11 28 12

While what I would expect is this in error state: Screenshot 2022-02-13 at 11 29 37

Maybe I am missing something?

Read more comments on GitHub >

github_iconTop Results From Across the Web

TextInputLayout is not working when I set OutlinedBox in style
First, read the official docx properly. You're using EditText instead of TextInputEditText , also when using TextInputLayout , properties like ...
Read more >
TextInputLayout | Android Developers
Returns whether any hint state changes, due to being focused or non-empty text, are animated. Related XML Attributes:.
Read more >
TextInputLayout doesn't support RTL hints [37055931]
Hi Chris, It seems that the fix works for activities, but if the login text inputs are inside of a fragment that's on...
Read more >
Android TextInputLayout Example | DigitalOcean
Floating Hints are enabled by default in a TextInputLayout. To disable it we need to add the following attribute inside the tag :...
Read more >
Replacing EditTexts with TextInputLayouts in Android
Step 5: Adding hint attribute into TextInputEditText · <?xml version="1.0" encoding="utf-8"?> · <androidx.constraintlayout.widget.ConstraintLayout ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found