material-components-android icon indicating copy to clipboard operation
material-components-android copied to clipboard

[TextField] disabling hint prevents custom `defaultHintTextColor`

Open farfromrefug opened this issue 1 year ago • 0 comments
trafficstars

Description: I want to have textfield with disabled floating hint but with custom hint color for when the textfield is empty.

Let say i have a textfield with floating hint enabled. I use setDefaultHintTextColor to change the hint color. It works and changes the color for expanded and collapsed.

Now i call setHintEnabled(false). The floating hint gets disabled (expanded) but i still see the hint collapsed when there is no text (which is what i want). However i loose the custom colors i set with setDefaultHintTextColor for when there is no text

Expected behavior: Screenshots and/or description of expected behavior The setDefaultHintTextColor to be preserved while using setHintEnabled(false)

Source code: The code snippet which is causing this issue

Minimal sample app repro: Please consider attaching a minimal sample app that reproduces the issue. This will help narrow down the conditions required for reproducing the issue, and it will speed up the bug fix process. You may attach a zip file of the sample app or link to a GitHub repo that contains the sample app.

Android API version: 13, 11, 10

Material Library version: 1.11.0 Device: Emulator/real devices

farfromrefug avatar Jan 10 '24 08:01 farfromrefug