- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
75 lines
2.4 KiB
Java
75 lines
2.4 KiB
Java
package com.mbridge.msdk.widget;
|
|
|
|
import android.annotation.SuppressLint;
|
|
import android.content.Context;
|
|
import android.graphics.Bitmap;
|
|
import android.graphics.Canvas;
|
|
import android.util.AttributeSet;
|
|
import android.widget.ImageView;
|
|
import androidx.annotation.Nullable;
|
|
import com.mbridge.msdk.foundation.same.c.b;
|
|
import com.mbridge.msdk.foundation.same.c.c;
|
|
import com.mbridge.msdk.foundation.tools.af;
|
|
|
|
@SuppressLint({"AppCompatCustomView"})
|
|
/* loaded from: classes4.dex */
|
|
public class MBImageView extends ImageView {
|
|
private Bitmap a;
|
|
private String b;
|
|
|
|
public void setImageUrl(String str) {
|
|
this.b = str;
|
|
}
|
|
|
|
public MBImageView(Context context) {
|
|
super(context);
|
|
this.a = null;
|
|
}
|
|
|
|
public MBImageView(Context context, @Nullable AttributeSet attributeSet) {
|
|
super(context, attributeSet);
|
|
this.a = null;
|
|
}
|
|
|
|
public MBImageView(Context context, @Nullable AttributeSet attributeSet, int i) {
|
|
super(context, attributeSet, i);
|
|
this.a = null;
|
|
}
|
|
|
|
@Override // android.widget.ImageView, android.view.View
|
|
public void onDraw(Canvas canvas) {
|
|
Bitmap bitmap = this.a;
|
|
if (bitmap != null && bitmap.isRecycled()) {
|
|
af.b("mb-widget-imageview", "onDraw bitmap recycled");
|
|
if (getContext() != null) {
|
|
b.a(getContext()).a(this.b, new c() { // from class: com.mbridge.msdk.widget.MBImageView.1
|
|
@Override // com.mbridge.msdk.foundation.same.c.c
|
|
public final void onSuccessLoad(Bitmap bitmap2, String str) {
|
|
MBImageView.this.setImageBitmap(bitmap2);
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.foundation.same.c.c
|
|
public final void onFailedLoad(String str, String str2) {
|
|
af.b("mb-widget-imageview", str2 + " load failed:" + str);
|
|
}
|
|
});
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
super.onDraw(canvas);
|
|
}
|
|
|
|
@Override // android.widget.ImageView
|
|
public void setImageBitmap(Bitmap bitmap) {
|
|
this.a = bitmap;
|
|
if (bitmap != null && bitmap.isRecycled()) {
|
|
this.a = null;
|
|
super.setImageBitmap(null);
|
|
af.b("mb-widget-imageview", "setImageBitmap recycled");
|
|
return;
|
|
}
|
|
super.setImageBitmap(bitmap);
|
|
}
|
|
}
|