131 lines
6.1 KiB
Java
131 lines
6.1 KiB
Java
package com.discord.widgets.mobile_reports;
|
|
|
|
import android.content.Context;
|
|
import android.util.AttributeSet;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.TextView;
|
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
|
import com.discord.api.report.NodeElementResult;
|
|
import com.discord.api.report.NodeResult;
|
|
import com.discord.api.report.ReportNodeChild;
|
|
import com.discord.api.report.ReportNodeElementData;
|
|
import com.discord.databinding.ViewMobileReportsBreadcrumbsBinding;
|
|
import com.discord.databinding.ViewMobileReportsBreadcrumbsItemBinding;
|
|
import d0.t.n;
|
|
import d0.t.r;
|
|
import d0.t.u;
|
|
import d0.z.d.m;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
/* compiled from: MobileReportsBreadcrumbs.kt */
|
|
public final class MobileReportsBreadcrumbs extends LinearLayout {
|
|
private final ViewMobileReportsBreadcrumbsBinding binding;
|
|
|
|
public MobileReportsBreadcrumbs(Context context) {
|
|
this(context, null, 0, 6, null);
|
|
}
|
|
|
|
public MobileReportsBreadcrumbs(Context context, AttributeSet attributeSet) {
|
|
this(context, attributeSet, 0, 4, null);
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public MobileReportsBreadcrumbs(Context context, AttributeSet attributeSet, int i) {
|
|
super(context, attributeSet, i);
|
|
m.checkNotNullParameter(context, "context");
|
|
LayoutInflater.from(context).inflate(2131558771, this);
|
|
ViewMobileReportsBreadcrumbsBinding viewMobileReportsBreadcrumbsBinding = new ViewMobileReportsBreadcrumbsBinding(this);
|
|
m.checkNotNullExpressionValue(viewMobileReportsBreadcrumbsBinding, "ViewMobileReportsBreadcr…ater.from(context), this)");
|
|
this.binding = viewMobileReportsBreadcrumbsBinding;
|
|
}
|
|
|
|
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
|
|
public /* synthetic */ MobileReportsBreadcrumbs(Context context, AttributeSet attributeSet, int i, int i2, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(context, (i2 & 2) != 0 ? null : attributeSet, (i2 & 4) != 0 ? 0 : i);
|
|
}
|
|
|
|
private final ViewMobileReportsBreadcrumbsItemBinding getBoundBreadcrumbItem() {
|
|
LayoutInflater from = LayoutInflater.from(getContext());
|
|
View view = this.binding.a;
|
|
Objects.requireNonNull(view, "null cannot be cast to non-null type android.view.ViewGroup");
|
|
ViewGroup viewGroup = (ViewGroup) view;
|
|
View inflate = from.inflate(2131558772, viewGroup, false);
|
|
viewGroup.addView(inflate);
|
|
int i = 2131364528;
|
|
View findViewById = inflate.findViewById(2131364528);
|
|
if (findViewById != null) {
|
|
i = 2131364529;
|
|
TextView textView = (TextView) inflate.findViewById(2131364529);
|
|
if (textView != null) {
|
|
ViewMobileReportsBreadcrumbsItemBinding viewMobileReportsBreadcrumbsItemBinding = new ViewMobileReportsBreadcrumbsItemBinding((ConstraintLayout) inflate, findViewById, textView);
|
|
m.checkNotNullExpressionValue(viewMobileReportsBreadcrumbsItemBinding, "ViewMobileReportsBreadcr…ach to parent */ true\n )");
|
|
return viewMobileReportsBreadcrumbsItemBinding;
|
|
}
|
|
}
|
|
throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i)));
|
|
}
|
|
|
|
/* JADX DEBUG: Can't convert new array creation: APUT found in different block: 0x0064: APUT (r7v2 java.lang.String[]), (0 ??[int, short, byte, char]), (r8v1 java.lang.String) */
|
|
/* JADX WARNING: Removed duplicated region for block: B:51:0x00a4 A[SYNTHETIC] */
|
|
/* JADX WARNING: Removed duplicated region for block: B:54:0x0085 A[SYNTHETIC] */
|
|
public final void setup(List<NodeResult> list) {
|
|
boolean z2;
|
|
List<ReportNodeElementData> list2;
|
|
List<ReportNodeElementData> a;
|
|
View view = this.binding.a;
|
|
if (!(view instanceof LinearLayout)) {
|
|
view = null;
|
|
}
|
|
LinearLayout linearLayout = (LinearLayout) view;
|
|
if (linearLayout != null) {
|
|
if (linearLayout.getChildCount() > 1) {
|
|
linearLayout.removeViewsInLayout(1, linearLayout.getChildCount() - 1);
|
|
}
|
|
if (list != null) {
|
|
ArrayList arrayList = new ArrayList();
|
|
for (NodeResult nodeResult : list) {
|
|
NodeElementResult b = nodeResult.b();
|
|
if (b == null || (a = b.a()) == null) {
|
|
list2 = null;
|
|
} else {
|
|
if (a.isEmpty()) {
|
|
a = null;
|
|
}
|
|
list2 = a;
|
|
}
|
|
String[] strArr = new String[2];
|
|
strArr[0] = list2 != null ? u.joinToString$default(list2, ", ", null, null, 0, null, MobileReportsBreadcrumbs$setup$1$1.INSTANCE, 30, null) : null;
|
|
ReportNodeChild a2 = nodeResult.a();
|
|
strArr[1] = a2 != null ? a2.a() : null;
|
|
r.addAll(arrayList, n.listOf((Object[]) strArr));
|
|
}
|
|
ArrayList<String> arrayList2 = new ArrayList();
|
|
for (Object obj : arrayList) {
|
|
String str = (String) obj;
|
|
if (str != null) {
|
|
if (str.length() > 0) {
|
|
z2 = true;
|
|
if (!z2) {
|
|
arrayList2.add(obj);
|
|
}
|
|
}
|
|
}
|
|
z2 = false;
|
|
if (!z2) {
|
|
}
|
|
}
|
|
for (String str2 : arrayList2) {
|
|
TextView textView = getBoundBreadcrumbItem().b;
|
|
m.checkNotNullExpressionValue(textView, "getBoundBreadcrumbItem()…portsBreadcrumbsItemTitle");
|
|
textView.setText(str2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|