discord-jadx/app/src/main/java/com/discord/widgets/channels/permissions/WidgetChannelSettingsAddMem...

139 lines
8.2 KiB
Java

package com.discord.widgets.channels.permissions;
import android.content.Context;
import androidx.core.os.BundleKt;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentViewModelLazyKt;
import c.a.d.j0;
import c.d.b.a.a;
import com.discord.api.permission.PermissionOverwrite;
import com.discord.app.AppFragment;
import com.discord.databinding.WidgetChannelSettingsAddMemberBinding;
import com.discord.utilities.rx.ObservableExtensionsKt;
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
import com.discord.widgets.channels.permissions.WidgetChannelSettingsAddMemberFragmentViewModel;
import d0.g;
import d0.o;
import d0.z.d.a0;
import d0.z.d.m;
import java.util.Collections;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import kotlin.Lazy;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.reflect.KProperty;
import rx.Observable;
import rx.subjects.BehaviorSubject;
/* compiled from: WidgetChannelSettingsAddMemberFragment.kt */
public final class WidgetChannelSettingsAddMemberFragment extends AppFragment {
public static final /* synthetic */ KProperty[] $$delegatedProperties = {a.V(WidgetChannelSettingsAddMemberFragment.class, "binding", "getBinding()Lcom/discord/databinding/WidgetChannelSettingsAddMemberBinding;", 0)};
public static final Companion Companion = new Companion(null);
private static final String EXTRA_SHOW_ROLES_WITH_GUILD_PERMISSION = "EXTRA_SHOW_ROLES_WITH_GUILD_PERMISSION";
private final Lazy adapter$delegate = g.lazy(new WidgetChannelSettingsAddMemberFragment$adapter$2(this));
private final FragmentViewBindingDelegate binding$delegate = FragmentViewBindingDelegateKt.viewBinding$default(this, WidgetChannelSettingsAddMemberFragment$binding$2.INSTANCE, null, 2, null);
private final Lazy channelId$delegate = g.lazy(new WidgetChannelSettingsAddMemberFragment$channelId$2(this));
private final BehaviorSubject<String> querySubject;
private final BehaviorSubject<Map<Long, PermissionOverwrite.Type>> selectedSubject;
private final Lazy showRolesWithGuildPermission$delegate = g.lazy(new WidgetChannelSettingsAddMemberFragment$showRolesWithGuildPermission$2(this));
private final Lazy viewModel$delegate;
/* compiled from: WidgetChannelSettingsAddMemberFragment.kt */
public static final class Companion {
private Companion() {
}
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public final WidgetChannelSettingsAddMemberFragment create(long j, boolean z2) {
WidgetChannelSettingsAddMemberFragment widgetChannelSettingsAddMemberFragment = new WidgetChannelSettingsAddMemberFragment();
widgetChannelSettingsAddMemberFragment.setArguments(BundleKt.bundleOf(o.to("com.discord.intent.extra.EXTRA_CHANNEL_ID", Long.valueOf(j)), o.to(WidgetChannelSettingsAddMemberFragment.access$getEXTRA_SHOW_ROLES_WITH_GUILD_PERMISSION$cp(), Boolean.valueOf(z2))));
return widgetChannelSettingsAddMemberFragment;
}
}
public WidgetChannelSettingsAddMemberFragment() {
super(2131558888);
WidgetChannelSettingsAddMemberFragment$viewModel$2 widgetChannelSettingsAddMemberFragment$viewModel$2 = new WidgetChannelSettingsAddMemberFragment$viewModel$2(this);
this.viewModel$delegate = FragmentViewModelLazyKt.createViewModelLazy(this, a0.getOrCreateKotlinClass(WidgetChannelSettingsAddMemberFragmentViewModel.class), new WidgetChannelSettingsAddMemberFragment$appViewModels$$inlined$viewModels$1(widgetChannelSettingsAddMemberFragment$viewModel$2), new j0(new WidgetChannelSettingsAddMemberFragment$viewModel$3(this)));
this.querySubject = BehaviorSubject.l0("");
this.selectedSubject = BehaviorSubject.l0(Collections.emptyMap());
}
public static final /* synthetic */ void access$configureUI(WidgetChannelSettingsAddMemberFragment widgetChannelSettingsAddMemberFragment, WidgetChannelSettingsAddMemberFragmentViewModel.ViewState viewState) {
widgetChannelSettingsAddMemberFragment.configureUI(viewState);
}
public static final /* synthetic */ WidgetChannelSettingsAddMemberBinding access$getBinding$p(WidgetChannelSettingsAddMemberFragment widgetChannelSettingsAddMemberFragment) {
return widgetChannelSettingsAddMemberFragment.getBinding();
}
public static final /* synthetic */ long access$getChannelId$p(WidgetChannelSettingsAddMemberFragment widgetChannelSettingsAddMemberFragment) {
return widgetChannelSettingsAddMemberFragment.getChannelId();
}
public static final /* synthetic */ String access$getEXTRA_SHOW_ROLES_WITH_GUILD_PERMISSION$cp() {
return EXTRA_SHOW_ROLES_WITH_GUILD_PERMISSION;
}
public static final /* synthetic */ BehaviorSubject access$getQuerySubject$p(WidgetChannelSettingsAddMemberFragment widgetChannelSettingsAddMemberFragment) {
return widgetChannelSettingsAddMemberFragment.querySubject;
}
public static final /* synthetic */ BehaviorSubject access$getSelectedSubject$p(WidgetChannelSettingsAddMemberFragment widgetChannelSettingsAddMemberFragment) {
return widgetChannelSettingsAddMemberFragment.selectedSubject;
}
public static final /* synthetic */ boolean access$getShowRolesWithGuildPermission$p(WidgetChannelSettingsAddMemberFragment widgetChannelSettingsAddMemberFragment) {
return widgetChannelSettingsAddMemberFragment.getShowRolesWithGuildPermission();
}
public static final /* synthetic */ WidgetChannelSettingsAddMemberFragmentViewModel access$getViewModel$p(WidgetChannelSettingsAddMemberFragment widgetChannelSettingsAddMemberFragment) {
return widgetChannelSettingsAddMemberFragment.getViewModel();
}
private final void configureUI(WidgetChannelSettingsAddMemberFragmentViewModel.ViewState viewState) {
getAdapter().setData(viewState.getItems());
}
private final AddMemberAdapter getAdapter() {
return (AddMemberAdapter) this.adapter$delegate.getValue();
}
private final WidgetChannelSettingsAddMemberBinding getBinding() {
return (WidgetChannelSettingsAddMemberBinding) this.binding$delegate.getValue((Fragment) this, $$delegatedProperties[0]);
}
private final long getChannelId() {
return ((Number) this.channelId$delegate.getValue()).longValue();
}
private final boolean getShowRolesWithGuildPermission() {
return ((Boolean) this.showRolesWithGuildPermission$delegate.getValue()).booleanValue();
}
private final WidgetChannelSettingsAddMemberFragmentViewModel getViewModel() {
return (WidgetChannelSettingsAddMemberFragmentViewModel) this.viewModel$delegate.getValue();
}
public final BehaviorSubject<Map<Long, PermissionOverwrite.Type>> getSelectedItemsSubject() {
return this.selectedSubject;
}
@Override // com.discord.app.AppFragment
public void onViewBoundOrOnResume() {
super.onViewBoundOrOnResume();
Observable<String> r = this.querySubject.o(200, TimeUnit.MILLISECONDS).r();
m.checkNotNullExpressionValue(r, "querySubject\n .de… .distinctUntilChanged()");
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(r, this, null, 2, null), WidgetChannelSettingsAddMemberFragment.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new WidgetChannelSettingsAddMemberFragment$onViewBoundOrOnResume$1(this), 62, (Object) null);
getBinding().f1698c.setText(getViewModel().getQuery());
getBinding().f1698c.a(this, new WidgetChannelSettingsAddMemberFragment$onViewBoundOrOnResume$2(this));
getAdapter().setOnClickListener(new WidgetChannelSettingsAddMemberFragment$onViewBoundOrOnResume$3(this));
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.bindToComponentLifecycle(getViewModel().observeViewState(), this), WidgetChannelSettingsAddMemberFragment.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new WidgetChannelSettingsAddMemberFragment$onViewBoundOrOnResume$4(this), 62, (Object) null);
}
}