Rabbit-R1/switch port/java/sources/androidx/appcompat/widget/TintResources.java

27 lines
968 B
Java
Raw Normal View History

2024-05-21 21:08:36 +00:00
package androidx.appcompat.widget;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import java.lang.ref.WeakReference;
/* loaded from: classes.dex */
class TintResources extends ResourcesWrapper {
private final WeakReference<Context> mContextRef;
public TintResources(Context context, Resources resources) {
super(resources);
this.mContextRef = new WeakReference<>(context);
}
@Override // androidx.appcompat.widget.ResourcesWrapper, android.content.res.Resources
public Drawable getDrawable(int i) throws Resources.NotFoundException {
Drawable drawableCanonical = getDrawableCanonical(i);
Context context = this.mContextRef.get();
if (drawableCanonical != null && context != null) {
ResourceManagerInternal.get().tintDrawableUsingColorFilter(context, i, drawableCanonical);
}
return drawableCanonical;
}
}