Skip to content

Commit 7232784

Browse files
committed
comments, and test: emulator working fine
1 parent 8bad7f9 commit 7232784

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

library/src/main/java/com/stringcare/library/SCTextView.java

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ public SCTextView(Context context, AttributeSet attrs, int defStyleAttr) {
3636
loadText(attrs);
3737
}
3838

39+
/**
40+
* Defines initial vars
41+
* @param attrs {AttributeSet}
42+
*/
3943
private void loadText(final AttributeSet attrs) {
4044
text = attrs.getAttributeValue("http://schemas.android.com/apk/res/android", "text");
4145
if (isHTML == null) {
@@ -47,6 +51,9 @@ private void loadText(final AttributeSet attrs) {
4751
reloadText();
4852
}
4953

54+
/**
55+
* Prints text with the given conditions
56+
*/
5057
private void reloadText() {
5158
if (text != null) {
5259
try {
@@ -71,23 +78,36 @@ public void contextReady() {
7178
}
7279
}
7380

81+
/**
82+
* Enables de-obfuscation before print the value
83+
* @param visible {true|false}
84+
*/
7485
public void visible(boolean visible) {
7586
this.visible = visible;
7687
reloadText();
7788
}
7889

90+
/**
91+
* Enables HTML printing
92+
* @param enabled {true|false}
93+
*/
7994
public void htmlEnabled(boolean enabled) {
8095
isHTML = enabled;
81-
if (visible == null) {
82-
visible = true;
83-
}
8496
reloadText();
8597
}
8698

99+
/**
100+
* Returns true if is the value must be print as HTML or plain text
101+
* @return Boolean
102+
*/
87103
public boolean isHtmlEnabled() {
88104
return isHTML;
89105
}
90106

107+
/**
108+
* Returns true if is de-obfuscating the value before print it
109+
* @return Boolean
110+
*/
91111
public boolean isVisible() {
92112
return visible;
93113
}

0 commit comments

Comments
 (0)