skydoves / ColorPickerPreference

🎨 A library that lets you implement ColorPicker, ColorPickerDialog, ColorPickerPreference.
Apache License 2.0
480 stars 51 forks source link

Custom image not working as picker on the latest version #28

Open miliath opened 3 years ago

miliath commented 3 years ago

Library version:

Devices:

Setting a custom color palette as a colorpicker (a custom image) will make the selected color always 0. This happens with a horseshoe shaped picker I have, but has also happend with other images. Also colorPickerView.setSelectorPoint(x,y), then doing colorPickerView.getColor(); where x,y is the current position of the color, yields 0. The selector is being set through the following line: colorPickerView.setPaletteDrawable(colorSelector); Where colorSelector is a drawable.

The expected behaviour would be to be able to set a custom color palette, as is possible in version 2.0.2, Do i have to add anything extra? I had a workaround to a problem with restricting the color selector that would allow me to set an x,y point and then call getColor() to know what color was selected, this is no longer possible since version 2.0.3.

With the deprecation of jCenter and 2.0.2 not being available on mavenCentral and the pom being broken, 2.0.2 can not be downloaded from jitpack.io i don't really know what to do to actually still be able to use 2.0.2 or get the newest versions to work..

miliath commented 3 years ago

When trying to get version 2.0.2 from jitpack, this error is displayed, changing 2.0.2 to 2.0.5 works fine, so there is likely something wrong with the configuration of 2.0.2

Execution failed for task ':app:checkDebugAarMetadata'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not resolve com.github.skydoves:colorpickerview:2.1.8. Required by: project :app > com.github.skydoves:ColorPickerPreference:2.0.2 Could not resolve com.github.skydoves:colorpickerview:2.1.8. Could not get resource 'https://dl.google.com/dl/android/maven2/com/github/skydoves/colorpickerview/2.1.8/colorpickerview-2.1.8.pom'. Could not HEAD 'https://dl.google.com/dl/android/maven2/com/github/skydoves/colorpickerview/2.1.8/colorpickerview-2.1.8.pom'. Remote host terminated the handshake

miliath commented 3 years ago

As i can see on the debugger, the image as palette is being set correctly, however, the selectedPoint is always 385,385 which i assume is the center, since the selected image is a horseshoe, the center is transparent. Despite the real point being set to 219,169, the colorPicker still mantains the 385,385 point. image