android-textinputlayout

customize Bounding box stroke in TextInputLayout.OutlinedBox

痴心易碎 提交于 2019-12-05 00:51:37
问题 I'm trying to change box Stroke Color of com.google.android.material.textfield.TextInputLayout while not focused but there is no attribute for that this is my TextInputLayout code <com.google.android.material.textfield.TextInputLayout style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="36dp" android:layout_marginTop="38dp" android:layout_marginEnd="36dp" android:textColorHint=

Adding TextInputLayout dynamically throws Exception

。_饼干妹妹 提交于 2019-12-04 20:22:10
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 for a solution, but whatever was mentioned there looks like I already have done it. Here goes what I have

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

落花浮王杯 提交于 2019-12-04 15:23:01
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_gravity="center_vertical" android:textColor="#ff0000" android:textSize="15sp" /> <android.support.design

Material design Spinner using TextInputLayout.OutlinedBox styling

故事扮演 提交于 2019-12-04 10:58:36
I am currently using Material Design TextInputLayout OutlinedBox as shown below: <android.support.design.widget.TextInputLayout style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.design.widget.TextInputEditText android:id="@+id/myEditText" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Title" android:inputType="text"/> </android.support.design.widget.TextInputLayout> I am trying to add a dropdown box Spinner under my TextInputEditText, and would

android TextInputLayout changes EditText style after setting error to null

梦想与她 提交于 2019-12-04 10:30:03
问题 for the first time I'm using the new Android's widget TextInputLayout, it's very nice but I'm facing some problem using setError method this is my xml <android.support.design.widget.TextInputLayout android:id="@+id/userData_txtNameWrapper" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:textColorHint="@color/light_gray" app:hintTextAppearance="@style/TextAppearence.App.TextInputLayout"> <EditText android:id="@+id/userData_txtName"

Android: Display TextView in the right-side of EditText which is in the TextInputLayout

▼魔方 西西 提交于 2019-12-04 03:18:42
I am trying to create a layout like in the picture below In the above picture the password field is in the TextInputLayout and it also have a TextView in the right side , which points to the Forget Password Activity. I achive EditText with Textview without TextInpt layout like below using relative layout XML layout: <EditText android:id="@+id/email_address" android:layout_width="match_parent" android:layout_height="wrap_content" android:drawableLeft="@drawable/ic_email" android:drawableStart="@drawable/ic_email" android:drawablePadding="10dp" android:hint="@string/email_address" android

TextInputLayout setErrorEnabled doesn't create new TextView object

我是研究僧i 提交于 2019-12-04 02:41:11
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 looks fine, BUT I can't set it on again. When calling mTextInputLayout.setErrorEnabled(true);

TextInputLayout suffix/prefix

霸气de小男生 提交于 2019-12-04 00:46:29
问题 I want to add suffix to TextInputLayout. An example is taken from the material.io Are there any standard solutions? 回答1: 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

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

扶醉桌前 提交于 2019-12-03 17:11:31
问题 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">

Issue in Changing EditText background after setting error to the TextInputLayout on Android M

拈花ヽ惹草 提交于 2019-12-03 16:25:19
I have set custom background to the EditText in Xml file. After validation, i am setting different background to EditText at runtime and also setting error to TextInputLayout. But in Android M instead of setting background resource, it is setting background color to EditText. This is image before setting error to the TextInputLayout This is the image after setting error to the TextInputLayout Below is my code:- XML file code <android.support.design.widget.TextInputLayout android:id="@+id/input_layout_name" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout