Skip to content

Commit

Permalink
fix(android): now the properties order is html/text/formattedString(c…
Browse files Browse the repository at this point in the history
…hildren)
  • Loading branch information
farfromrefug committed Sep 18, 2024
1 parent 09063b5 commit f6fadd2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/label.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,18 +470,20 @@ export class Label extends LabelBase {
if (this.html) {
transformedText = this.createHTMLString();
textProperty.nativeValueChange(this, this.html === null || this.html === undefined ? '' : this.html);
} else if (this.text) {
if (this.text instanceof java.lang.CharSequence || this.text instanceof android.text.Spanned) {
transformedText = this.text;
} else {
const text = this.text;
const stringValue = text === null || text === undefined ? '' : text.toString();
transformedText = getTransformedText(stringValue, this.textTransform);
}
} else if (this.formattedText) {
transformedText = this.createFormattedTextNative(this.formattedText);
textProperty.nativeValueChange(
this,
this.formattedText === null || this.formattedText === undefined ? '' : this.formattedText.toString()
);
} else if (this.text instanceof java.lang.CharSequence || this.text instanceof android.text.Spanned) {
transformedText = this.text;
} else {
const text = this.text;
const stringValue = text === null || text === undefined ? '' : text.toString();
transformedText = getTransformedText(stringValue, this.textTransform);
}
this.nativeTextViewProtected.setLabelText(transformedText);
}
Expand Down

0 comments on commit f6fadd2

Please sign in to comment.