android-textinputlayout

Change TextInputLayout focused & unfocused hint color programmatically

a 夏天 提交于 2019-12-23 10:19:59
问题 I wanted to change the color of hint in TEXT INPUT LAYOUT same when it is in focused or unfocused state.i have two TEXT INPUT LAYOUT fields.Both fields are same color.But it in focused state color appears but in an unfocused state the default grey color appears.i want to keep the color color of hint same in both focused and unfocused state. <com.example.viveka.snipeid.CustomTextInputLayout android:id="@+id/input_layout_name" android:layout_width="match_parent" android:layout_height="wrap

Get parent texInputlayout from child textInputEditText

浪子不回头ぞ 提交于 2019-12-23 09:04:03
问题 I am implementing a functionality to change the case of textInputlayout Hint text to upper case when the hint floats up and vice versa. For that I am using OnFocusChangeListener on its child textInputEditText . To make it easy to implement I am implementing View.OnFocusChangeListener on my activity like: public class LoginActivity extends BaseActivity implements View.OnFocusChangeListener and overriding the method in the activity like: @Override public void onFocusChange(View v, boolean

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

人盡茶涼 提交于 2019-12-21 08:02:06
问题 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=

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

蓝咒 提交于 2019-12-21 08:01:37
问题 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=

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

偶尔善良 提交于 2019-12-21 05:22:28
问题 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

TextInputLayout and EditText double hint issue

帅比萌擦擦* 提交于 2019-12-21 03:27:05
问题 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"

TextInputLayout setError method throws ClassCastException in 24.2.0

梦想的初衷 提交于 2019-12-19 20:44:33
问题 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(

How to change the size of the EditText hint in TextInputLayout

人盡茶涼 提交于 2019-12-18 09:22:08
问题 I'm trying to change the hint size in TextInputLayout , but it's not working as desired. This is what I'd like to achieve: styles.xml <style name="TextLabel" parent="TextAppearance.Design.Hint"> <item name="android:textSize">44sp</item> </style> fragment.xml <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" app:hintTextAppearance="@style/TextLabel" android:hint="Password"> <android.support.design.widget.TextInputEditText

AppCompatEditText.getpParent() inside TextInputLayout returns FrameLayout

半世苍凉 提交于 2019-12-18 03:22:25
问题 I am creating simple AppCompatEditText adding OnFocusChangeListener and putting it in the simple TextInputLayout. When AppCompatEditText loosing focus it's content should be validate by isValidParam method. It worked till yesterday, when I used rev.23.0.3 But now, when I used rev.24.0.2, it gives error as below on the 1st row of isValidParam method. java.lang.ClassCastException: android.widget.FrameLayout cannot be cast to android.support.design.widget.TextInputLayout I checked in debugging

Unable to use drawable in EditText inside TextInputLayout

只谈情不闲聊 提交于 2019-12-17 20:28:24
问题 I recently upgraded Android Design library from 24.2.1 to 25.0.0. After this the "drawableX" feature in EditText doesn't work. EDIT 01.11: I learned that setting drawable in xml works if you use android:drawableStart instead of android:drawableLeft. But setting setting drawables programatically does not work. I use this to make a "Clear"-button to empty the EditText. But this feature is broken now. I would appreciate any work-arounds or knowledge about if this is intentional from Google or a