mercredi 27 mai 2015

Highlighting a focused edit text

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>

Aucun commentaire:

Enregistrer un commentaire