Questions tagged [android-textinputlayout]

Layout which wraps an EditText (or descendant) to show a floating label when the hint is hidden due to the user inputting text.

Layout which wraps an EditText (or descendant) to show a floating label when the hint is hidden due to the user inputting text. Also supports showing an error via setErrorEnabled(boolean) and setError(CharSequence).

887 questions
15
votes
5 answers

Do not change TextInputLayout background on error

I would like to have an EditText with the background as a "normal" EditText but with the error handling of a TextInputEditText (error message appearing at the bottom, and not the "!" drawable appearing). I got something like this…
MHogge
  • 5,408
  • 15
  • 61
  • 104
15
votes
2 answers

AutoCompleteTextView float hint

I've tried a lot, but can't make work an AutoCompleteTextView float hint using the TextInputLayout from support. It's possible or I need to use an external library?
14
votes
3 answers

Multiple colors in TextField of Jetpack Compose

Is it possible to get different colors in a TextField of Jetpack Compose? Something like with the Text composable with AnnotatedString, but TextField doesn't allow AnnotatedString as input value. Image of normal Text composable with colors
14
votes
3 answers

Jetpack Compose: Disable Interaction with TextField

Is there a way to disable all interaction for Jetpack Compose's TextField?
14
votes
5 answers

Change TextInputEditText Hint Color

I want to change the text color of my TextInputEditText hint. It seems that no matter what I change, the color is always that of the primary app theme.
Otterman
  • 530
  • 2
  • 5
  • 16
14
votes
2 answers

How to apply global custom style to android.support.design.widget.TextInputEditText?

I have my AppTheme defined in style.xml where I apply a custom style globally for all my app's TextView, EditText, Button etc. Now I'd like to do the same for android.support.design.widget.TextInputEditText but how? It does not extend EditText so…
14
votes
10 answers

How to fix background red color TextInputLayout when isEmpty in Android

I want setError when TextInputLayout isEmpty, I write this code but when show error message, set red background for TextInputLayout! I do not want set background! I want just show the error message. My code: if (TextUtils.isEmpty(userName))…
user6761472
14
votes
6 answers

AppCompatEditText.getpParent() inside TextInputLayout returns FrameLayout

I am creating simple AppCompatEditText adding OnFocusChangeListener and putting it in the simple TextInputLayout. When AppCompatEditText loosing focus it's content should be validate by isValidParam method. It worked till yesterday, when I used…
13
votes
5 answers

How to get text from material design TextInputLayout correctly?

I want to get a text from the material design's TextInputLayout using a custom end Icon. I tried to do that: TextInputLayout textInputCustomEndIcon = findViewById(R.id.editText); final TextInputEditText editText = new…
13
votes
4 answers

How to change color of the password toggle in TextInputLayout?

I need to change color of the password toggle in TextInputLayout if EditText is focused or not. I've done it this way but it's not working. The color is always equals color light grey (from state focused = false) layout …
13
votes
2 answers

How to set different gravity for TextInputLayout's hint and text in Android

How to set different gravity for TextInputLayout's hint and text entered in edit text. I want to set the hint gravity to start and edit text's text gravity to center. So how can i achieve this. This is my xml code, …
13
votes
4 answers

OnClickListener in TextInputEditText wrapped around TextInputLayout

I have got a TextInputEditText wrapped around a TextInputLayout, as Google recommends to do: https://developer.android.com/reference/android/support/design/widget/TextInputLayout.html However, my TextInputEditText has an OnClickListener set on it so…
13
votes
2 answers

Floating label with two editText

I want to achieve Something like this. A floating label with two edit texts. I Used TextInputLayout and some other libraries too, but all accept only single child as EditText. Any help is appreciated. Both Edit Text must be focusable and the hint…
ADM
  • 20,406
  • 11
  • 52
  • 83
13
votes
2 answers

Error inflating class EditText on creating TextInputLayout on Android 4.4.2:

I using the TextInputLayout UI mechanism in my login page of the application, everything works great except for device that run the 4.4.2 android version on this devices I have an exception. This is my layout:
13
votes
4 answers

TextInputLayout EditText nextFocusRight not working as should

I have two TextInputLayout elements side by side: firstname and lastname. Below them I have another full width TextInputLayout element: email. I'm trying to overwrite the next button on the keyboard so that when clicking Next inside the firstname…
Karl Viiburg
  • 832
  • 10
  • 34