forked from Juby210/discord-jadx
103 lines
4.8 KiB
Java
103 lines
4.8 KiB
Java
package com.discord.widgets.directories;
|
|
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.TextView;
|
|
import c.d.b.a.a;
|
|
import c0.t.u;
|
|
import c0.z.d.m;
|
|
import c0.z.d.o;
|
|
import com.discord.R;
|
|
import com.discord.models.hubs.DirectoryEntryCategory;
|
|
import com.discord.widgets.directories.WidgetDirectoriesViewModel;
|
|
import com.google.android.material.tabs.TabLayout;
|
|
import java.util.Objects;
|
|
import kotlin.Pair;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.functions.Function2;
|
|
/* compiled from: WidgetDirectoryChannel.kt */
|
|
public final class WidgetDirectoryChannel$onViewBound$$inlined$apply$lambda$1 extends o implements Function2<TabLayout.Tab, Integer, Unit> {
|
|
public final /* synthetic */ WidgetDirectoryChannel this$0;
|
|
|
|
/* compiled from: WidgetDirectoryChannel.kt */
|
|
/* renamed from: com.discord.widgets.directories.WidgetDirectoryChannel$onViewBound$$inlined$apply$lambda$1$1 reason: invalid class name */
|
|
public static final class AnonymousClass1 extends o implements Function1<WidgetDirectoriesViewModel.ViewState, Unit> {
|
|
public final /* synthetic */ int $position;
|
|
public final /* synthetic */ TabLayout.Tab $tab;
|
|
public final /* synthetic */ WidgetDirectoryChannel$onViewBound$$inlined$apply$lambda$1 this$0;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public AnonymousClass1(WidgetDirectoryChannel$onViewBound$$inlined$apply$lambda$1 widgetDirectoryChannel$onViewBound$$inlined$apply$lambda$1, int i, TabLayout.Tab tab) {
|
|
super(1);
|
|
this.this$0 = widgetDirectoryChannel$onViewBound$$inlined$apply$lambda$1;
|
|
this.$position = i;
|
|
this.$tab = tab;
|
|
}
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Unit invoke(WidgetDirectoriesViewModel.ViewState viewState) {
|
|
invoke(viewState);
|
|
return Unit.a;
|
|
}
|
|
|
|
public final void invoke(WidgetDirectoriesViewModel.ViewState viewState) {
|
|
String str;
|
|
m.checkNotNullParameter(viewState, "state");
|
|
Pair pair = (Pair) u.getOrNull(viewState.getMappedTabs(), this.$position);
|
|
if (pair != null) {
|
|
TabLayout.Tab tab = this.$tab;
|
|
String str2 = null;
|
|
View inflate = this.this$0.this$0.getLayoutInflater().inflate(R.layout.directory_channel_tab, (ViewGroup) null, false);
|
|
Objects.requireNonNull(inflate, "rootView");
|
|
TextView textView = (TextView) inflate;
|
|
c.a.i.m mVar = new c.a.i.m(textView, textView);
|
|
if (((Number) pair.getSecond()).intValue() <= 0) {
|
|
str = "";
|
|
} else {
|
|
StringBuilder O = a.O(" (");
|
|
O.append(((Number) pair.getSecond()).intValue());
|
|
O.append(')');
|
|
str = O.toString();
|
|
}
|
|
m.checkNotNullExpressionValue(textView, "tabView");
|
|
StringBuilder sb = new StringBuilder();
|
|
Integer titleRes = ((DirectoryEntryCategory) pair.getFirst()).getTitleRes();
|
|
if (titleRes != null) {
|
|
str2 = this.this$0.this$0.getString(titleRes.intValue());
|
|
}
|
|
sb.append(str2);
|
|
sb.append(str);
|
|
textView.setText(sb.toString());
|
|
m.checkNotNullExpressionValue(mVar, "DirectoryChannelTabBindi…it) }}$count\"\n }");
|
|
tab.setCustomView(textView);
|
|
return;
|
|
}
|
|
StringBuilder O2 = a.O("Missing tab for position: ");
|
|
O2.append(this.$position);
|
|
throw new IllegalStateException(O2.toString());
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public WidgetDirectoryChannel$onViewBound$$inlined$apply$lambda$1(WidgetDirectoryChannel widgetDirectoryChannel) {
|
|
super(2);
|
|
this.this$0 = widgetDirectoryChannel;
|
|
}
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
|
|
@Override // kotlin.jvm.functions.Function2
|
|
public /* bridge */ /* synthetic */ Unit invoke(TabLayout.Tab tab, Integer num) {
|
|
invoke(tab, num.intValue());
|
|
return Unit.a;
|
|
}
|
|
|
|
public final void invoke(TabLayout.Tab tab, int i) {
|
|
m.checkNotNullParameter(tab, "tab");
|
|
this.this$0.getViewModel().withViewState(new AnonymousClass1(this, i, tab));
|
|
}
|
|
}
|