android-textinputlayout

android textInputEditText with custom background is not working ok

旧时模样 提交于 2019-12-10 23:03:13
问题 i'm using textInputEditText inside textInputLayout i had to set background for my editText to achieve a bordered view for my editText. but when i call setError() on my textInputLayout the entire editText color changes to red. but i want to change only the color of error text, not the entire view. before setting error : screen shot after setting error : screen shot and here is my xml code : <android.support.design.widget.TextInputLayout android:layout_alignParentTop="true" android:id="@+id/ex

RuntimeException when input exceeds counterMaxLength of TextInputLayout

纵然是瞬间 提交于 2019-12-10 18:23:28
问题 I have a form with a TextInputLayout and TextInputEditText . This is the relevant XML : <android.support.design.widget.TextInputLayout android:id="@+id/signup_til_name" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="@dimen/activity_horizontal_margin" android:hint="Name" app:counterEnabled="true" app:counterMaxLength="16" app:errorEnabled="true"> <android.support.design.widget.TextInputEditText android:id="@+id/signup_etext_name" android:layout

TextInput layout turns editext into red on setting error

你说的曾经没有我的故事 提交于 2019-12-10 16:59:38
问题 I have a layout, whenever i press submit button and set error on text input layout it turns the editText into red but i hadn't set any color on editText on set error. Basically i just wanted to give the error string below the editText and not to turn editText into red on setting the error. My Fragment code is as follows, public class SignIn extends Fragment implements View.OnClickListener { TextInputLayout edEamil,edPassword; @Override public View onCreateView(LayoutInflater inflater,

Change TextInputLayout error font?

拟墨画扇 提交于 2019-12-10 16:06:19
问题 Is it possible to change the TextInputLayout error text font for an EditText? I could only change the color or text size, via app:errorTextAppearance. 回答1: You can use a SpannableString to set the font: SpannableString s = new SpannableString(errorString); s.setSpan(new TypefaceSpan(font), 0, s.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); mPasswordView.setError(s); A custom Span class that has a specific Typeface set: public class TypefaceSpan extends MetricAffectingSpan { private Typeface

NullPointerException on TextInputLayout.passwordVisibilityToggleRequested

无人久伴 提交于 2019-12-10 13:47:49
问题 I got an error in Firebase crash reporting about Password toggle button on an app in release mode in some real devices. The problem is the stack trace error is all about android.support.design code like you will see in the following log taken from firebase console: Exception java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference android.graphics.drawable.AnimatedVectorDrawable.isStarted (AnimatedVectorDrawable.java:427)

How to disable floating while showing error in TextInputLayout

做~自己de王妃 提交于 2019-12-10 13:19:52
问题 <android.support.design.widget.TextInputLayout android:id="@+id/productLayout" android:layout_width="match_parent" android:layout_height="wrap_content" app:errorEnabled="true"> <EditText android:id="@+id/product" android:layout_width="match_parent" android:layout_height="@dimen/margin_padding_width_height_6" android:cursorVisible="false" android:drawableRight="@drawable/ic_arrow_down" android:focusableInTouchMode="false" android:hint="@string/product" android:inputType="none" android

TextInputLayout not showing error message after clearing

大城市里の小女人 提交于 2019-12-10 13:14:59
问题 I am using TextInputLayout from com.android.support:design:23.3.0 When I first apply an error it is shown correctly. mInputPassword.setError(getString(R.string.error_invalid_password)); mInputEmail.setError(getString(R.string.error_field_required)); On the next login attempt I clear the error. mInputEmail.setError(null); mInputPassword.setError(null); Then I run the validation and set the error again using the same code as above but this time the red line is applied but the error text is

Float Label hint (TextInputLayout) not works with Android Data Binding

梦想的初衷 提交于 2019-12-10 12:56:21
问题 I need create fields edit page in app. There are list of EditText for edit Contact. For each field type i have an layout. As example - for name and last name it is float labeled edit text. For facebook - simple edit text with icon. I am creating this list with Android Data Binding Library I've created layout <data> <variable name="item" type="app.core.db.model.Field" /> </data> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android

TextInputLayout's errorview is not removed when removing error message

北慕城南 提交于 2019-12-10 12:38:57
问题 I have a vertical linear layout with some input fields. Using TextInputLayout I get a nice flow with labels and built-in error messages. My problem is when I add and remove the error-messages. If I add an error message it is positioned below the edit-text and everything looks good. If I remove the error message with setError(null) the message is removed but the space is still there. This is per googles design apparently(see https://code.google.com/p/android/issues/detail?id=176005). I would

Change PasswordToggle Gravity to the left (for RTL language)

旧时模样 提交于 2019-12-10 10:16:37
问题 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=