Skip to content
This repository has been archived by the owner on Jul 10, 2020. It is now read-only.

Commit

Permalink
Merge pull request #20 from G00fY2/develop
Browse files Browse the repository at this point in the history
fix programmatically setting the label background
  • Loading branch information
jahirfiquitiva authored Jan 1, 2018
2 parents 37f8e8a + c7099f7 commit 081554d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,19 @@ public int getTextColor() {
}

public void setTextColor(@ColorInt int color) {
this.textColor = color;
textColor = color;
content.setTextColor(color);
}

public void setTextColorFromRes(@ColorRes int color) {
setTextColor(ContextCompat.getColor(getContext(), color));
}

public void setBackgroundColor(@ColorInt int backgroundColor) {
rightBackgroundColor = backgroundColor;
setCardBackgroundColor(0);
}

@Override
public void setCardBackgroundColor(@ColorInt int ignored) {
super.setCardBackgroundColor(rightBackgroundColor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ public int getTitleBackgroundColor() {
public void setTitleBackgroundColor(@ColorInt int titleBackgroundColor) {
this.titleBackgroundColor = titleBackgroundColor;
LabelView label = getLabelView();
if (label != null && label.getContent() != null) {
label.getContent().setBackgroundColor(titleBackgroundColor);
if (label != null) {
label.setBackgroundColor(titleBackgroundColor);
}
}

Expand Down

0 comments on commit 081554d

Please sign in to comment.