2021-08-03 07:33:18 +00:00
|
|
|
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;
|
2021-10-15 06:18:26 +00:00
|
|
|
import c0.t.n;
|
|
|
|
import c0.t.r;
|
|
|
|
import c0.t.u;
|
|
|
|
import c0.z.d.m;
|
2021-08-09 22:51:56 +00:00
|
|
|
import com.discord.R;
|
2021-08-03 07:33:18 +00:00
|
|
|
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 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");
|
2021-08-09 22:51:56 +00:00
|
|
|
LayoutInflater.from(context).inflate(R.layout.view_mobile_reports_breadcrumbs, this);
|
2021-08-03 07:33:18 +00:00
|
|
|
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;
|
2021-08-09 22:51:56 +00:00
|
|
|
View inflate = from.inflate(R.layout.view_mobile_reports_breadcrumbs_item, viewGroup, false);
|
2021-08-03 07:33:18 +00:00
|
|
|
viewGroup.addView(inflate);
|
2021-08-09 22:51:56 +00:00
|
|
|
int i = R.id.reports_breadcrumbs_item_dot;
|
|
|
|
View findViewById = inflate.findViewById(R.id.reports_breadcrumbs_item_dot);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (findViewById != null) {
|
2021-08-09 22:51:56 +00:00
|
|
|
i = R.id.reports_breadcrumbs_item_title;
|
|
|
|
TextView textView = (TextView) inflate.findViewById(R.id.reports_breadcrumbs_item_title);
|
2021-08-03 07:33:18 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|