android-textinputlayout

TextInputLayout.setError() leaves empty space after clearing the error

一笑奈何 提交于 2019-12-17 17:53:23
问题 I recently used TextInputLayout and it's setError() method. The problem I'm getting is, when I clear the error by calling setError(null) it leaves so much of empty space at the bottom. Normal: With error: After clearing error: After looking at the source, I found that they are making the view INVISIBLE instead of GONE .setListener(new ViewPropertyAnimatorListenerAdapter() { @Override public void onAnimationEnd(View view) { view.setVisibility(INVISIBLE); // here it is updateLabelVisibility

how to change color of TextinputLayout's label and edittext underline android

自作多情 提交于 2019-12-17 04:41:51
问题 I am using android design library's TextinputLayout . But couldn't customize the hint color, label color and the underline color of EditText inside TextinputLayout . Please help. 回答1: To change bottom line color, you can use this in your app theme: <item name="colorControlNormal">#c5c5c5</item> <item name="colorControlActivated">@color/accent</item> <item name="colorControlHighlight">@color/accent</item> For more info, Check THIS THREAD. To change floating label color <style name=

how to change color of TextinputLayout's label and edittext underline android

拈花ヽ惹草 提交于 2019-12-17 04:41:13
问题 I am using android design library's TextinputLayout . But couldn't customize the hint color, label color and the underline color of EditText inside TextinputLayout . Please help. 回答1: To change bottom line color, you can use this in your app theme: <item name="colorControlNormal">#c5c5c5</item> <item name="colorControlActivated">@color/accent</item> <item name="colorControlHighlight">@color/accent</item> For more info, Check THIS THREAD. To change floating label color <style name=

how to change color of TextinputLayout's label and edittext underline android

孤者浪人 提交于 2019-12-17 04:41:06
问题 I am using android design library's TextinputLayout . But couldn't customize the hint color, label color and the underline color of EditText inside TextinputLayout . Please help. 回答1: To change bottom line color, you can use this in your app theme: <item name="colorControlNormal">#c5c5c5</item> <item name="colorControlActivated">@color/accent</item> <item name="colorControlHighlight">@color/accent</item> For more info, Check THIS THREAD. To change floating label color <style name=

Android. TextInputLayout. Toggle password visibility event listener?

筅森魡賤 提交于 2019-12-12 20:58:31
问题 There is a password visibility toggle button within TextInputLayout for InputType textPassword. Is it somehow possible to catch toggle events? I couldn't find any public methods for this 回答1: I looked at the source code of the TextInputLayout to find the type of the view of the toggle button. Its CheckableImageButton. Everything else is easy. You need to find the view iterating recursively over children of the TextInputLayout View. And then setOnTouchListener as @MikeM suggested in the

Android TextInputLayout hint overlaps EditText hint

梦想与她 提交于 2019-12-12 10:43:44
问题 I am facing a weird issue, I have a InputTextLayout and an EditText in it, and I am trying to achieve something like this (shown in image below) (Image from material design guidlines: https://material.io/guidelines/components/text-fields.html#text-fields-layout), where there are two separate hints. I am doing this by adding android:hint to both layouts. This works fine, but when the focus moves away from this, the "label" moves down and overlaps the "placeholder" text. (Only when the user has

TextInputLayout error message size

老子叫甜甜 提交于 2019-12-12 03:47:26
问题 Is there a way to force the TextInputLayout error message to take a single line ? I tried to place app:errorTextAppearance="@style/error_appearance" on the TextInputLayout with the error_appearance style containing : <item name="android:maxLines">1</item> <item name="android:ellipsize">end</item> <item name="android:inputType">text</item> and it does not work. Changing the color works however. I don't get it, the mErrorView is just a TextView, it should work. 回答1: It's true the the error text

fragment - EditText.setText(String) not working when string comes from savedInstanceState but works when hard coded

元气小坏坏 提交于 2019-12-12 02:49:38
问题 I have a fragment: ContactUsFragment.java import android.app.Activity; import android.content.Context; import android.net.Uri; import android.os.Bundle; import android.app.Fragment; import android.support.design.widget.TextInputLayout; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; import android.widget.Toast; /** * */

Android: why is setError message causing View distortion?

天大地大妈咪最大 提交于 2019-12-12 01:45:35
问题 I have two versions of an app I'm working on. The first version has a setError message that is set on an EditText UI line if the user tries to save data and the line is empty. The gradle dependencie uses version 24.0.0. The message appears correctly as: The second version of the app has the same setError code but the View looks distorted because it looks like the Edit Text line has been pushed down by the View so it no longer directly below the "Do" text and the red circular exclamation point

How to customize android passwordToggleDrawable

青春壹個敷衍的年華 提交于 2019-12-10 23:14:39
问题 Android support library added TextInputLayout adding several features like floating label and password toggle visisbilty My problem is How to customize passwordVisisbilityDrawable so my own icons for visible and hidden state will be displayed. Also when I enable passwordToggleVisibility, height will increase. 回答1: for change drawable, create a selector like below password_toggle_drawable.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res