diff --git a/sparkbutton/src/main/java/com/varunest/sparkbutton/SparkButton.java b/sparkbutton/src/main/java/com/varunest/sparkbutton/SparkButton.java index a4b4596..60b035d 100644 --- a/sparkbutton/src/main/java/com/varunest/sparkbutton/SparkButton.java +++ b/sparkbutton/src/main/java/com/varunest/sparkbutton/SparkButton.java @@ -209,12 +209,12 @@ public void setChecked(boolean flag) { public void setInactiveImage(int inactiveResource){ this.imageResourceIdInactive = inactiveResource; - imageView.setImageResource(imageResourceIdInactive); + imageView.setImageResource(isChecked ? imageResourceIdActive : imageResourceIdInactive);; } public void setActiveImage(int activeResource){ this.imageResourceIdActive = activeResource; - imageView.setImageResource(imageResourceIdActive); + imageView.setImageResource(isChecked ? imageResourceIdActive : imageResourceIdInactive);; } public void setEventListener(SparkEventListener listener) {