Skip to content

Commit

Permalink
Merge pull request #15 from peter9870/master
Browse files Browse the repository at this point in the history
Added image methods
  • Loading branch information
varunest authored Apr 4, 2017
2 parents 8039ef7 + 1a16c7d commit 0cd13ab
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,16 @@ public void setChecked(boolean flag) {
imageView.setImageResource(isChecked ? imageResourceIdActive : imageResourceIdInactive);
imageView.setColorFilter(isChecked ? activeImageTint : inActiveImageTint, PorterDuff.Mode.SRC_ATOP);
}

public void setInactiveImage(int inactiveResource){
this.imageResourceIdInactive = inactiveResource;
imageView.setImageResource(isChecked ? imageResourceIdActive : imageResourceIdInactive);;
}

public void setActiveImage(int activeResource){
this.imageResourceIdActive = activeResource;
imageView.setImageResource(isChecked ? imageResourceIdActive : imageResourceIdInactive);;
}

public void setEventListener(SparkEventListener listener) {
this.listener = listener;
Expand Down Expand Up @@ -307,4 +317,4 @@ private void getStuffFromXML(AttributeSet attr) {
// recycle typedArray
a.recycle();
}
}
}

0 comments on commit 0cd13ab

Please sign in to comment.