From 3c33baae767f3c0b9d0d94e737fee3d9d501973c Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Wed, 26 Feb 2020 02:22:14 +0600 Subject: [PATCH] Implement field background drawable attribute --- README.md | 9 ++++++ app/src/main/res/drawable/bottom_focused.xml | 10 ++++++ app/src/main/res/drawable/bottom_selected.xml | 10 ++++++ .../main/res/drawable/bottom_unfocused.xml | 10 ++++++ app/src/main/res/layout/activity_main.xml | 5 ++- .../pinentryedittext/PinEntryEditText.java | 32 +++++++++++++++++-- .../src/main/res/values/attrs.xml | 3 ++ 7 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/drawable/bottom_focused.xml create mode 100644 app/src/main/res/drawable/bottom_selected.xml create mode 100644 app/src/main/res/drawable/bottom_unfocused.xml diff --git a/README.md b/README.md index 4ba00d8..9c14953 100644 --- a/README.md +++ b/README.md @@ -104,4 +104,13 @@ PinEntryEditText support all normal editText attributes, It also supports follow + + + + + + + + + ``` diff --git a/app/src/main/res/drawable/bottom_focused.xml b/app/src/main/res/drawable/bottom_focused.xml new file mode 100644 index 0000000..e7754a6 --- /dev/null +++ b/app/src/main/res/drawable/bottom_focused.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bottom_selected.xml b/app/src/main/res/drawable/bottom_selected.xml new file mode 100644 index 0000000..d5307b7 --- /dev/null +++ b/app/src/main/res/drawable/bottom_selected.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bottom_unfocused.xml b/app/src/main/res/drawable/bottom_unfocused.xml new file mode 100644 index 0000000..29b88b6 --- /dev/null +++ b/app/src/main/res/drawable/bottom_unfocused.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 534c49a..58f851f 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -28,7 +28,10 @@ app:lineCornerRadius="4dp" app:lineWidth="2dp" app:selectedStateLineColor="@android:color/holo_red_dark" - app:unFocusedStateLineColor="@android:color/darker_gray" /> + app:unFocusedStateLineColor="@android:color/darker_gray" + app:unFocusedStateBackgroundDrawable="@drawable/bottom_unfocused" + app:focusedStateBackgroundDrawable="@drawable/bottom_focused" + app:selectedStateBackgroundDrawable="@drawable/bottom_selected"/> + + + \ No newline at end of file