Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if no colorListener than the sliders are not updated #102

Closed
DorBSoft opened this issue Jul 31, 2023 · 1 comment
Closed

if no colorListener than the sliders are not updated #102

DorBSoft opened this issue Jul 31, 2023 · 1 comment
Assignees

Comments

@DorBSoft
Copy link

If not setting colorListener to ColorPickerView, than the alpha and brightness sliders do not get updated.

This is the cause:

public void fireColorListener(@ColorInt int color, final boolean fromUser) {
    if (this.colorListener != null) {// <===== the bug
      this.selectedColor = color;
      if (getAlphaSlideBar() != null) {
        getAlphaSlideBar().notifyColor(); // <==== update of alpha slider
        this.selectedColor = getAlphaSlideBar().assembleColor();
      }
      if (getBrightnessSlider() != null) {
        getBrightnessSlider().notifyColor(); // <===== update of brightness slider
        this.selectedColor = getBrightnessSlider().assembleColor();
      }

The workaround is simple, just set a blank listener. But this issue is more serious than that, because it is hard to realize that this is the problem. Took me hours of debugging.

@skydoves
Copy link
Owner

skydoves commented Oct 2, 2023

This issue has been fixed in the version 2.3.0. Thanks for reporting!

@skydoves skydoves closed this as completed Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants