android-textinputlayout

Change style of the right icon error TextInputLayout

依然范特西╮ 提交于 2021-02-18 15:12:24
问题 I want to change the style of the right icon error (the image with ! sign) in a TextInputLayout but I don't find how. It is possible?. 回答1: With the Material Component Library just use the app:errorIconDrawable attribute. Something like: <com.google.android.material.textfield.TextInputLayout app:errorIconDrawable="@drawable/..." ../> 回答2: To do this in your Java class, you can do something like this: // initialize your drawable object Drawable myErrorDrawable = getResources().getDrawable(R

Change style of the right icon error TextInputLayout

别等时光非礼了梦想. 提交于 2021-02-18 15:11:19
问题 I want to change the style of the right icon error (the image with ! sign) in a TextInputLayout but I don't find how. It is possible?. 回答1: With the Material Component Library just use the app:errorIconDrawable attribute. Something like: <com.google.android.material.textfield.TextInputLayout app:errorIconDrawable="@drawable/..." ../> 回答2: To do this in your Java class, you can do something like this: // initialize your drawable object Drawable myErrorDrawable = getResources().getDrawable(R

Change style of the right icon error TextInputLayout

ぐ巨炮叔叔 提交于 2021-02-18 15:10:45
问题 I want to change the style of the right icon error (the image with ! sign) in a TextInputLayout but I don't find how. It is possible?. 回答1: With the Material Component Library just use the app:errorIconDrawable attribute. Something like: <com.google.android.material.textfield.TextInputLayout app:errorIconDrawable="@drawable/..." ../> 回答2: To do this in your Java class, you can do something like this: // initialize your drawable object Drawable myErrorDrawable = getResources().getDrawable(R

Change style of the right icon error TextInputLayout

对着背影说爱祢 提交于 2021-02-18 15:09:55
问题 I want to change the style of the right icon error (the image with ! sign) in a TextInputLayout but I don't find how. It is possible?. 回答1: With the Material Component Library just use the app:errorIconDrawable attribute. Something like: <com.google.android.material.textfield.TextInputLayout app:errorIconDrawable="@drawable/..." ../> 回答2: To do this in your Java class, you can do something like this: // initialize your drawable object Drawable myErrorDrawable = getResources().getDrawable(R

Create Custom class for TextInputLayout

孤街浪徒 提交于 2021-02-18 11:31:12
问题 In TextInputLayout I want to add TextInputEditText via Custom class Here is the code for custom class I have created : public class CustomTextInputEditText extends TextInputLayout { private TextInputEditText editText; public CustomTextInputEditText(@NonNull Context context) { this(context, null); } public CustomTextInputEditText(@NonNull Context context, @Nullable AttributeSet attrs) { this(context, attrs, R.style.Widget_MaterialComponents_TextInputLayout_OutlinedBox); } public

Android TextInputLayout Password toggle not visible in new support library

拥有回忆 提交于 2021-02-17 21:35:31
问题 I have compiled with following design library and it is displaying password HIDE/SHOW button at the right of EditText compile 'com.android.support:design:24.2.1' <android.support.design.widget.TextInputLayout android:id="@+id/login_password_text_input_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/spacing_normal"> <android.support.v7.widget.AppCompatEditText android:id="@+id/login_password_edit_text" android:layout_width=

Android TextInputLayout Password toggle not visible in new support library

六月ゝ 毕业季﹏ 提交于 2021-02-17 21:34:05
问题 I have compiled with following design library and it is displaying password HIDE/SHOW button at the right of EditText compile 'com.android.support:design:24.2.1' <android.support.design.widget.TextInputLayout android:id="@+id/login_password_text_input_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/spacing_normal"> <android.support.v7.widget.AppCompatEditText android:id="@+id/login_password_edit_text" android:layout_width=

How to make error message in TextInputLayout appear in center

萝らか妹 提交于 2021-02-16 04:50:35
问题 Currently it looks as in attached with this layout: <android.support.design.widget.TextInputLayout android:id="@+id/layoutCurrentPW" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" app:errorEnabled="true"> How to set the error message "password must at least be 8 characters" to center gravity ? I tried with android:gravity="center" but that did not work. EDIT Layout that includes EditText: <android.support.design.widget.TextInputLayout

How to make error message in TextInputLayout appear in center

戏子无情 提交于 2021-02-16 04:49:16
问题 Currently it looks as in attached with this layout: <android.support.design.widget.TextInputLayout android:id="@+id/layoutCurrentPW" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" app:errorEnabled="true"> How to set the error message "password must at least be 8 characters" to center gravity ? I tried with android:gravity="center" but that did not work. EDIT Layout that includes EditText: <android.support.design.widget.TextInputLayout

Keep TextInputLayout always focused or keep label always expanded

荒凉一梦 提交于 2021-02-06 15:14:21
问题 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 animate changes. Maybe I can set a custom TextWatcher with a custom ValueAnimator on the EditText inside the TextInputLayout ? 回答1: The current version of the TextInputLayout exists specifically to do one thing - show / hide the helper label depending