I have been looking on how to highlight a focused edit text form field in an Android app.
When I focus my email field, there is no visual feedback.
What sort of visual feedback should I provide ? Is there a standard on what the user expects ?
I was thinking of some background color highlight or some field border color.
Any way to achieve this ?
My layout is:
<EditText
android:id="@+id/login_email_edittext"
style="@style/editext_graybg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_username"
android:drawableStart="@drawable/ic_username"
android:hint="@string/login_email_hint" >
<requestFocus />
</EditText>
And the style:
<style name="editext_graybg" parent="android:Widget.EditText">
<item name="android:background">@drawable/editext_bg_gray</item>
<item name="android:drawablePadding">@dimen/pad_10dp</item>
<item name="android:ems">10</item>
<item name="android:inputType">textEmailAddress</item>
<item name="android:paddingLeft">@dimen/pad_10dp</item>
<item name="android:paddingRight">@dimen/pad_10dp</item>
<item name="android:textColor">@color/black</item>
<item name="android:textSize">@dimen/txt_18sp</item>
</style>
EDIT: I tried the following solution but it is not satisfactory as it reduces the size of my beautifully styled field:
I added textfield_selected.9.png image file into the drawable/ folder, I added a edit_text.xml file in the drawable/ folder containing a <item android:drawable="@drawable/textfield_selected" android:state_enabled="true" android:state_focused="true" />
and I added the attribute android:background="@drawable/edit_text" to my field. But the field is too small now. Using an image for this styling overwrites my existing styling. Is there any way to do this without an image ?