package com.applovin.impl; import android.content.Context; import android.net.Uri; import android.webkit.URLUtil; import android.widget.ImageView; import com.applovin.impl.sdk.utils.ImageViewUtils; import java.util.HashSet; import java.util.Set; /* loaded from: classes.dex */ public class gq { public final Set a = new HashSet(); public final Set b = new HashSet(); private Uri c; private Uri d; private int e; private int f; public Set a() { return this.a; } public Uri b() { return this.d; } public int c() { return this.f; } public Uri d() { return this.c; } public Set e() { return this.b; } public int f() { return this.e; } public String toString() { return "VastIndustryIcon{imageUri='" + d() + "', clickUri='" + b() + "', width=" + f() + ", height=" + c() + "}"; } public static gq a(es esVar, com.applovin.impl.sdk.j jVar) { if (esVar == null) { throw new IllegalArgumentException("No node specified."); } if (jVar != null) { es c = esVar.c("StaticResource"); if (c != null && URLUtil.isValidUrl(c.d())) { gq gqVar = new gq(); gqVar.c = Uri.parse(c.d()); es b = esVar.b("IconClickThrough"); if (b != null && URLUtil.isValidUrl(b.d())) { gqVar.d = Uri.parse(b.d()); } String str = (String) esVar.a().get("width"); int i = 0; int parseInt = (str == null || Integer.parseInt(str) <= 0) ? 0 : Integer.parseInt(str); String str2 = (String) esVar.a().get("height"); if (str2 != null && Integer.parseInt(str2) > 0) { i = Integer.parseInt(str2); } int intValue = ((Integer) jVar.a(sj.a5)).intValue(); if (parseInt <= 0 || i <= 0) { gqVar.f = intValue; gqVar.e = intValue; } else { double d = parseInt / i; int min = Math.min(Math.max(parseInt, i), intValue); if (parseInt >= i) { gqVar.e = min; gqVar.f = (int) (min / d); } else { gqVar.f = min; gqVar.e = (int) (min * d); } } return gqVar; } jVar.J(); if (!com.applovin.impl.sdk.n.a()) { return null; } jVar.J().b("VastIndustryIcon", "Unable to create industry icon. No valid image URL found."); return null; } throw new IllegalArgumentException("No sdk specified."); } public static ImageView a(Uri uri, Context context, com.applovin.impl.sdk.j jVar) { ImageView imageView = new ImageView(context); imageView.setScaleType(ImageView.ScaleType.FIT_XY); imageView.setClickable(true); imageView.setVisibility(8); ImageViewUtils.setImageUri(imageView, uri, jVar); return imageView; } }