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
33
votes
10 answers

There is always a default background on TextInputLayout in Android

I have TextInputLayout and TextInputEditText like this
32
votes
9 answers

Removing TextInputLayout extra top padding

TextInputLayout seems to always have some extra padding at the top (no matter that all margins/paddings are set to 0): The layout looks like:
0leg
  • 13,464
  • 16
  • 70
  • 94
31
votes
8 answers

Making textinputlayout uneditable and setting click event on it

I want to make textinputlayout uneditable by user and when user click on it i want to perform an action. I added android:focusable="false" inside edittext of textinputlayout to make it uneditable but now when i click on it it is not getting callback…
31
votes
8 answers

TextInputLayout and EditText double hint issue

I want to set the hint with java in EditText(which is in TextInputLayout). Code used for setting hint: aET = (EditText) findViewById(R.id.aET); aET.setHint("h?"); But even when edittext is focused, Hint is displayed twice(inside edittext…
30
votes
6 answers

How to change the outline color of OutlinedTextField from jetpack compose?

Here is how OutlinedTextField code looks like in jetpack-compose: OutlinedTextField( value = "", onValueChange = {}, label = {Text("Input")} ) The default color of the outline of this TextField is purple. I want to change the outline…
30
votes
2 answers

Remove bottom line from TextInputEditText

I need to remove the bottom line of TextInputEditText I set background to transparent and null but nothing is working.
27
votes
2 answers

Why attribute app:endIconMode is not found in TextInputLayout?

Hello I am creating an app with the androidx libraries but when I am trying to add a toggle to show or hide the password in an TextInputEditText with the app:endIconMode attribute I am getting the error error: attribute endIconMode not found. This…
acabezas
  • 731
  • 1
  • 7
  • 20
26
votes
1 answer

How to change TextField's highlighted text color on Jetpack Compose?

In currently transitioning my app to Jetpack compose and I'm facing some problems to adapt my current color palette in some cases. I have some TextInputLayout on my xml files that inherit the highlight text color from SECUNDARY color on my…
24
votes
5 answers

Keep TextInputLayout always focused or keep label always expanded

I was wondering if it's possible to always keep the label expanded regardless of whether or not there is text in the EditText. I looked around in the source and it is a using a ValueAnimator and a counter inside a TextWatcher to animate or not…
AndyRoid
  • 5,062
  • 8
  • 38
  • 73
23
votes
2 answers

TextInputLayout: RuntimeException - Failed to resolve attribute at index 24

I keep on getting this error when I try to setErrorEnabled on my textInputLayout : 03-12 12:29:03.206 5706-5706/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.myapp, PID: 5706 …
Simon
  • 19,658
  • 27
  • 149
  • 217
22
votes
8 answers

Programmatically set TextInputLayout Hint Text Color and Floating Label Color

I use a TextInputLayout, I would want to programmatically set the hint text color and the floating label color if the input field is mandatory. Before moving to TextInputLayout I used to set the hint text color programmatically using the…
S.A.Norton Stanley
  • 1,833
  • 3
  • 23
  • 37
22
votes
7 answers

Show Helper text below EditText along with the Hint

I am trying to make something on these lines: I am able to show the hint using android:hint="Email Address" but unable to show the helper text - This will be your email username
22
votes
12 answers

TextInputLayout error after enter value into edittext

How can i hide a TextInputLayout error after input one text in EditText. Is it possible? how can i achieve this or I am doing something wrong here.!! code layoutEdtPhone =(TextInputLayout)rootView.findViewById(R.id.layoutEdtPhone); …
Kishore Jethava
  • 6,666
  • 5
  • 35
  • 51
21
votes
11 answers

Center hint and EditText vertically in TextInputLayout

I am using a TextInputLayout to show a hint but I am not able to center it vertically. I always get this: And I would like to center the hint vertically when there is no text in the EditText / TextInputEditText. I have tried the basic ideas…
1 2
3
59 60