alexandroid/decompiled/jadx/sources/com/google/android/material/resources/CancelableFontCallback.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

44 lines
1.4 KiB
Java

package com.google.android.material.resources;
import android.graphics.Typeface;
import androidx.annotation.RestrictTo;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
/* loaded from: classes7.dex */
public final class CancelableFontCallback extends TextAppearanceFontCallback {
private final ApplyFont applyFont;
private boolean cancelled;
private final Typeface fallbackFont;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public interface ApplyFont {
void apply(Typeface typeface);
}
public CancelableFontCallback(ApplyFont applyFont, Typeface typeface) {
this.fallbackFont = typeface;
this.applyFont = applyFont;
}
private void updateIfNotCancelled(Typeface typeface) {
if (this.cancelled) {
return;
}
this.applyFont.apply(typeface);
}
public void cancel() {
this.cancelled = true;
}
@Override // com.google.android.material.resources.TextAppearanceFontCallback
public void onFontRetrievalFailed(int i) {
updateIfNotCancelled(this.fallbackFont);
}
@Override // com.google.android.material.resources.TextAppearanceFontCallback
public void onFontRetrieved(Typeface typeface, boolean z) {
updateIfNotCancelled(typeface);
}
}