|
1 | 1 | <h1> Sigmapoint Custom Button </h1>
|
2 | 2 |
|
3 |
| -<p> If you want start use this button, you must clone or download this repository. Next in Android Studio File -> New -> Import module. |
| 3 | +<p> If you want start use this button, you must clone or download this repository. <br> |
| 4 | +Next in Android Studio File -> New -> Import module. |
4 | 5 | Then select library folder from project. And start use. </p>
|
5 | 6 | <p> >=API 8 </p>
|
6 | 7 |
|
@@ -51,51 +52,51 @@ This is the base tag of CustomButton:<br>
|
51 | 52 | android:text="text"/>
|
52 | 53 | ```
|
53 | 54 | <p> You can specify the following things: <br>
|
54 |
| -`cb_primary_color` - you can specify only two colors for all button. But it will be override by background, text, frame color. {format - color} <br> |
55 |
| -`cb_secondary_color` - you can specify only two colors for all button. But it will be override by background, text, frame color. {format - color} <br> |
56 |
| -`cb_background` - background color of normal button {format - color} <br> |
57 |
| -`cb_background_pressed` - background color of pressed button {format - color} <br> |
58 |
| -`cb_background_disabled` - background color of disabled button {format - color} <br> |
59 |
| -`cb_background_state_list` - {format - ColorStateList} <br> |
| 55 | +cb_primary_color - you can specify only two colors for all button. But it will be override by background, text, frame color. {format - color} <br> |
| 56 | +cb_secondary_color - you can specify only two colors for all button. But it will be override by background, text, frame color. {format - color} <br> |
| 57 | +cb_background - background color of normal button {format - color} <br> |
| 58 | +cb_background_pressed - background color of pressed button {format - color} <br> |
| 59 | +cb_background_disabled - background color of disabled button {format - color} <br> |
| 60 | +cb_background_state_list - {format - ColorStateList} <br> |
60 | 61 | <br>
|
61 |
| -`cb_text_color_pressed` - color of pressed text {format - color} <br> |
62 |
| -`cb_text_color_disabled` - color of disabled text {format - color} <br> |
63 |
| -`cb_text_color` or `android:textColor` - color of normal text {format - color} <br> |
64 |
| -`cb_text_size` - {format - dimension} <br> |
65 |
| -`cb_text_padding` - {format - dimension} <br> |
66 |
| -`cb_text_padding_left` - {format - dimension} <br> |
67 |
| -`cb_text_padding_top` - {format - dimension} <br> |
68 |
| -`cb_text_padding_right` - {format - dimension} <br> |
69 |
| -`cb_text_padding_bottom` - {format - dimension} <br> |
70 |
| -`cb_text_weight` - {format - integer} <br> |
71 |
| -`cb_text_center` or `android:textAlignment` - only works when image weight doesn't specify. Center text in button. {format - boolean or only "center" value} <br> |
| 62 | +cb_text_color_pressed - color of pressed text {format - color} <br> |
| 63 | +cb_text_color_disabled - color of disabled text {format - color} <br> |
| 64 | +cb_text_color or android:textColor - color of normal text {format - color} <br> |
| 65 | +cb_text_size - {format - dimension} <br> |
| 66 | +cb_text_padding - {format - dimension} <br> |
| 67 | +cb_text_padding_left - {format - dimension} <br> |
| 68 | +cb_text_padding_top - {format - dimension} <br> |
| 69 | +cb_text_padding_right - {format - dimension} <br> |
| 70 | +cb_text_padding_bottom - {format - dimension} <br> |
| 71 | +cb_text_weight - {format - integer} <br> |
| 72 | +cb_text_center or android:textAlignment - only works when image weight doesn't specify. Center text in button. {format - boolean or only "center" value} <br> |
72 | 73 | <br>
|
73 |
| -`cb_shape_radius` - corner radius {format - dimension}<br> |
74 |
| -`cb_shape_type` - shape type, you can choose: rect or oval <br> |
75 |
| -`cb_frame_color` - {format - color} <br> |
76 |
| -`cb_frame_color_pressed` - {format - color} <br> |
77 |
| -`cb_frame_color_disabled` - {format - color} <br> |
78 |
| -`cb_frame_size` - frame height {format - dimension} <br> |
79 |
| -`cb_frame_state_list` - {format - ColorStateList} <br> |
| 74 | +cb_shape_radius - corner radius {format - dimension}<br> |
| 75 | +cb_shape_type - shape type, you can choose: rect or oval <br> |
| 76 | +cb_frame_color - {format - color} <br> |
| 77 | +cb_frame_color_pressed - {format - color} <br> |
| 78 | +cb_frame_color_disabled - {format - color} <br> |
| 79 | +cb_frame_size - frame height {format - dimension} <br> |
| 80 | +cb_frame_state_list - {format - ColorStateList} <br> |
80 | 81 | <br>
|
81 |
| -`cb_elevation_enabled` - on >=API 21 devices enable elvation (default) {format - boolean} <br> |
| 82 | +cb_elevation_enabled - on >=API 21 devices enable elvation (default) {format - boolean} <br> |
82 | 83 | <br>
|
83 |
| -`cb_image_position` - image position in button, can choose left, top, right, bottom <br> |
84 |
| -`cb_image` - image source {format - drawable or color} <br> |
85 |
| -`cb_image_normal` - normal state image source (if you choose cb_image, it will be override) {format - drawable or color} <br> |
86 |
| -`cb_image_disabled` - disabled state image source (if you choose cb_image, it will be override) {format - drawable or color} <br> |
87 |
| -`cb_image_pressed` - pressed state image source (if you choose cb_image, it will be override) {format - drawable or color} <br> |
88 |
| -`cb_image_color_normal` - only for image {format - color} <br> |
89 |
| -`cb_image_color_pressed` - only for image {format - color} <br> |
90 |
| -`cb_image_color_disable` - only for image {format - color} <br> |
91 |
| -`cb_image_color_list` - only for image {format - colorStateList} <br> |
92 |
| -`cb_image_padding` - {format - dimension} <br> |
93 |
| -`cb_image_padding_left` - {format - dimension} <br> |
94 |
| -`cb_image_padding_top` - {format - dimension} <br> |
95 |
| -`cb_image_padding_right` - {format - dimension} <br> |
96 |
| -`cb_image_padding_bottom` - {format - dimension} <br> |
97 |
| -`cb_image_scale_type` - {center, center_inside, center_crop, fit_center, fit_start, fit_end, fit_xy} <br> |
98 |
| -`cb_image_weight` - {format - integer} </p> |
| 84 | +cb_image_position - image position in button, can choose left, top, right, bottom <br> |
| 85 | +cb_image - image source {format - drawable or color} <br> |
| 86 | +cb_image_normal - normal state image source (if you choose cb_image, it will be override) {format - drawable or color} <br> |
| 87 | +cb_image_disabled - disabled state image source (if you choose cb_image, it will be override) {format - drawable or color} <br> |
| 88 | +cb_image_pressed - pressed state image source (if you choose cb_image, it will be override) {format - drawable or color} <br> |
| 89 | +cb_image_color_normal - only for image {format - color} <br> |
| 90 | +cb_image_color_pressed - only for image {format - color} <br> |
| 91 | +cb_image_color_disable - only for image {format - color} <br> |
| 92 | +cb_image_color_list - only for image {format - colorStateList} <br> |
| 93 | +cb_image_padding - {format - dimension} <br> |
| 94 | +cb_image_padding_left - {format - dimension} <br> |
| 95 | +cb_image_padding_top - {format - dimension} <br> |
| 96 | +cb_image_padding_right - {format - dimension} <br> |
| 97 | +cb_image_padding_bottom - {format - dimension} <br> |
| 98 | +cb_image_scale_type - {center, center_inside, center_crop, fit_center, fit_start, fit_end, fit_xy} <br> |
| 99 | +cb_image_weight - {format - integer} </p> |
99 | 100 | <h3> Java Code </h3>
|
100 | 101 | ```java
|
101 | 102 | CustomButton(Context context, LayoutParams layoutParams, int primaryColor, int secondaryColor, Drawable icon)
|
@@ -143,5 +144,5 @@ LEFT, TOP, RIGHT, BOTTOM - for image position
|
143 | 144 | If you add image to the button, set frame and want to center text without respect frame you should set text padding same as frame size.
|
144 | 145 |
|
145 | 146 | <h2> Dependencies </h2>
|
146 |
| -In demo application <a href="https://github.com/yukuku/ambilwarna"> Ambil Warna Library</a> was used. |
| 147 | +In demo application [Ambil Warna](https://github.com/yukuku/ambilwarna) Library was used. |
147 | 148 |
|
0 commit comments