You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
override fun onColorSelected(color: Int, colorHex: String) {
163
+
// Handle Color Selection
164
+
}
165
+
})
166
+
.show();
121
167
```
122
168
123
-
Where**R.array.themeColors**is defined as below
169
+
Where **R.array.themeColors** and **R.array.themeColorHex** are defined as below
124
170
125
171
```xml
126
172
<arrayname="themeColors">
@@ -130,7 +176,88 @@ Yet another Color Picker Library for Android. It is highly customizable and easy
130
176
<item>@color/grey_500</item>
131
177
<item>@color/orange_500</item>
132
178
</array>
179
+
180
+
<string-arrayname="themeColorHex">
181
+
<item>#f6e58d</item>
182
+
<item>#ffbe76</item>
183
+
<item>#ff7979</item>
184
+
<item>#badc58</item>
185
+
<item>#dff9fb</item>
186
+
<item>#7ed6df</item>
187
+
<item>#e056fd</item>
188
+
<item>#686de0</item>
189
+
<item>#30336b</item>
190
+
<item>#95afc0</item>
191
+
</string-array>
133
192
```
193
+
* You can set the Dismiss listener
194
+
195
+
**ColorPicker**
196
+
197
+
```kotlin
198
+
// Kotlin Code
199
+
ColorPickerDialog
200
+
.Builder(requireActivity())
201
+
.setDismissListener {
202
+
// Handle Dismiss Event
203
+
}
204
+
.show()
205
+
```
206
+
207
+
```java
208
+
// Java Code
209
+
new ColorPickerDialog
210
+
.Builder(this)
211
+
.setDismissListener(new DismissListener() {
212
+
@Override
213
+
public void onDismiss() {
214
+
// Handle Dismiss Event
215
+
}
216
+
})
217
+
.show();
218
+
````
219
+
220
+
**MaterialColorPicker**
221
+
222
+
```kotlin
223
+
// Kotlin Code
224
+
MaterialColorPickerDialog
225
+
.Builder(this)
226
+
.setDismissListener {
227
+
// Handle Dismiss Event
228
+
}
229
+
.show()
230
+
```
231
+
232
+
```java
233
+
// Java Code
234
+
new MaterialColorPickerDialog
235
+
.Builder(this)
236
+
.setDismissListener(new DismissListener() {
237
+
@Override
238
+
public void onDismiss() {
239
+
// Handle Dismiss Event
240
+
}
241
+
})
242
+
.show();
243
+
```
244
+
* You can set the Tick color for each card. This will come handy when color list include black or white colors. By default tick color will be either black or white based on the color darkness. If more dark colors the tick color will be white else black.
245
+
246
+
```kotlin
247
+
// Kotlin Code
248
+
MaterialColorPickerDialog
249
+
.Builder(this)
250
+
.setTickColorPerCard(true) // Default will be false
251
+
.show()
252
+
```
253
+
254
+
```java
255
+
// Java Code
256
+
new MaterialColorPickerDialog
257
+
.Builder(this)
258
+
.setTickColorPerCard(true) // Default will be false
259
+
.show();
260
+
```
134
261
135
262
# 💥Compatibility
136
263
@@ -139,13 +266,19 @@ Yet another Color Picker Library for Android. It is highly customizable and easy
* App icon made by [Nikita Golubev](https://www.flaticon.com/authors/nikita-golubev "Nikita Golubev") from [Flaticon](https://www.flaticon.com/free-icon/color-circle_1831908?term=color&page=1&position=1&related_item_id=1831908)
292
+
157
293
### Let us know!
158
294
159
295
We'll be really happy if you sent us links to your projects where you use our component. Just send an email to **[email protected]** And do let us know if you have any questions or suggestion regarding the library.
0 commit comments