skydoves / ColorPickerView

🎨 Android colorpicker for getting colors from any images by tapping on the desired color.
Apache License 2.0
1.58k stars 212 forks source link

Finger release trigger #17

Closed ViorelOnica closed 5 years ago

ViorelOnica commented 5 years ago

Hello !

Is there any method that will trigger the cursor release after selecting the color?

I tried using this but onTouch never gets triggered image

skydoves commented 5 years ago

@ViorelOnica Hello! Just using the below method will resolve your issue!

.setACTION_UP(true)
ViorelOnica commented 5 years ago

Hmm, is it normal that onColorSelected gets called twice before any actual ACTION_UP (cursor release) ? I get 2 logs before touching the palette, but then it works fine. colorPickerView.setACTON_UP(true); colorPickerView.setColorListener(new ColorListener() { @Override public void onColorSelected(ColorEnvelope colorEnvelope) { Log.d("asdf",colorEnvelope.getColorHtml()); } });

Anyway, I can solve it with a counter++ , it's not a serious problem. Instead, I'd like to know if there's any way to add padding to the XML ColorPicker. I'm asking this because the selector has a heavy dragging motion along the circle edge.

<com.skydoves.colorpickerpreference.ColorPickerView android:id="@+id/colorPickerView" android:layout_width="200dp" android:layout_height="200dp" app:palette="@drawable/palette" app:selector="@drawable/wheel" />

skydoves commented 5 years ago

@ViorelOnica Hi, sorry for the late reply. "A heavy dragging motion along the circle edge" is solved on the new version! Thank you for your issue.