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
12
votes
2 answers

TextInputLayout not showing when View added programmatically

I noticed some strange behaviour of TextInputLayout: When I add the following to my layout:
fweigl
  • 21,278
  • 20
  • 114
  • 205
12
votes
1 answer

How do you reduce space between floating editText hint and editText box in Android?

I have an EditText with a floating hint but I was wondering how I would reduce the space between the floating hint and the EditText box. Right now my UI looks like https://i.stack.imgur.com/ltfra.jpg and I want to reduce the space between the…
11
votes
4 answers

Change TextInputLayout focused & unfocused hint color programmatically

I wanted to change the color of hint in TEXT INPUT LAYOUT same when it is in focused or unfocused state.i have two TEXT INPUT LAYOUT fields.Both fields are same color.But it in focused state color appears but in an unfocused state the default grey…
11
votes
10 answers

Visible password with TextInputLayouts passwordToggleEnabled

I am using a TextInputLayout with the new function from the Support Library: passwordToggleEnabled. This gives a nice "eye"-icon that lets the user toggle password visibility on and off. My question is if there is a way to use this functionality…
Gober
  • 3,632
  • 3
  • 26
  • 33
11
votes
1 answer

Can I setup app global custom styles for android-support-design widgets?

I would like to define custom styles for some widgets from Android Support Design (like AppBarLayout, TextInputLayout, FAB...) and set up these styles as default for my project, as I can do with EditText and other system widgets. For exemple:
11
votes
3 answers

TextInputLayout setErrorEnabled doesn't create new TextView object

I've found an issue while creating a login form. I show some errors on my TextInputLayout and disable them, when the user filled in something correctly. I set it with mTextInputLayout.setError("This field is required"); and disable it with…
dabo248
  • 3,367
  • 4
  • 27
  • 37
11
votes
3 answers

Error inflating TextInputLayout when used with ViewPager

Looks like TextInputLayout just doesn't work inside ViewPager. The error is: Error inflating class android.support.design.widget.TextInputLayout Appcompat and Design library added. Theme is correct. I use PageAdapter to inflate and populate…
Eugene
  • 59,186
  • 91
  • 226
  • 333
10
votes
3 answers

Change the radius of the border for OutlinedTextField

Is it possible to change the radius of the border of an OutlinedTextField. I want to achieve something like this I can not use Modifier.border because it just draws border above the label. Like this And for OutlinedTextField there is no shape…
10
votes
2 answers

TextInputLayout move the hint label and change it's background color when focused

I am trying to customize materials TextInpuLayout.OutlinedBox and TextInputEditText. My current state is like following image What I want to do is remove the background of the hint label so that it doesn't create that ugly cutout. Like this: Or…
10
votes
3 answers

Remove dropdown arrow from AutoCompleteTextView

I want to remove dropdown arrow which is created by AutoCompleteTextView when I use TextInputLayout and use Style: ExposedDropdownMenu Below is my code:
10
votes
2 answers

TextInputLayout: Set box stroke color programmatically (highlighted and unhighlighted)

I'm trying to use these material text fields with the box outline style. I see that there's a property called boxStrokeColor which lets me set the stroke only when the text field is highlighted when it's not highlighted it seems to pull that color…
10
votes
5 answers

TextFormField is losing focus - flutter

I am trying to solve form validation in my app. Every time I click to TextFromField, the focus is lost and keyboard hide. I found that problem is with "_formKey". But I need it to validation. How to solve it? code snippet: class…
Stepan
  • 1,041
  • 5
  • 23
  • 35
10
votes
2 answers

Set TextInputLayout theme programmatically

Is there a way to change the theme of a TextInputLayout programmatically in Android. If I have the following TextInputLayout for ex.:
buellas
  • 321
  • 4
  • 21
10
votes
4 answers

Customize Text Input Layout

I want to apply a border to a TextInputLayout as shown in the image. Right now, it looks like this: But, I need it to look like this (i.e. label is placed within border): The code that I have implemented for my EditText is as…
10
votes
3 answers

How to get the TextInputLayout related to edit text?

I have many edit texts inside differents TextInputLayouts, How can i get the TextInputLayout where is the edit text i am working with? Example : @BindView(R.id.eT) EditText eT; @BindView(R.id.eT2) EditText…