Skip to content

Commit

Permalink
Merge pull request #4498 from bijupmb/TIMOB-14567-ColorToNullOnLabelC…
Browse files Browse the repository at this point in the history
…hangeToTransparent

TIMOB-14567 changed default color to black and add null value checking in propertyChanged method
  • Loading branch information
hieupham007 committed Aug 12, 2013
2 parents ba2ff64 + 43b7d8b commit 99bba2b
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ protected void onLayout(boolean changed, int left, int top, int right, int botto
tv.setFocusable(false);
tv.setSingleLine(false);
TiUIHelper.styleText(tv, null);
defaultColor = tv.getCurrentTextColor();
defaultColor = tv.getCurrentTextColor();
setNativeView(tv);

}
Expand Down Expand Up @@ -142,7 +142,11 @@ public void propertyChanged(String key, Object oldValue, Object newValue, KrollP
TiUIHelper.linkifyIfEnabled(tv, proxy.getProperty(TiC.PROPERTY_AUTO_LINK));
tv.requestLayout();
} else if (key.equals(TiC.PROPERTY_COLOR)) {
tv.setTextColor(TiConvert.toColor((String) newValue));
if (newValue == null) {
tv.setTextColor(defaultColor);
} else {
tv.setTextColor(TiConvert.toColor((String) newValue));
}
} else if (key.equals(TiC.PROPERTY_HIGHLIGHTED_COLOR)) {
tv.setHighlightColor(TiConvert.toColor((String) newValue));
} else if (key.equals(TiC.PROPERTY_TEXT_ALIGN)) {
Expand Down

0 comments on commit 99bba2b

Please sign in to comment.