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] setting endIconMode makes hint disappear

See original GitHub issue

Description: To display my custom icon correctly on the right side (app:endIconDrawable="@drawable/ic_drop_down") - it is necessary to specify app:endIconMode="custom". However, adding this parameter entails a situation where the text from android:hint= is not shown for some reason.

Expected behavior: image

Source code:

<com.google.android.material.textfield.TextInputLayout
        android:layout_width="74dp"
        android:layout_height="wrap_content"
        app:endIconDrawable="@drawable/ic_drop_down"
        app:endIconMode="custom"
        app:endIconTint="@color/grey"
        app:expandedHintEnabled="false"
        app:hintAnimationEnabled="false"
        app:startIconDrawable="@drawable/ic_flag_loading"
        app:startIconTint="@null">
        <com.google.android.material.textfield.TextInputEditText
                android:clickable="false"
                android:cursorVisible="false"
                android:focusable="false"
                android:focusableInTouchMode="false"
                android:hint="Country"
                android:inputType="none" />
</com.google.android.material.textfield.TextInputLayout>

Android API version: 32

Material Library version: 1.4.0

Device: Redmi 9 (12.0.2) + emulator

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
drchencommented, May 2, 2022

Thanks for the sample app! I managed to reproduce it. A fix is on its way. : )

0reactions
ChekistNSKcommented, Mar 3, 2022

@hunterstich Hi 😃

Please confirm the fact that you also reproduce the situation with this bug when running the code, the link to which I sent you above.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disable/Remove floating label hint text in TextInputLayout XML
1 Set android:hint on TextInputLayout to a space _ character, ... it makes your hint gone perfectly in your textInputLayout, because if you...
Read more >
[TextInputLayout] "clear_text" end icon is visible for all fields ...
I found a workaround through BindingAdapters where every time I set a new text value to my EditText I immediately disappear the icon...
Read more >
TextInputLayout | Android Developers
Returns the text color used by the hint in both the collapsed and expanded states, or null if no color has been set....
Read more >
Material Design Edit Text | Android Studio Tutorial - YouTube
My Online Courses ⭐Discount Coupon: LAUNCH-STEVDZA-SANhttps://stevdza-san.com ‍ Wanna become a member?
Read more >
Text fields - Material Design
Text fields let users enter, edit, and select text.
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