android-textinputlayout

Custom TextInputLayout android [duplicate]

谁说我不能喝 提交于 2019-11-27 20:26:55
问题 This question already has answers here : Outlined Edit Text from Material Design (5 answers) Closed last year . I am trying to create custom TextInputLayout . How can I create below custom TextInputLayout ? 回答1: You should use Material Design style for Outline Box. Just simple use: style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" in TextInputLayout . See Text Field for Android in Material Design Guide 回答2: Here is an workaround: 1. Design your layout structure as below:

Change thickness of the bottom line of EditText when wrapped into TextInputLayout

懵懂的女人 提交于 2019-11-27 20:06:03
here is my code XML Markup <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/TextLabel"> <EditText android:id="@+id/etContactName" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Contact Name"/> </android.support.design.widget.TextInputLayout> Style <style name="TextLabel" parent="TextAppearance.AppCompat"> <item name="android:textColorHint">@color/hintColor</item> <item name="colorAccent">@color/primaryColor</item> <item name="colorControlNormal">@color/hintColor<

TextInputLayout has no effect for giving hint programmatically in EditText

独自空忆成欢 提交于 2019-11-27 13:24:49
I have an EditText and it's parent is TextInputLayout. I am trying to give hint programmatically for EditText, (not in layout) in this case Text input hint animation is not working, it's working like simple EditText. can some one suggest how to handle it. below is my layout. <android.support.design.widget.TextInputLayout android:id="@+id/text_input_layout" android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/post_EditTextPostAnAd" style="@style/abc_EditView" /> </android.support.design.widget.TextInputLayout> You have to set hint to

Change font of the floating label EditText and TextInputLayout

怎甘沉沦 提交于 2019-11-27 13:10:05
Someone tried to change the font of the floating label? I changed the source of EditText but the font of the floating label did not change, I am very grateful to those who help me Code: <android.support.design.widget.TextInputLayout android:id="@+id/tilTextoDescricao" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_toRightOf="@id/tilValorUnidade" android:layout_marginTop="10dp"> <EditText android:id="@+id/etTextoDescricao" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:hint="Descrição"

Do not change TextInputLayout background on error

不打扰是莪最后的温柔 提交于 2019-11-27 12:29:35
I would like to have an EditText with the background as a "normal" EditText but with the error handling of a TextInputEditText (error message appearing at the bottom, and not the "!" drawable appearing). I got something like this : <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" app:setError="@{viewModel.error}"> <android.support.design.widget.TextInputEditText android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/simple_edit_text_background" android:ellipsize="end" android

TextInputLayout :How to give padding or margin to hint?

好久不见. 提交于 2019-11-27 12:17:29
I have to use TextInputLayout of design support library in my project. I want to give space between hint and EditText in TextInputLayout . I set margin and padding in TextInputLayout and even inside EditText but both are not work.So how to solve this issue. Here i attach screen shot and my coding. ==============================Style================================= <style name="TextHint" parent="Base.TextAppearance.AppCompat"> <item name="android:textSize">18sp</item> <item name="android:textColor">@color/green</item> </style> =============================XML===================================

Android 8.0 Oreo crash on focusing TextInputEditText

非 Y 不嫁゛ 提交于 2019-11-27 09:21:01
问题 After updating some of our devices to android 8.0 , upon focusing on a TextInputEditText field inside of a TextInputLayout , the app crashes with this Exception : Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.getBoundsOnScreen(android.graphics.Rect)' on a null object reference at android.app.assist.AssistStructure$WindowNode.(AssistStructure.java) at android.app.assist.AssistStructure.(AssistStructure.java) at android.app

How to change the floating hint color of TextInputLayout if EditText inside is disabled

老子叫甜甜 提交于 2019-11-27 07:24:26
问题 I am using EditText with TextInputLayout . I just want to change the floating hint color of TextInputLayout if the EditText is disabled. I tried with selector it is not working. <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" android:textColor="@color/darkGray" /> <item android:state_pressed="false" android:state_focused="false" android:textColor="@color/lightGray"/> </selector> 回答1: There's one method called setHintTextAppearance(int

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

梦想的初衷 提交于 2019-11-27 05:56:07
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. Pankaj Arora 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="TextAppearance.App.TextInputLayout" parent="@android:style/TextAppearance"> <item name="android:textColor

TextInputLayout Hint doesn't float up after updating Google Support Library

≡放荡痞女 提交于 2019-11-27 05:28:10
I recently updated my support library to com.android.support:appcompat-v7:25.1.0 after which if I add a text to EditText via xml file the TextInputLayout hint doesn't float up. I also had a look at this question but it didn't worked for me. Here is my xml code: <android.support.design.widget.TextInputLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="16dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" android:layout_marginBottom="16dp" android:layout_marginEnd="16dp" app:layout_constraintRight