Skip to content

Commit f6fadd2

Browse files
author
farfromrefug
committed
fix(android): now the properties order is html/text/formattedString(children)
1 parent 09063b5 commit f6fadd2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Diff for: src/label.android.ts

+8-6
Original file line numberDiff line numberDiff line change
@@ -470,18 +470,20 @@ export class Label extends LabelBase {
470470
if (this.html) {
471471
transformedText = this.createHTMLString();
472472
textProperty.nativeValueChange(this, this.html === null || this.html === undefined ? '' : this.html);
473+
} else if (this.text) {
474+
if (this.text instanceof java.lang.CharSequence || this.text instanceof android.text.Spanned) {
475+
transformedText = this.text;
476+
} else {
477+
const text = this.text;
478+
const stringValue = text === null || text === undefined ? '' : text.toString();
479+
transformedText = getTransformedText(stringValue, this.textTransform);
480+
}
473481
} else if (this.formattedText) {
474482
transformedText = this.createFormattedTextNative(this.formattedText);
475483
textProperty.nativeValueChange(
476484
this,
477485
this.formattedText === null || this.formattedText === undefined ? '' : this.formattedText.toString()
478486
);
479-
} else if (this.text instanceof java.lang.CharSequence || this.text instanceof android.text.Spanned) {
480-
transformedText = this.text;
481-
} else {
482-
const text = this.text;
483-
const stringValue = text === null || text === undefined ? '' : text.toString();
484-
transformedText = getTransformedText(stringValue, this.textTransform);
485487
}
486488
this.nativeTextViewProtected.setLabelText(transformedText);
487489
}

0 commit comments

Comments
 (0)