android-edittext

Edittext underline color when contain text (“>Lollipop”)

筅森魡賤 提交于 2019-12-21 06:44:54
问题 I want to change the underline color of my editText when they have text inside them otherwise make a default color. whatever the state, I want to do the following Edittext: When they have text -> Underline color (Blue) Edittext: when they empty -> underline color (Gray) It works on Lollipop and below, but it's not working on Android versions above Lollipop. I did the following: XML <android.support.design.widget.TextInputLayout android:id="@+id/input_password_layout" android:layout_width=

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

Click on EditText's drawable right with Espresso

旧巷老猫 提交于 2019-12-21 05:08:48
问题 How could be possible to click on EditText's right drawable (check the screenshot)? I have tried several ways but I always get stuck. public static Matcher<View> withEditTextDrawable(final int resourceId) { return new BoundedMatcher<View, EditText>(EditText.class) { @Override protected boolean matchesSafely(final EditText editText) { // ???? return false; } @Override public void describeTo(Description description) { description.appendText("with drawable from resource id: "); description

Android - onTextChanged() called on when phone orientation is changed

大城市里の小女人 提交于 2019-12-21 04:35:10
问题 I tried to implement search using EditText . whenever a text is typed in the EditText request is sent with the typed text in onTextChanged() method. When I change the orientation of the phone with the results displyed, onTextChanged() method is called again with same text. How can I avoid redundant call to onTextChanged() method on orientation change. public void onTextChanged(CharSequence s, int start, int before, int count) { final String enteredKeyword = s.toString(); if(isFragmentVisible

How to make Android EditText expand vertically when full

六月ゝ 毕业季﹏ 提交于 2019-12-21 03:49:38
问题 I have this EditText <EditText android:layout_width="match_parent" android:layout_height="72dp" android:hint="@string/write_message" android:textColorHint="@color/primary_color" android:ems="10" android:imeOptions="actionDone" android:inputType="textImeMultiLine" android:id="@+id/message_input" android:layout_gravity="center_horizontal" android:backgroundTint="@color/primary_color"/> When the box is filled up with user inputted text, it scrolls to the right to make room for more text, I do

Android: Zooming EditText Android Issue in translation And Getting Touch event of childView when Placed outside parentView

。_饼干妹妹 提交于 2019-12-21 03:48:35
问题 my question is related to android feature to zoom the parent consisting of multiple child view's. ZoomView->ParentView->[multiple childViews] I am working on a Demo project to Zoom the child View and to pan infinitely.Zooming works perfectly as needed. PROBLEM 1: But if there is a EditText in the view and i try to zoom on that then below issues are faced by me. on zooming in the text is blurred pointing on a text is working fine but translating through the text is translating very fast as its

OnEditorActionListener not working

纵然是瞬间 提交于 2019-12-21 03:44:29
问题 I simply want to catch the event when the user press enter on an editText. I did not get the Toast message, not the "Enter pressed" and not the "Some key pressed!" either. What m i doing wrong? myEditText.setOnEditorActionListener(new OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { Toast.makeText(getApplicationContext(), "Some key pressed!", Toast.LENGTH_LONG).show(); if (event != null && (event.getKeyCode() == KeyEvent.KEYCODE

How to set Min text (Mandatory) and Max text in EditText

邮差的信 提交于 2019-12-21 03:36:16
问题 In my EditText field, I want to give some min text as mandatory and max text as the limit, is there any way to achieve that? If one is to type text, the numeric count has to decrease. How would I do that? <EditText android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/textView1" android:layout_marginTop="24dp" android:maxLength="175" android:ems="10" /> this is my adding activity

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"

EditText with single text line, line wrapping and Done action?

≯℡__Kan透↙ 提交于 2019-12-21 03:14:16
问题 I am trying to have an EditText with the following characteristics when editing with a soft key. I ready the documentation, searched here, play with the parameters but could not find a working configuration. The EditView view on the screen has height for a few lines (e.g. 3-4). The content text is a single line (that is, no line breaks). If the content text is longer than the view's width it should wrap to next line The Enter key of the soft key shows the Done action label. I could achieve {1