android-textinputlayout

Show Helper text below EditText along with the Hint

巧了我就是萌 提交于 2019-12-03 15:39:21
问题 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 <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/et_username" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="15" android:hint="Username" app:et_helper="Username is preferably your

How to change material TextInputLayout OutlinedBox unfocused Color

喜你入骨 提交于 2019-12-03 10:14:54
问题 I have an OutlinedBox TextInputLayout and I want to change the box color in the unfocused mode of editText. How can I do that? 回答1: In the theme Add colorOnSurface attribute and assign any color you want <style name="Apptheme" parent="Theme.MaterialComponents.Light.NoActionBar"> <!-- General theme colors --> <item name="colorPrimary">@color/material_green_500</item> <item name="colorSecondary">@color/material_green_600</item> <item name="colorAccent">@color/illiniColorAccent</item> <item name

TextInputLayout and EditText double hint issue

孤人 提交于 2019-12-03 09:29:51
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 also). Please let me know if anyone had faced and found some workaround when editText is focused... when editText is not focused.. EDIT[10th July 2015]: <android.support.design.widget.TextInputLayout android:id="@+id/aTIL" android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:layout_width="match_parent" android:layout

Change to custom icon from eye-icon(default) for hide-show password in android EditText

做~自己de王妃 提交于 2019-12-03 09:27:17
问题 I want to change/display different icons for show password in android edittext. I am using following code to display icon. <android.support.design.widget.TextInputLayout android:id="@+id/layoutTextInput" android:textColorHint="@color/aluminium"> <android.support.v7.widget.AppCompatEditText android:id="@+id/editTextValue" android:imeOptions="actionNext" android:layout_marginBottom="8dp" android:inputType="text"/> </android.support.design.widget.TextInputLayout> I want to use custom icons

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

二次信任 提交于 2019-12-03 06:21:35
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 that style is ignored. Here's what I've got: <?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppTheme" parent="@style/Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary</item> <item name="colorAccent">@color/accent</item> <!-- Globally override default

Show Helper text below EditText along with the Hint

拈花ヽ惹草 提交于 2019-12-03 06:10:12
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 <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/et_username" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="15" android:hint="Username" app:et_helper="Username is preferably your registered email"/> </android.support.design.widget.TextInputLayout>` What I am getting is only and no

Change to custom icon from eye-icon(default) for hide-show password in android EditText

我怕爱的太早我们不能终老 提交于 2019-12-03 00:58:34
I want to change/display different icons for show password in android edittext. I am using following code to display icon. <android.support.design.widget.TextInputLayout android:id="@+id/layoutTextInput" android:textColorHint="@color/aluminium"> <android.support.v7.widget.AppCompatEditText android:id="@+id/editTextValue" android:imeOptions="actionNext" android:layout_marginBottom="8dp" android:inputType="text"/> </android.support.design.widget.TextInputLayout> I want to use custom icons instead of normal icons(eye-icon). Please help me. sham.y Create a new drawable file and named it as show

How to remove horizontal padding from TextInputLayout?

China☆狼群 提交于 2019-12-02 07:34:17
问题 After migrating to newest version of Material Components ( 1.1.0-alpha09 ), I've noticed that TextInputLayout has some padding horizontal padding. My goal is to achieve the old style of text fields, where there is no background or outline box. So I extended one of the styles, i.e. Widget.MaterialComponents.TextInputLayout.FilledBox and set background color to transparent. <style name="Widget.MyApp.TextInputLayout" parent="Widget.MaterialComponents.TextInputLayout.FilledBox.Dense"> <item name=

TextInputLayout setError method throws ClassCastException in 24.2.0

空扰寡人 提交于 2019-12-01 18:35:13
I updated support lib version to 24.2.0 and my registration screen is dead now. The problem is in the TextInputLayout, I have two methods: protected void setError(@Nullable CharSequence errorMsg, @NonNull EditText editText, boolean forceClean) { TextInputLayout viewParent = (TextInputLayout) editText.getParent(); if (forceClean) { viewParent.setErrorEnabled(false); viewParent.setError(null); } viewParent.setErrorEnabled(true); viewParent.setError(errorMsg); } protected void clearError(@NonNull EditText editText) { TextInputLayout viewParent = (TextInputLayout) editText.getParent(); viewParent

TextInputLayout suffix/prefix

淺唱寂寞╮ 提交于 2019-12-01 04:09:57
I want to add suffix to TextInputLayout. An example is taken from the material.io Are there any standard solutions? Ovechkin Pavel There are no standard solutions, I did it with textView right to textInputLayout and editText padding. <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="4dp" android:gravity="bottom"> <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Hint" app:errorEnabled="true"> <android.support.v7.widget.AppCompatEditText style="