I want to be able to see the cursor all the time. No blinking, and no hiding.
I could extend editText and get into rendering a graphic and of-setting it as the text is written but this is just a pain and will need redundant work to recognise user taps / cursor moves.
To be clear
editText.setCursorVisible(false);
Is not the answer I am looking for.
Possibly it could be set in the XMl drawable file?
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<size android:width="1dp" />
<stroke android:color="@android:color/black"/>
<solid android:color="@android:color/black"/>
</shape>
but this seems unlikely.
Here is the editText
<AutoCompleteTextView
android:id="@+id/input_text"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:textSize="7mm"
android:drawableRight="@drawable/clear_tran"
android:drawableEnd="@drawable/clear_tran"
android:background="@android:color/transparent"
android:cursorVisible="true"
android:textCursorDrawable="@drawable/cursor"
android:text=""
android:autoLink="none"
android:textAppearance="@android:style/TextAppearance.Holo.Medium"
android:clickable="true"
android:inputType="text|textNoSuggestions"
android:layout_weight="1"
android:textStyle="normal"
android:singleLine="true"
android:textIsSelectable="false"
android:layout_marginLeft="2mm"
android:layout_marginRight="2mm"
android:layout_marginBottom="1mm"/>
Any suggestions from the meta-mind? All my googles are just returning how to hide the cursor.
I will keep investigating and return with my results.
Okay, seems the API does not allow a static cursor. I created my own extension of the AutoCompleteTextView which renders a cursor which never blinks. (You can use the same code to extend a noemal EditText or other derivative)
Bewarned if you want to have a multiline edit text then the height parameters will need some extra work. I have assumed one line and centered the height on the text box.
Usage is like this
Hope this helps someone.