Skip to content

Commit 60a1abd

Browse files
authored
Merge pull request hanks-zyh#47 from PGMacDesign/master
Bugfix for setTextColor
2 parents edf2a2d + b1d2765 commit 60a1abd

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

htextview-library/src/main/java/com/hanks/htextview/HTextView.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,15 @@ public void setAnimateType(HTextViewType type) {
161161
initHText(attrs, defStyle);
162162
}
163163

164+
165+
@Override
166+
public void setTextColor(@ColorInt int color) {
167+
//Check for RainbowText. Do not alter color if on that type due to paint conflicts
168+
if(animateType != 8){
169+
super.setTextColor(color);
170+
}
171+
}
172+
164173
@Override
165174
public Parcelable onSaveInstanceState() {
166175
Parcelable superState = super.onSaveInstanceState();

htextview-library/src/main/java/com/hanks/htextview/animatetext/HText.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ public abstract class HText implements IHText {
8282
drawFrame(canvas);
8383
}
8484

85+
public void setTextColor(int color){
86+
mHTextView.setTextColor(color);
87+
}
88+
8589
private void prepareAnimate() {
8690
mTextSize = mHTextView.getTextSize();
8791
mPaint.setTextSize(mTextSize);

0 commit comments

Comments
 (0)