Skip to content

Instantly share code, notes, and snippets.

@duynhm
Created November 7, 2016 10:02
Show Gist options
  • Save duynhm/edbe2383d824eed5370a4f0f3085597f to your computer and use it in GitHub Desktop.
Save duynhm/edbe2383d824eed5370a4f0f3085597f to your computer and use it in GitHub Desktop.
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="0dp"
android:id="@+id/edt1"
style="@style/edt_otp"
/>
<!--style-->
<style name="edt_otp">
<item name="android:background">@drawable/bg_textview_box</item>
<item name="android:padding">@dimen/margin8dp</item>
<item name="android:hint">-</item>
<item name="android:gravity">center</item>
<item name="android:layout_marginLeft">10dp</item>
<item name="android:textColorHint">#FF303030</item>
<item name="android:maxLines">1</item>
<item name="android:maxLength">1</item>
<item name="android:inputType">number</item>
<item name="android:imeOptions">actionNext</item>
<item name="android:selectAllOnFocus">true</item>
</style>
<!--background-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true">
<shape>
<stroke android:width="1dp" android:color="@color/colorAccent" />
</shape>
</item>
<item>
<shape>
<stroke android:width="1dp" android:color="#dddddd" />
</shape>
</item>
</selector>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment