157 lines
5.9 KiB
Java
157 lines
5.9 KiB
Java
package com.discord.views.experiments;
|
|
|
|
import android.content.Context;
|
|
import android.util.AttributeSet;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.ArrayAdapter;
|
|
import android.widget.Spinner;
|
|
import android.widget.TextView;
|
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
|
import c.a.i.b2;
|
|
import c.a.i.n3;
|
|
import com.google.android.material.card.MaterialCardView;
|
|
import d0.z.d.m;
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
/* compiled from: ExperimentOverrideView.kt */
|
|
public final class ExperimentOverrideView extends ConstraintLayout {
|
|
public final b2 i;
|
|
|
|
/* compiled from: ExperimentOverrideView.kt */
|
|
public static final class a extends ArrayAdapter<b> {
|
|
public final List<b> i;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public a(Context context, List<b> list) {
|
|
super(context, 2131558826, list);
|
|
m.checkNotNullParameter(context, "context");
|
|
m.checkNotNullParameter(list, "items");
|
|
this.i = list;
|
|
}
|
|
|
|
/* JADX DEBUG: Failed to insert an additional move for type inference into block B:0:0x0000 */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public final View a(int i, View view) {
|
|
if (view == 0) {
|
|
View inflate = LayoutInflater.from(getContext()).inflate(2131558826, (ViewGroup) null, false);
|
|
Objects.requireNonNull(inflate, "rootView");
|
|
view = (TextView) inflate;
|
|
m.checkNotNullExpressionValue(new n3(view), "ViewSimpleSpinnerDropdow…om(context), null, false)");
|
|
m.checkNotNullExpressionValue(view, "ViewSimpleSpinnerDropdow…ntext), null, false).root");
|
|
}
|
|
((TextView) view).setText(this.i.get(i).b);
|
|
return view;
|
|
}
|
|
|
|
@Override // android.widget.ArrayAdapter, android.widget.Adapter
|
|
public int getCount() {
|
|
return this.i.size();
|
|
}
|
|
|
|
@Override // android.widget.ArrayAdapter, android.widget.SpinnerAdapter, android.widget.BaseAdapter
|
|
public View getDropDownView(int i, View view, ViewGroup viewGroup) {
|
|
m.checkNotNullParameter(viewGroup, "parent");
|
|
return a(i, view);
|
|
}
|
|
|
|
@Override // android.widget.ArrayAdapter, android.widget.Adapter
|
|
public Object getItem(int i) {
|
|
return this.i.get(i);
|
|
}
|
|
|
|
@Override // android.widget.ArrayAdapter, android.widget.Adapter
|
|
public long getItemId(int i) {
|
|
Integer num = this.i.get(i).a;
|
|
if (num != null) {
|
|
return (long) num.intValue();
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
@Override // android.widget.ArrayAdapter, android.widget.Adapter
|
|
public View getView(int i, View view, ViewGroup viewGroup) {
|
|
m.checkNotNullParameter(viewGroup, "parent");
|
|
return a(i, view);
|
|
}
|
|
}
|
|
|
|
/* compiled from: ExperimentOverrideView.kt */
|
|
public static final class b {
|
|
public final Integer a;
|
|
public final String b;
|
|
|
|
public b(Integer num, String str) {
|
|
m.checkNotNullParameter(str, "text");
|
|
this.a = num;
|
|
this.b = str;
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof b)) {
|
|
return false;
|
|
}
|
|
b bVar = (b) obj;
|
|
return m.areEqual(this.a, bVar.a) && m.areEqual(this.b, bVar.b);
|
|
}
|
|
|
|
public int hashCode() {
|
|
Integer num = this.a;
|
|
int i = 0;
|
|
int hashCode = (num != null ? num.hashCode() : 0) * 31;
|
|
String str = this.b;
|
|
if (str != null) {
|
|
i = str.hashCode();
|
|
}
|
|
return hashCode + i;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder K = c.d.b.a.a.K("SpinnerItem(bucket=");
|
|
K.append(this.a);
|
|
K.append(", text=");
|
|
return c.d.b.a.a.C(K, this.b, ")");
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public ExperimentOverrideView(Context context, AttributeSet attributeSet) {
|
|
super(context, attributeSet, 0);
|
|
m.checkNotNullParameter(context, "context");
|
|
LayoutInflater.from(context).inflate(2131558756, this);
|
|
int i = 2131363184;
|
|
TextView textView = (TextView) findViewById(2131363184);
|
|
if (textView != null) {
|
|
i = 2131363185;
|
|
Spinner spinner = (Spinner) findViewById(2131363185);
|
|
if (spinner != null) {
|
|
i = 2131363186;
|
|
MaterialCardView materialCardView = (MaterialCardView) findViewById(2131363186);
|
|
if (materialCardView != null) {
|
|
i = 2131363187;
|
|
TextView textView2 = (TextView) findViewById(2131363187);
|
|
if (textView2 != null) {
|
|
i = 2131363188;
|
|
TextView textView3 = (TextView) findViewById(2131363188);
|
|
if (textView3 != null) {
|
|
i = 2131363189;
|
|
TextView textView4 = (TextView) findViewById(2131363189);
|
|
if (textView4 != null) {
|
|
b2 b2Var = new b2(this, textView, spinner, materialCardView, textView2, textView3, textView4);
|
|
m.checkNotNullExpressionValue(b2Var, "ViewExperimentOverrideBi…ater.from(context), this)");
|
|
this.i = b2Var;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
throw new NullPointerException("Missing required view with ID: ".concat(getResources().getResourceName(i)));
|
|
}
|
|
}
|