fix(android): formatted string NoSuchMethodError (#10704)

This commit is contained in:
Dimitris-Rafail Katsampas
2025-02-22 00:36:12 +02:00
committed by GitHub
parent 04aa2bacbc
commit 358791795f
2 changed files with 6 additions and 4 deletions

View File

Binary file not shown.

View File

@@ -7,12 +7,14 @@ import android.text.style.TypefaceSpan;
/**
* Created by hhristov on 2/27/17.
* Updated by CatchABus on 1/26/25.
*/
@SuppressLint("ParcelCreator")
public class CustomTypefaceSpan extends TypefaceSpan {
private final Typeface typeface;
public CustomTypefaceSpan(Typeface typeface) {
super(typeface);
super((String)null);
this.typeface = typeface;
}
public void updateDrawState(TextPaint ds) {
@@ -27,7 +29,7 @@ public class CustomTypefaceSpan extends TypefaceSpan {
final Typeface old = paint.getTypeface();
final int oldStyle = (old == null) ? 0 : old.getStyle();
Typeface typeface = this.getTypeface();
Typeface typeface = this.typeface;
int fake = oldStyle & ~typeface.getStyle();
if ((fake & android.graphics.Typeface.BOLD) != 0) {
paint.setFakeBoldText(true);