@@ -18,7 +18,105 @@ TODO (waiting for jcenter approval)
1818
1919## API Docs
2020
21- TODO
21+ The library provides 3 widget with extended functionality for the drawables.
22+
23+ Those are:
24+
25+ ``` ClickDrawableTextView ```
26+
27+ ``` ClickDrawableEditText ```
28+
29+ ``` ClickDrawableAutoCompleteTextView ```
30+
31+ Each of them it's extending the ``` AppCompat ``` counterpart for max
32+ compatibility with every SDK version.
33+
34+ You can add a ``` CsDrawable ``` via XML or via Code, below i will show you both the implementations
35+
36+ #### XML
37+ After had declared
38+ ```
39+ xmlns:app="http://schemas.android.com/apk/res-auto"
40+ ```
41+ in the top parent layout you can specify all those properties
42+
43+ ```
44+ <com.matpag.clickdrawabletextview.ClickDrawableEditText
45+ android:id="@+id/click_drawable_edit_text"
46+ android:layout_width="match_parent"
47+ android:layout_height="wrap_content"
48+ android:layout_marginStart="10dp"
49+ android:drawablePadding="10dp"
50+ app:csStartDrawable="@drawable/close_blue"
51+ app:csStartDrawableHeight="50dp"
52+ app:csStartDrawableWidth="80dp"
53+ app:csEndDrawable="@drawable/close_blue"
54+ app:csEndDrawableHeight="50dp"
55+ app:csEndDrawableWidth="50dp"
56+ app:csTopDrawable="@drawable/close_blue"
57+ app:csTopDrawableHeight="40dp"
58+ app:csTopDrawableWidth="20dp"
59+ app:csBottomDrawable="@drawable/close_blue"
60+ app:csBottomDrawableHeight="30dp"
61+ app:csBottomDrawableWidth="30dp"
62+ app:csEnableRTL="true"
63+ />
64+ ```
65+
66+ To add a ``` CsDrawable ``` you can use:
67+ ```
68+ app:csStartDrawable
69+ app:csEndDrawable
70+ app:csTopDrawable
71+ app:csBottomDrawable
72+ ```
73+ providing a reference to a drawable of any type.
74+
75+ If you don't specify any size for the drawable, automatically the drawable will be sized
76+ to the width and height of the drawable itself (alled ** intrinsic** in the android
77+ platform).
78+
79+ If you dont want to resize your original drawable resource, i suggest you to
80+ add the width and the height you need for the drawable/s you added using respectively:
81+ ```
82+ app:csStartDrawableHeight
83+ app:csStartDrawableWidth
84+ ```
85+ for the ** Start** drawable
86+ ```
87+ app:csEndDrawableHeight
88+ app:csEndDrawableWidth
89+ ```
90+ for the ** End** drawable
91+ ```
92+ app:csTopDrawableHeight
93+ app:csTopDrawableWidth
94+ ```
95+ for the ** Top** drawable
96+ ```
97+ app:csBottomDrawableHeight
98+ app:csBottomDrawableWidth
99+ ```
100+ for the ** Bottom** drawable.
101+
102+ If you need to handle the initial visibility of the drawable you can use
103+ ```
104+ app:csStartDrawableVisible
105+ app:csEndDrawableVisible
106+ app:csTopDrawableVisible
107+ app:csBottomDrawableVisible
108+ ```
109+ with ``` true ``` (default) or ``` false ``` attribute
110+
111+ If you need to support RTL locales, you can enable it with
112+ ```
113+ app:csEnableRTL="true"
114+ ```
115+ with ``` true ``` (default in the next release) or ``` false ``` attribute.
116+
117+ Don't forget to enable the RTL support in your ``` AndroidManifest.xml ``` adding
118+ ``` android:supportsRtl="true" ``` to the * application* tag
119+
22120
23121## Author
24122
0 commit comments