- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
69 lines
2.6 KiB
Java
69 lines
2.6 KiB
Java
package com.applovin.impl.sdk.nativeAd;
|
|
|
|
import android.annotation.SuppressLint;
|
|
import android.content.Context;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.net.Uri;
|
|
import android.os.StrictMode;
|
|
import android.view.LayoutInflater;
|
|
import android.view.ViewGroup;
|
|
import android.widget.FrameLayout;
|
|
import android.widget.ImageView;
|
|
import androidx.core.view.ViewCompat;
|
|
import com.applovin.impl.adview.AppLovinTouchToClickListener;
|
|
import com.applovin.impl.aq;
|
|
import com.applovin.impl.sdk.j;
|
|
import com.applovin.impl.sdk.n;
|
|
import com.applovin.impl.sdk.utils.ImageViewUtils;
|
|
import com.applovin.impl.sj;
|
|
import com.applovin.sdk.R;
|
|
|
|
@SuppressLint({"ViewConstructor"})
|
|
/* loaded from: classes2.dex */
|
|
public class AppLovinMediaView extends FrameLayout {
|
|
protected final ImageView imageView;
|
|
protected final n logger;
|
|
protected final j sdk;
|
|
|
|
public AppLovinMediaView(AppLovinNativeAdImpl appLovinNativeAdImpl, j jVar, Context context) {
|
|
super(context);
|
|
setBackgroundColor(ViewCompat.MEASURED_STATE_MASK);
|
|
this.sdk = jVar;
|
|
this.logger = jVar.J();
|
|
LayoutInflater.from(context).inflate(R.layout.applovin_native_ad_media_view, (ViewGroup) this, true);
|
|
Uri mainImageUri = appLovinNativeAdImpl.getMainImageUri();
|
|
aq vastAd = appLovinNativeAdImpl.getVastAd();
|
|
Uri t0 = vastAd != null ? vastAd.t0() : null;
|
|
if (mainImageUri == null && t0 == null) {
|
|
throw new IllegalStateException("AppLovin native ad missing image AND video resources");
|
|
}
|
|
StrictMode.ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
|
|
if (((Boolean) jVar.a(sj.Y2)).booleanValue()) {
|
|
setOnTouchListener(new AppLovinTouchToClickListener(jVar, sj.G0, context, appLovinNativeAdImpl));
|
|
} else {
|
|
setOnClickListener(appLovinNativeAdImpl);
|
|
}
|
|
ImageView imageView = (ImageView) findViewById(R.id.image_view);
|
|
this.imageView = imageView;
|
|
if (mainImageUri != null) {
|
|
ImageViewUtils.setAndDownscaleImageUri(imageView, mainImageUri);
|
|
}
|
|
StrictMode.setThreadPolicy(allowThreadDiskReads);
|
|
}
|
|
|
|
public void destroy() {
|
|
setOnClickListener(null);
|
|
setOnTouchListener(null);
|
|
removeAllViews();
|
|
}
|
|
|
|
public float getAspectRatio() {
|
|
Drawable drawable;
|
|
ImageView imageView = this.imageView;
|
|
if (imageView == null || (drawable = imageView.getDrawable()) == null) {
|
|
return 0.0f;
|
|
}
|
|
return drawable.getIntrinsicWidth() / drawable.getIntrinsicHeight();
|
|
}
|
|
}
|