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

No Background Color change Dynamically #20

Closed
RishabhRawatAndroid opened this issue Jun 30, 2018 · 1 comment
Closed

No Background Color change Dynamically #20

RishabhRawatAndroid opened this issue Jun 30, 2018 · 1 comment

Comments

@RishabhRawatAndroid
Copy link

I am creating an app which I use this library for adding the cart item but the problem is button colour not change in dynamically. I use this code but not change the color

numberButton.setOnValueChangeListener(new ElegantNumberButton.OnValueChangeListener() {
                @Override
                public void onValueChange(ElegantNumberButton view, int oldValue, int newValue) {
                    if(newValue!=0)
                        numberButton.setBackgroundColor(getResources().getColor(R.color.lime_green));
                    else
                        numberButton.setBackgroundColor(getResources().getColor(R.color.yellow));
                }
            });
@RishabhRawatAndroid
Copy link
Author

I notice that your code has a method updateColors but this method is not available in 1.0.2 version library.

 public void updateColors(int backgroundColor, int textColor) {
        this.textView.setBackgroundColor(backgroundColor);
        this.addBtn.setBackgroundColor(backgroundColor);
        this.subtractBtn.setBackgroundColor(backgroundColor);

        this.textView.setTextColor(textColor);
        this.addBtn.setTextColor(textColor);
        this.subtractBtn.setTextColor(textColor);
    }

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

1 participant