- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
179 lines
5.1 KiB
Java
179 lines
5.1 KiB
Java
package com.applovin.impl;
|
|
|
|
import android.R;
|
|
import android.content.Context;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.graphics.drawable.GradientDrawable;
|
|
import android.graphics.drawable.StateListDrawable;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.BaseAdapter;
|
|
import android.widget.ImageView;
|
|
import android.widget.TextView;
|
|
import com.applovin.sdk.AppLovinSdkUtils;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/* loaded from: classes.dex */
|
|
public abstract class ec extends BaseAdapter implements View.OnClickListener {
|
|
protected Context a;
|
|
private List b = new ArrayList();
|
|
private Map c = new HashMap();
|
|
private a d;
|
|
|
|
public interface a {
|
|
void a(lb lbVar, dc dcVar);
|
|
}
|
|
|
|
public dc a() {
|
|
return null;
|
|
}
|
|
|
|
public void a(a aVar) {
|
|
this.d = aVar;
|
|
}
|
|
|
|
@Override // android.widget.BaseAdapter, android.widget.ListAdapter
|
|
public boolean areAllItemsEnabled() {
|
|
return false;
|
|
}
|
|
|
|
public abstract int b();
|
|
|
|
public abstract List c(int i);
|
|
|
|
public abstract int d(int i);
|
|
|
|
public abstract dc e(int i);
|
|
|
|
@Override // android.widget.Adapter
|
|
public long getItemId(int i) {
|
|
return i;
|
|
}
|
|
|
|
@Override // android.widget.BaseAdapter, android.widget.Adapter
|
|
public int getViewTypeCount() {
|
|
return dc.n();
|
|
}
|
|
|
|
public ec(Context context) {
|
|
this.a = context.getApplicationContext();
|
|
}
|
|
|
|
public void c() {
|
|
AppLovinSdkUtils.runOnUiThread(new Runnable() { // from class: com.applovin.impl.ec$$ExternalSyntheticLambda0
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
ec.this.notifyDataSetChanged();
|
|
}
|
|
});
|
|
}
|
|
|
|
@Override // android.widget.BaseAdapter, android.widget.ListAdapter
|
|
public boolean isEnabled(int i) {
|
|
return getItem(i).o();
|
|
}
|
|
|
|
@Override // android.widget.BaseAdapter, android.widget.Adapter
|
|
public int getItemViewType(int i) {
|
|
return getItem(i).m();
|
|
}
|
|
|
|
@Override // android.widget.Adapter
|
|
public int getCount() {
|
|
return this.b.size();
|
|
}
|
|
|
|
@Override // android.widget.Adapter
|
|
/* renamed from: b, reason: merged with bridge method [inline-methods] */
|
|
public dc getItem(int i) {
|
|
return (dc) this.b.get(i);
|
|
}
|
|
|
|
@Override // android.widget.BaseAdapter
|
|
public void notifyDataSetChanged() {
|
|
int i;
|
|
this.b = new ArrayList();
|
|
int b = b();
|
|
this.c = new HashMap(b);
|
|
dc a2 = a();
|
|
if (a2 != null) {
|
|
this.b.add(a2);
|
|
i = 1;
|
|
} else {
|
|
i = 0;
|
|
}
|
|
for (int i2 = 0; i2 < b; i2++) {
|
|
int d = d(i2);
|
|
if (d != 0) {
|
|
this.b.add(e(i2));
|
|
this.b.addAll(c(i2));
|
|
this.c.put(Integer.valueOf(i2), Integer.valueOf(i));
|
|
i += d + 1;
|
|
}
|
|
}
|
|
this.b.add(new fj(""));
|
|
super.notifyDataSetChanged();
|
|
}
|
|
|
|
@Override // android.widget.Adapter
|
|
public View getView(int i, View view, ViewGroup viewGroup) {
|
|
cc ccVar;
|
|
dc item = getItem(i);
|
|
if (view == null) {
|
|
view = LayoutInflater.from(viewGroup.getContext()).inflate(item.j(), viewGroup, false);
|
|
ccVar = new cc();
|
|
ccVar.a = (TextView) view.findViewById(R.id.text1);
|
|
ccVar.b = (TextView) view.findViewById(R.id.text2);
|
|
ccVar.c = (ImageView) view.findViewById(com.applovin.sdk.R.id.imageView);
|
|
ccVar.d = (ImageView) view.findViewById(com.applovin.sdk.R.id.detailImageView);
|
|
view.setTag(ccVar);
|
|
view.setOnClickListener(this);
|
|
view.setBackground(a(view));
|
|
} else {
|
|
ccVar = (cc) view.getTag();
|
|
}
|
|
ccVar.a(i);
|
|
ccVar.a(item);
|
|
view.setEnabled(item.o());
|
|
return view;
|
|
}
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public void onClick(View view) {
|
|
cc ccVar = (cc) view.getTag();
|
|
dc b = ccVar.b();
|
|
lb a2 = a(ccVar.a());
|
|
a aVar = this.d;
|
|
if (aVar == null || a2 == null) {
|
|
return;
|
|
}
|
|
aVar.a(a2, b);
|
|
}
|
|
|
|
private Drawable a(View view) {
|
|
Drawable background = view.getBackground();
|
|
GradientDrawable gradientDrawable = new GradientDrawable();
|
|
gradientDrawable.setColor(t3.a(com.applovin.sdk.R.color.applovin_sdk_highlightListItemColor, this.a));
|
|
StateListDrawable stateListDrawable = new StateListDrawable();
|
|
stateListDrawable.addState(new int[]{R.attr.state_pressed}, gradientDrawable);
|
|
stateListDrawable.addState(new int[0], background);
|
|
return stateListDrawable;
|
|
}
|
|
|
|
private lb a(int i) {
|
|
for (int i2 = 0; i2 < b(); i2++) {
|
|
Integer num = (Integer) this.c.get(Integer.valueOf(i2));
|
|
if (num != null) {
|
|
if (i <= num.intValue() + d(i2)) {
|
|
return new lb(i2, i - (num.intValue() + 1));
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
}
|