android-textinputlayout

TextInputLayout error after enter value into edittext

馋奶兔 提交于 2019-11-29 05:48:50
How can i hide a TextInputLayout error after input one text in EditText . Is it possible? how can i achieve this or I am doing something wrong here.!! code layoutEdtPhone =(TextInputLayout)rootView.findViewById(R.id.layoutEdtPhone); layoutEdtPhone.setErrorEnabled(true); layoutEdtPhone.setError(getString(R.string.ui_no_phone_toast)); layoutEdtPassword = (TextInputLayout)rootView.findViewById(R.id.layoutEdtPassword); layoutEdtPassword.setErrorEnabled(true); layoutEdtPassword.setError(getString(R.string.ui_no_password_toast)); edtPhone=(EditText)rootView.findViewById(R.id.edtPhone); edtPassword=

TextInputLayout animation overlaps the text when the text is set programmatically

谁说胖子不能爱 提交于 2019-11-29 02:29:25
问题 I am using TextInputLayout with the design support library 22.2.1 . I set the value of the EditText programmatically, and when the screen appears, I can see that the hint of the TextInputLayout overlaps the text inside, before moving in the floating position. Here a simple layout: <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/editText1" android:layout_width="match_parent" android:layout

Custom TextInputLayout android [duplicate]

百般思念 提交于 2019-11-28 18:55:29
This question already has an answer here: Outlined Edit Text from Material Design 5 answers I am trying to create custom TextInputLayout . How can I create below custom TextInputLayout ? 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 Here is an workaround: 1. Design your layout structure as below: activity_test.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns

Android 8.0 Oreo crash on focusing TextInputEditText

青春壹個敷衍的年華 提交于 2019-11-28 15:46:04
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.ActivityThread.handleRequestAssistContextExtras(ActivityThread.java:3035) at android.app.ActivityThread$H

How to add floating label on Spinner

人走茶凉 提交于 2019-11-28 14:59:57
问题 After using the Android Design Support Library's TextInputLayout to place a floating label above an EditText component, I was wondering if there is a way to add a floating label to the Spinner component (not necessarily using the Design Library). By this, I mean something like a TextView placed above the Spinner (obviously no animations like the TextInputLayout ), but I want the text size, font and colour to match that of the TextInputLayout 's floating label . For example, it would look

Unable to use drawable in EditText inside TextInputLayout

て烟熏妆下的殇ゞ 提交于 2019-11-28 14:24:34
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 bug! My code for Clearable edit-text that worked before but doesn't now: public class

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

大城市里の小女人 提交于 2019-11-28 05:39:05
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(true); } }).start(); I'm wondering why is it so? How to resolve this to avoid the empty space? harshitpthk

EditText added is not a TextInputEditText. Please switch to using that class instead

梦想与她 提交于 2019-11-28 04:36:24
I'm using an EditText inside a TextInputLayout , but after upgrading the support library to 23.2.0, I get this warning in the logcat, What's the difference between a regular EditText and a TextInputEditText ? I can't seem to find any documentation for it. TWiStErRob I was wondering this too, Daniel Wilson gathered the documentation, but to the untrained eye it doesn't mean much. Here's what it's all about: "extract mode" is referring to the type of view that's shown when the space is too small, for example landscape on a phone. I'm using Galaxy S4 with Google Keyboard as IME. Landscape UI

TextInputLayout error after enter value into edittext

别等时光非礼了梦想. 提交于 2019-11-27 23:12:11
问题 How can i hide a TextInputLayout error after input one text in EditText . Is it possible? how can i achieve this or I am doing something wrong here.!! code layoutEdtPhone =(TextInputLayout)rootView.findViewById(R.id.layoutEdtPhone); layoutEdtPhone.setErrorEnabled(true); layoutEdtPhone.setError(getString(R.string.ui_no_phone_toast)); layoutEdtPassword = (TextInputLayout)rootView.findViewById(R.id.layoutEdtPassword); layoutEdtPassword.setErrorEnabled(true); layoutEdtPassword.setError(getString

Programmatically set TextInputLayout Hint Text Color and Floating Label Color

一曲冷凌霜 提交于 2019-11-27 22:10:28
I use a TextInputLayout, I would want to programmatically set the hint text color and the floating label color if the input field is mandatory. Before moving to TextInputLayout I used to set the hint text color programmatically using the following textField.setHintTextColor(Color.RED); Can someone guide me on how to set the hint text color and the floating label color programmatically for a TextInputLayout. In the screenshot attached i would want the hint text Address 1 to be in red when not focused and the on focus the floating label Address 1 should be in red. alexandrius I changed focused