8000 fix(android): Formatted string NoSuchMethodError · NativeScript/NativeScript@5798025 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5798025

Browse files
committed
fix(android): Formatted string NoSuchMethodError
1 parent 04aa2ba commit 5798025

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed
Binary file not shown.

packages/ui-mobile-base/android/widgets/src/main/java/org/nativescript/widgets/CustomTypefaceSpan.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77

88
/**
99
* Created by hhristov on 2/27/17.
10-
* Updated by CatchABus on 1/26/25.
1110
*/
1211
@SuppressLint("ParcelCreator")
1312
public class CustomTypefaceSpan extends TypefaceSpan {
13+
private final Typeface typeface;
14+
1415
public CustomTypefaceSpan(Typeface typeface) {
15-
super(typeface);
16+
super((String)null);
17+
this.typeface = typeface;
1618
}
1719

1820
public void updateDrawState(TextPaint ds) {
@@ -27,7 +29,7 @@ private void applyCustomTypeFace(TextPaint paint) {
2729
final Typeface old = paint.getTypeface();
2830
final int oldStyle = (old == null) ? 0 : old.getStyle();
2931

30-
Typeface typeface = this.getTypeface();
32+
Typeface typeface = this.typeface;
3133
int fake = oldStyle & ~typeface.getStyle();
3234
if ((fake & android.graphics.Typeface.BOLD) != 0) {
3335
paint.setFakeBoldText(true);
@@ -39,4 +41,4 @@ private void applyCustomTypeFace(TextPaint paint) {
3941

4042
paint.setTypeface(typeface);
4143
}
42-
}
44+
}

0 commit comments

Comments
 (0)
0