android-textinputlayout

Removing TextInputLayout extra top padding

自作多情 提交于 2019-12-07 03:46:00
问题 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: <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.v7.widget.AppCompatEditText android:id="@+id/txt_amount" style="@style/EditTextStyle" android:hint="@string/hint_amount" android:inputType="numberDecimal"/> </android.support.design.widget.TextInputLayout> How to

Adding TextInputLayout dynamically throws Exception

喜欢而已 提交于 2019-12-06 14:29:20
问题 I have been trying to add a TextInputLayout dynamically. Whenever a RadioButton will be clicked, a TextInputLayout will be added under a LinearLayout . But after all this, I am getting an exception -- java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the design library. Although the app is not crashing, but the code below the point of this error is not getting executed. I have searched all over StackOverflow and other websites as well, looking

Having the mandatory symbol to the edit text (red color asterisk) which is inside the textinputlayout

半城伤御伤魂 提交于 2019-12-06 09:53:36
问题 I have an edit text inside a textinputlayout. I am trying to set the mandatory field symbol (red color asterisk) to the edittext. I have set the hint to the edit text. My code is as below. <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginLeft="16dp" android:layout_marginTop="16dp" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" * " android:layout

TextInputLayout error alignment issue with AppCompat Spinner

最后都变了- 提交于 2019-12-05 23:53:00
I am using an app which displays a drop down Spinner with an EditText as a child of TextInputLayout next to it. When an underlined error is shown under the TextInputLayout , then the EditText will go up, and alignment will miss !! See my screenshot please: What I am trying to do is: Here is my xml code: <LinearLayout android:layout_width="@dimen/edittext_width" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="bottom"> <android.support.v7.widget.AppCompatSpinner android:id="@+id/spinner_countries" style="@style/Widget.AppCompat.Spinner.Underlined" android

Change PasswordToggle Gravity to the left (for RTL language)

依然范特西╮ 提交于 2019-12-05 21:49:05
I use TextInputLayout to get password from user like this: <android.support.design.widget.TextInputLayout android:id="@+id/RegisterPassInput" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="16dp" app:passwordToggleEnabled="true" android:layout_marginRight="16dp" android:layout_toStartOf="@+id/RegisterPassImg"> <EditText android:id="@+id/RegisterPassET" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="right" android:hint="@string/Password" android:inputType="textPassword" android:maxLength="40" /> <

In TextInputLayout change the color of hint for single letter or alphabet

无人久伴 提交于 2019-12-05 20:32:03
I have defined TextInputLayout programmatically in my Activity. I have added EditText inside that TextInputLayout, that to programmatically. Now, I have to set the color of hint of that edittext. Here I just have to change the color of single alphabet of the hint. Example - Hint is like, Firstname *. Here i want to change the color of "*" to Red and remaining hint as black in color. I have already tried Html and Spannable String, but both are not working for TextInputLayout. For Spannable i did SpannableString redSpannable = new SpannableString(red); redSpannable.setSpan(new

Has the new Password Visibility Toggle broken existing drawableRight for EditTexts?

♀尐吖头ヾ 提交于 2019-12-05 17:16:08
问题 EDIT I just tried an EditText without a TextInputLayout and it works as expected. So the problem must be with new changes in the TextInputLayout . I have been using a custom EditText class as child of a TextInputLayout for around a month. When the user typed, an x would appear in the drawableRight field. I have successfully displayed images for drawableLeft , drawableTop , and drawableBottom , but setting drawableRight provides me with a blank. Note: Clicking the blank space where the X

TextInputLayout setErrorEnabled doesn't create new TextView object

折月煮酒 提交于 2019-12-05 16:10:13
问题 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 mTextInputLayout.setError(null); Problem is that there are still paddings of the empty TextView object, which was showing the error message. So I tried to disable the error completely with setting mTextInputLayout.setErrorEnabled(false); and it works and

EditText in TextInputLayout lagging

一曲冷凌霜 提交于 2019-12-05 09:04:32
I have two views using TextInputLayout . The first one is a login view which has only 2 input fields and the second one is a register view which has many input fields. I am using TextInputLayout and EditText / AppCompatEditText with custom themes for my inputs. The problem is, when i click on my EditText 's in my Register screen i get a kind of lag/spikes on the default TextInputLayout animation. I don't get the lag in my LoginScreen but the code I'm using is quite the same, so i suppose the problem is in the number of inputs. Any idea or thoughts? Here is my register code: <LinearLayout xmlns

Removing TextInputLayout extra top padding

*爱你&永不变心* 提交于 2019-12-05 07:46:10
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: <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.v7.widget.AppCompatEditText android:id="@+id/txt_amount" style="@style/EditTextStyle" android:hint="@string/hint_amount" android:inputType="numberDecimal"/> </android.support.design.widget.TextInputLayout> How to remove this extra space? Rajesh Peram You can remove extra space above AppCompatEditText by setting app