android-textinputlayout

Keep TextInputLayout always focused or keep label always expanded

跟風遠走 提交于 2021-02-06 15:13:44
问题 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

Keep TextInputLayout always focused or keep label always expanded

故事扮演 提交于 2021-02-06 15:06:38
问题 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

Programmatically set boxBackgroundMode to TextInputLayout

别来无恙 提交于 2021-01-28 20:21:03
问题 I just migrate from com.android.support:design to com.google.android.material . implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'com.google.android.material:material:1.1.0' I have the troubles with set up boxBackgroundMode as an outline for TextInputLayout programmatically. val textInputLayout = TextInputLayout(this) textInputLayout.addView(EditText(this)) textInputLayout.boxBackgroundMode = TextInputLayout.BOX_BACKGROUND_OUTLINE textInputLayout.boxStrokeColor = Color.BLACK

textinputlayout password toggle icon is blocked

杀马特。学长 韩版系。学妹 提交于 2021-01-27 12:50:47
问题 I do not know how to explain in words but let the attached picture do the talking ya? Basically, the setError icon is blocking the password toggle icon. Initially I thought it to be a simple layout issue where I had played around with the colors & background, etc. However, so many trial & error yet I can't seem to find the solution to the problem. I'll post my XML here for your reference: <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res

Android EditText error message popup text not showing

末鹿安然 提交于 2021-01-27 05:16:22
问题 I'm having an issue in my app where the error popup on EditTexts shows but the text is not visible. It looks something like this: This happens with all the EditText s in my app. Here's an example layout XML Layout: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/main_content"

TextInputLayout styling

跟風遠走 提交于 2021-01-20 07:28:28
问题 I have problem with my custom TextInputLayout . Here is my code <com.google.android.material.textfield.TextInputLayout android:id="@+id/phone" android:layout_width="0dp" android:layout_height="wrap_content" android:theme="@style/CustomTextInputLayout" android:hint="@string/phone_number" android:layout_marginTop="8dp" android:layout_marginStart="16dp" android:layout_marginEnd="16dp" app:startIconDrawable="@drawable/account" android:background="@color/bg_light_gray" app:layout_constraintLeft

How to make TextInputLayout hint asterisk red for required fields

﹥>﹥吖頭↗ 提交于 2021-01-16 08:13:32
问题 Is it possible to make just the asterisk in the hint red when using a TextInputLayout from the design support library? I have seen information on styling the entire hint, but this is a little more complex since only the * should be red, not the whole message. The Material Design example shows this, but the design library doesn't seem to have any option to style it this way using a TextInputLayout and EditText. Reference: https://www.google.com/design/spec/components/text-fields.html#text

How to make TextInputLayout hint asterisk red for required fields

杀马特。学长 韩版系。学妹 提交于 2021-01-16 08:12:05
问题 Is it possible to make just the asterisk in the hint red when using a TextInputLayout from the design support library? I have seen information on styling the entire hint, but this is a little more complex since only the * should be red, not the whole message. The Material Design example shows this, but the design library doesn't seem to have any option to style it this way using a TextInputLayout and EditText. Reference: https://www.google.com/design/spec/components/text-fields.html#text

How to make TextInputLayout hint asterisk red for required fields

五迷三道 提交于 2021-01-16 08:11:30
问题 Is it possible to make just the asterisk in the hint red when using a TextInputLayout from the design support library? I have seen information on styling the entire hint, but this is a little more complex since only the * should be red, not the whole message. The Material Design example shows this, but the design library doesn't seem to have any option to style it this way using a TextInputLayout and EditText. Reference: https://www.google.com/design/spec/components/text-fields.html#text

How to make TextInputLayout hint asterisk red for required fields

≯℡__Kan透↙ 提交于 2021-01-16 08:10:33
问题 Is it possible to make just the asterisk in the hint red when using a TextInputLayout from the design support library? I have seen information on styling the entire hint, but this is a little more complex since only the * should be red, not the whole message. The Material Design example shows this, but the design library doesn't seem to have any option to style it this way using a TextInputLayout and EditText. Reference: https://www.google.com/design/spec/components/text-fields.html#text