Wolves Themes v1.0版本的 MD5 值为:cddc92b47f6b7c4a195c9625507eb51c
以下内容为反编译后的 ad.java 源代码,内容仅作参考
package com.appodeal.ads.utils;
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.VisibleForTesting;
import android.view.View;
import com.appodeal.ads.Appodeal;
import com.appodeal.ads.bf;
import com.appodeal.ads.utils.Log;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public class ad {
@VisibleForTesting
static Handler a = new Handler(Looper.getMainLooper());
@VisibleForTesting
static Map<View, a> b = new HashMap();
@VisibleForTesting
static Map<Object, View> c = new HashMap();
@VisibleForTesting
public static class a implements Runnable {
private View a;
private b b;
private int c;
private int d;
private boolean e;
private boolean f;
private final String g;
a(View view, int i, b bVar, String str) {
this.a = view;
this.b = bVar;
this.d = i;
this.g = str;
}
@Override
public void run() {
if (bf.a(Appodeal.e, this.a)) {
this.c += IronSourceConstants.INTERSTITIAL_DAILY_CAPPED;
if (!this.e && this.b != null) {
this.e = true;
this.b.a();
}
} else {
if (!this.f) {
Appodeal.a(String.format("%s impression wasn't tracked. Please check your integration or contact out support team: support@appodeal.com", this.g), Log.LogLevel.debug);
this.f = true;
}
this.c = 0;
}
if (this.c <= 0 || this.c < this.d) {
ad.a.postDelayed(this, 250L);
return;
}
ad.a(this.a);
if (this.b == null || this.d <= 0) {
return;
}
this.b.b();
}
}
public interface b {
void a();
void b();
}
public static void a(View view) {
a aVar = b.get(view);
if (aVar != null) {
a.removeCallbacks(aVar);
b.remove(view);
Iterator<Map.Entry<Object, View>> it = c.entrySet().iterator();
while (it.hasNext()) {
if (it.next().getValue().equals(view)) {
it.remove();
}
}
}
}
public static void a(Object obj) {
View view = c.get(obj);
if (view != null) {
a(view);
}
}
public static void a(Object obj, View view, int i, b bVar, String str) {
if (c.containsKey(obj)) {
View view2 = c.get(obj);
if (!view2.equals(view)) {
if (b.containsKey(view2)) {
a(view2);
}
c.remove(obj);
}
}
if (b.containsKey(view)) {
return;
}
a aVar = new a(view, i, bVar, str);
c.put(obj, view);
b.put(view, aVar);
a.postDelayed(aVar, 250L);
view.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
@Override
public void onViewAttachedToWindow(View view3) {
}
@Override
public void onViewDetachedFromWindow(View view3) {
ad.a(view3);
view3.removeOnAttachStateChangeListener(this);
}
});
}
}