android-edittext

How to change EditText pointer color (not cursor)

橙三吉。 提交于 2019-12-03 10:29:04
I'm trying to make the pointer color of EditText to become blue. I'm able to make the underline and the cursor to become blue, but the droplet looking pointer is still grey. I google a bit, but all the links that appear only talk about how to change the cursor, not the pointer. So if anybody knows how to do this, I need your help. I only need to support Android 5.0 and above. So if your solution only works on API > 21, that's totally fine. Thanks! in your styles.xml put like this: <item name="colorAccent">@color/blue</item> I recognize this is really late, but if all you want to do is change

EditText with suggestion list below

☆樱花仙子☆ 提交于 2019-12-03 10:23:19
I want to implement a "Google instant" like list in my app. Having an editText on top and a list below it, that is updated every time the user types in a new character. Can you point me to the right direction? Is there any widget or anything that I could use or do I have to drop the list and recreate it each time the users types something? Thanks in advance Mike Perhaps you are looking for an AutoCompleteTextView ? 来源: https://stackoverflow.com/questions/4903763/edittext-with-suggestion-list-below

Android Edittext- Clearing Spans

我是研究僧i 提交于 2019-12-03 10:05:57
I am trying to get an EditText to clear its spans by calling EditText.getText().clearSpans() . However, if I call this method, the EditText starts to behave strangely, with line feeds appearing as boxes and any spans I then set being in completely the wrong place. So my question is: How do I clear spans from and EditText? (Without calling setText()- the text may be thousands of lines long and its too slow to redraw it all frequently) Thanks very much! Had the same problem. Solved it by removing only the types of spans that I added to the EditText. I guess clearSpans removes more than it should

android edittext with drop down list

£可爱£侵袭症+ 提交于 2019-12-03 09:47:54
问题 I have an edittext which gets values from the user. I want to add an option which allows the user to choose from different options via drop down list when edittext is clicked. Does anyone have an idea how to do this? This is edittext code: <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="textPersonName" android:ems="10" android:id="@+id/dish_quantity" android:layout_below="@+id/dish_name" android:layout_alignParentRight="true" android

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

半世苍凉 提交于 2019-12-03 09:38:36
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,2,3} and {1,2,4} but not {1,2,3,4}. My rational is that since the content is a single line (no line

TextInputLayout and EditText double hint issue

孤人 提交于 2019-12-03 09:29:51
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" android:layout_height="wrap_content"> <EditText android:layout_width="match_parent" android:layout

Better way to get all the text in an EditText from an InputConnection?

泄露秘密 提交于 2019-12-03 09:26:44
问题 I've written an IME (InputMethodService) and I need to get all the text from the EditText it is editing. I know one way: InputConnection inputConnection = getCurrentInputConnection(); inputConnection.append(inputConnection.getTextBeforeCursor(9999, 0)) .append(inputConnection.getTextAfterCursor(9999, 0)); It works, but it seems pretty stupid and clunky. However there is no such method InputConnection.getText() . Is there a better way? P.S. I cannot access the EditText from my IME because it

EditText now showing under ListView

霸气de小男生 提交于 2019-12-03 09:07:08
Here is my layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <ListView android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@android:id/list" /> <EditText android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/search" android:hint="Filter results" /> What is causing my ListView to cover up my edit text? Perhaps try doing: <ListView android:layout_height="0dp"

Dynamic data for Adapter attached to EditText

点点圈 提交于 2019-12-03 09:01:27
Is there a way to attach dynamic adapter to EditText? What I want is - when a key is pressed on EditText, my code to do a search in (some) custom store and provide suggestions (instead of static Xml-list or array). This store is not a database; I think CursorAdapter is for database results only. Example code snippets are welcomed. ankitjaininfo I found the solution and posted the answer to this question . Write a custom SimpleCursorAdapter . Override runQueryOnBackgroundThread() method and return a new MatrixCursor based on the input contraint. Associate this adapter to the autocomplete

Saving data in edittext when hitting Back button

限于喜欢 提交于 2019-12-03 08:47:56
So on activity 1 I click a button that takes me to activity 2. In activity 2 I enter some data into an EditText. When I hit the back button on the phone it takes me to activity 1 which is correct but if I hit the activity 1 button again any text that I entered into the EditText is gone. I am sure this is because I am starting a new Intent every time I hit my button and I think I need to be using Flags but I am not certain. Below is my basic MainActivity1 and MainActivity2 without the code I tried that didn't work. **Edit: After exiting the app all saved data needs to be deleted. MainActivity1