2021-08-03 07:33:18 +00:00
|
|
|
package com.discord.widgets.guilds.invite;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.view.View;
|
|
|
|
import android.view.Window;
|
|
|
|
import android.widget.ImageView;
|
|
|
|
import android.widget.TextView;
|
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
|
import androidx.fragment.app.FragmentManager;
|
|
|
|
import androidx.fragment.app.FragmentViewModelLazyKt;
|
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
2021-08-13 06:23:11 +00:00
|
|
|
import c.a.d.f0;
|
2021-08-11 06:37:47 +00:00
|
|
|
import c.a.d.h0;
|
2021-08-03 07:33:18 +00:00
|
|
|
import c.d.b.a.a;
|
2021-08-09 22:51:56 +00:00
|
|
|
import com.discord.BuildConfig;
|
|
|
|
import com.discord.R;
|
2021-08-03 07:33:18 +00:00
|
|
|
import com.discord.api.guild.Guild;
|
|
|
|
import com.discord.app.AppActivity;
|
|
|
|
import com.discord.app.AppFragment;
|
|
|
|
import com.discord.app.AppViewFlipper;
|
2021-08-14 06:40:53 +00:00
|
|
|
import com.discord.app.LoggingConfig;
|
2021-08-03 07:33:18 +00:00
|
|
|
import com.discord.databinding.WidgetGuildInviteShareBinding;
|
|
|
|
import com.discord.models.domain.ModelInvite;
|
|
|
|
import com.discord.models.experiments.domain.Experiment;
|
|
|
|
import com.discord.stores.StoreStream;
|
|
|
|
import com.discord.utilities.analytics.AnalyticsTracker;
|
|
|
|
import com.discord.utilities.drawable.DrawableCompat;
|
|
|
|
import com.discord.utilities.mg_recycler.MGRecyclerAdapter;
|
|
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
|
|
import com.discord.utilities.view.extensions.ViewExtensions;
|
|
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
|
|
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
|
|
|
|
import com.discord.views.CheckedSetting;
|
|
|
|
import com.discord.widgets.guilds.invite.InviteSuggestionItem;
|
|
|
|
import com.discord.widgets.guilds.invite.WidgetGuildInviteShareViewModel;
|
|
|
|
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
|
|
|
import com.google.android.material.textfield.TextInputLayout;
|
|
|
|
import d0.t.n;
|
|
|
|
import d0.t.o;
|
|
|
|
import d0.t.u;
|
|
|
|
import d0.z.d.a0;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
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;
|
|
|
|
/* compiled from: WidgetGuildInviteShare.kt */
|
|
|
|
public final class WidgetGuildInviteShare extends AppFragment {
|
2021-08-28 06:29:07 +00:00
|
|
|
public static final /* synthetic */ KProperty[] $$delegatedProperties = {a.a0(WidgetGuildInviteShare.class, "binding", "getBinding()Lcom/discord/databinding/WidgetGuildInviteShareBinding;", 0)};
|
2021-08-03 07:33:18 +00:00
|
|
|
public static final Companion Companion = new Companion(null);
|
2021-08-31 06:34:54 +00:00
|
|
|
public static final String INTENT_INVITE_STORE_KEY = "INTENT_INVITE_STORE_KEY";
|
2021-08-03 07:33:18 +00:00
|
|
|
public static final String INTENT_IS_NUX_FLOW = "INTENT_IS_NUX_FLOW";
|
|
|
|
private PrivateChannelAdapter adapter;
|
|
|
|
private final FragmentViewBindingDelegate binding$delegate = FragmentViewBindingDelegateKt.viewBinding$default(this, WidgetGuildInviteShare$binding$2.INSTANCE, null, 2, null);
|
|
|
|
private BottomSheetBehavior<ViewInviteSettingsSheet> bottomSheetBehavior;
|
|
|
|
private boolean hasTrackedSuggestionsViewed;
|
2021-08-14 06:40:53 +00:00
|
|
|
private final LoggingConfig loggingConfig;
|
2021-08-03 07:33:18 +00:00
|
|
|
private final Lazy viewModel$delegate;
|
|
|
|
|
|
|
|
/* compiled from: WidgetGuildInviteShare.kt */
|
|
|
|
public static final class Companion {
|
|
|
|
private Companion() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this();
|
|
|
|
}
|
|
|
|
|
2021-08-31 06:34:54 +00:00
|
|
|
public static /* synthetic */ void launch$default(Companion companion, Context context, FragmentManager fragmentManager, long j, Long l, boolean z2, Long l2, String str, String str2, int i, Object obj) {
|
|
|
|
companion.launch(context, fragmentManager, j, (i & 8) != 0 ? null : l, (i & 16) != 0 ? false : z2, (i & 32) != 0 ? null : l2, (i & 64) != 0 ? null : str, str2);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
2021-08-31 06:34:54 +00:00
|
|
|
public final void launch(Context context, FragmentManager fragmentManager, long j, Long l, boolean z2, Long l2, String str, String str2) {
|
2021-08-03 07:33:18 +00:00
|
|
|
m.checkNotNullParameter(context, "context");
|
|
|
|
m.checkNotNullParameter(fragmentManager, "fragmentManager");
|
2021-08-31 06:34:54 +00:00
|
|
|
m.checkNotNullParameter(str2, "source");
|
2021-08-03 07:33:18 +00:00
|
|
|
if (GuildInviteShareSheetFeatureFlag.Companion.getINSTANCE().isEnabled()) {
|
2021-08-31 06:34:54 +00:00
|
|
|
WidgetGuildInviteShareSheet.Companion.show(fragmentManager, l, j, str2);
|
2021-08-03 07:33:18 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
Intent intent = new Intent();
|
2021-08-09 22:51:56 +00:00
|
|
|
intent.putExtra(WidgetGuildInviteShare.INTENT_IS_NUX_FLOW, z2);
|
2021-08-03 07:33:18 +00:00
|
|
|
intent.putExtra("com.discord.intent.extra.EXTRA_GUILD_ID", j);
|
|
|
|
intent.putExtra("com.discord.intent.extra.EXTRA_CHANNEL_ID", l != null ? l.longValue() : 0);
|
2021-08-31 06:34:54 +00:00
|
|
|
intent.putExtra("com.discord.intent.ORIGIN_SOURCE", str2);
|
2021-08-13 06:23:11 +00:00
|
|
|
intent.putExtra("com.discord.intent.extra.EXTRA_GUILD_SCHEDULED_EVENT_ID", l2);
|
2021-08-31 06:34:54 +00:00
|
|
|
intent.putExtra(WidgetGuildInviteShare.INTENT_INVITE_STORE_KEY, str);
|
2021-08-03 07:33:18 +00:00
|
|
|
Observable j2 = Observable.j(StoreStream.Companion.getExperiments().observeUserExperiment("2020-01_mobile_invite_suggestion_compact", true), new InviteSuggestionsManager(null, null, null, null, null, 31, null).observeInviteSuggestions(), WidgetGuildInviteShare$Companion$launch$1.INSTANCE);
|
|
|
|
m.checkNotNullExpressionValue(j2, "Observable.combineLatest…-> exp to inviteService }");
|
2021-08-31 06:34:54 +00:00
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.takeSingleUntilTimeout(ObservableExtensionsKt.computationLatest(j2), 50, false), WidgetGuildInviteShare.class, (Context) null, (Function1) null, new WidgetGuildInviteShare$Companion$launch$2(str2, context, intent), (Function0) null, (Function0) null, new WidgetGuildInviteShare$Companion$launch$3(str2, context, intent), 54, (Object) null);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public WidgetGuildInviteShare() {
|
2021-08-09 22:51:56 +00:00
|
|
|
super(R.layout.widget_guild_invite_share);
|
2021-08-03 07:33:18 +00:00
|
|
|
WidgetGuildInviteShare$viewModel$2 widgetGuildInviteShare$viewModel$2 = new WidgetGuildInviteShare$viewModel$2(this);
|
2021-08-13 06:23:11 +00:00
|
|
|
f0 f0Var = new f0(this);
|
|
|
|
this.viewModel$delegate = FragmentViewModelLazyKt.createViewModelLazy(this, a0.getOrCreateKotlinClass(WidgetGuildInviteShareViewModel.class), new WidgetGuildInviteShare$appViewModels$$inlined$viewModels$1(f0Var), new h0(widgetGuildInviteShare$viewModel$2));
|
2021-09-30 06:24:59 +00:00
|
|
|
this.loggingConfig = new LoggingConfig(false, null, new WidgetGuildInviteShare$loggingConfig$1(this), 3);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$configureUI(WidgetGuildInviteShare widgetGuildInviteShare, WidgetGuildInviteShareViewModel.ViewState.Loaded loaded) {
|
|
|
|
widgetGuildInviteShare.configureUI(loaded);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ PrivateChannelAdapter access$getAdapter$p(WidgetGuildInviteShare widgetGuildInviteShare) {
|
|
|
|
PrivateChannelAdapter privateChannelAdapter = widgetGuildInviteShare.adapter;
|
|
|
|
if (privateChannelAdapter == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("adapter");
|
|
|
|
}
|
|
|
|
return privateChannelAdapter;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ WidgetGuildInviteShareBinding access$getBinding$p(WidgetGuildInviteShare widgetGuildInviteShare) {
|
|
|
|
return widgetGuildInviteShare.getBinding();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ BottomSheetBehavior access$getBottomSheetBehavior$p(WidgetGuildInviteShare widgetGuildInviteShare) {
|
|
|
|
BottomSheetBehavior<ViewInviteSettingsSheet> bottomSheetBehavior = widgetGuildInviteShare.bottomSheetBehavior;
|
|
|
|
if (bottomSheetBehavior == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("bottomSheetBehavior");
|
|
|
|
}
|
|
|
|
return bottomSheetBehavior;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ WidgetGuildInviteShareViewModel access$getViewModel$p(WidgetGuildInviteShare widgetGuildInviteShare) {
|
|
|
|
return widgetGuildInviteShare.getViewModel();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$sendInvite(WidgetGuildInviteShare widgetGuildInviteShare, InviteSuggestionItem inviteSuggestionItem, WidgetGuildInviteShareViewModel.ViewState.Loaded loaded, ModelInvite modelInvite) {
|
|
|
|
widgetGuildInviteShare.sendInvite(inviteSuggestionItem, loaded, modelInvite);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$setAdapter$p(WidgetGuildInviteShare widgetGuildInviteShare, PrivateChannelAdapter privateChannelAdapter) {
|
|
|
|
widgetGuildInviteShare.adapter = privateChannelAdapter;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$setBottomSheetBehavior$p(WidgetGuildInviteShare widgetGuildInviteShare, BottomSheetBehavior bottomSheetBehavior) {
|
|
|
|
widgetGuildInviteShare.bottomSheetBehavior = bottomSheetBehavior;
|
|
|
|
}
|
|
|
|
|
|
|
|
private final void configureUI(WidgetGuildInviteShareViewModel.ViewState.Loaded loaded) {
|
|
|
|
Guild guild;
|
|
|
|
WidgetInviteModel widgetInviteModel = loaded.getWidgetInviteModel();
|
|
|
|
List<InviteSuggestionItem> inviteSuggestionItems = loaded.getInviteSuggestionItems();
|
|
|
|
ModelInvite invite = widgetInviteModel.getInvite();
|
|
|
|
AppViewFlipper appViewFlipper = getBinding().j;
|
|
|
|
m.checkNotNullExpressionValue(appViewFlipper, "binding.guildInviteSuggestionsFlipper");
|
|
|
|
boolean z2 = true;
|
|
|
|
appViewFlipper.setDisplayedChild(!inviteSuggestionItems.isEmpty() ? 1 : 0);
|
|
|
|
int i = 0;
|
|
|
|
if (inviteSuggestionItems.size() == 1 && (u.firstOrNull(inviteSuggestionItems) instanceof InviteSuggestionItem.SearchNoResultsItem)) {
|
|
|
|
inviteSuggestionItems = null;
|
|
|
|
}
|
|
|
|
if (inviteSuggestionItems == null) {
|
|
|
|
inviteSuggestionItems = n.emptyList();
|
|
|
|
}
|
|
|
|
if ((!inviteSuggestionItems.isEmpty()) && !this.hasTrackedSuggestionsViewed) {
|
|
|
|
ModelInvite invite2 = widgetInviteModel.getInvite();
|
2021-08-13 06:23:11 +00:00
|
|
|
long p = (invite2 == null || (guild = invite2.getGuild()) == null) ? 0 : guild.p();
|
2021-08-03 07:33:18 +00:00
|
|
|
AnalyticsTracker analyticsTracker = AnalyticsTracker.INSTANCE;
|
|
|
|
ArrayList<InviteSuggestionItem.ChannelItem> arrayList = new ArrayList();
|
|
|
|
for (Object obj : inviteSuggestionItems) {
|
|
|
|
if (obj instanceof InviteSuggestionItem.ChannelItem) {
|
|
|
|
arrayList.add(obj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ArrayList arrayList2 = new ArrayList(o.collectionSizeOrDefault(arrayList, 10));
|
|
|
|
for (InviteSuggestionItem.ChannelItem channelItem : arrayList) {
|
|
|
|
arrayList2.add(channelItem.getChannel());
|
|
|
|
}
|
|
|
|
ArrayList<InviteSuggestionItem.UserItem> arrayList3 = new ArrayList();
|
|
|
|
for (Object obj2 : inviteSuggestionItems) {
|
|
|
|
if (obj2 instanceof InviteSuggestionItem.UserItem) {
|
|
|
|
arrayList3.add(obj2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ArrayList arrayList4 = new ArrayList(o.collectionSizeOrDefault(arrayList3, 10));
|
|
|
|
for (InviteSuggestionItem.UserItem userItem : arrayList3) {
|
|
|
|
arrayList4.add(userItem.getUser());
|
|
|
|
}
|
2021-08-13 06:23:11 +00:00
|
|
|
analyticsTracker.inviteSuggestionOpened(p, arrayList2, arrayList4);
|
2021-08-03 07:33:18 +00:00
|
|
|
this.hasTrackedSuggestionsViewed = true;
|
|
|
|
}
|
2021-09-21 06:31:55 +00:00
|
|
|
TextView textView = getBinding().f1855c;
|
2021-08-03 07:33:18 +00:00
|
|
|
m.checkNotNullExpressionValue(textView, "binding.guildInviteEmptyResults");
|
|
|
|
textView.setVisibility(inviteSuggestionItems.isEmpty() ? 0 : 8);
|
|
|
|
RecyclerView recyclerView = getBinding().i;
|
|
|
|
m.checkNotNullExpressionValue(recyclerView, "binding.guildInviteSuggestionList");
|
|
|
|
recyclerView.setVisibility(inviteSuggestionItems.isEmpty() ^ true ? 0 : 8);
|
|
|
|
PrivateChannelAdapter privateChannelAdapter = this.adapter;
|
|
|
|
if (privateChannelAdapter == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("adapter");
|
|
|
|
}
|
|
|
|
privateChannelAdapter.setData(inviteSuggestionItems);
|
|
|
|
PrivateChannelAdapter privateChannelAdapter2 = this.adapter;
|
|
|
|
if (privateChannelAdapter2 == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("adapter");
|
|
|
|
}
|
|
|
|
privateChannelAdapter2.setOnClick(new WidgetGuildInviteShare$configureUI$3(this, loaded, invite));
|
|
|
|
getBinding().k.configureUi(loaded.getWidgetInviteModel());
|
|
|
|
TextView textView2 = getBinding().d;
|
|
|
|
m.checkNotNullExpressionValue(textView2, "binding.guildInviteLink");
|
|
|
|
textView2.setText(getInviteLink(invite));
|
|
|
|
getBinding().d.setOnClickListener(new WidgetGuildInviteShare$configureUI$4(this, invite));
|
|
|
|
ModelInvite.Settings settings = widgetInviteModel.getSettings();
|
|
|
|
if (settings == null || settings.getMaxAge() != 0) {
|
|
|
|
z2 = false;
|
|
|
|
}
|
|
|
|
CheckedSetting checkedSetting = getBinding().e;
|
|
|
|
m.checkNotNullExpressionValue(checkedSetting, "binding.guildInviteNeverExpire");
|
|
|
|
checkedSetting.setChecked(z2);
|
|
|
|
Experiment defaultInviteExperiment = getViewModel().getDefaultInviteExperiment();
|
|
|
|
CheckedSetting.i(getBinding().e, GuildInviteUiHelperKt.getInviteLinkText(requireContext(), defaultInviteExperiment), false, 2);
|
|
|
|
getBinding().e.e(new WidgetGuildInviteShare$configureUI$5(this, widgetInviteModel, defaultInviteExperiment));
|
|
|
|
getBinding().g.setOnClickListener(new WidgetGuildInviteShare$configureUI$6(this, invite));
|
|
|
|
ImageView imageView = getBinding().f;
|
|
|
|
m.checkNotNullExpressionValue(imageView, "binding.guildInviteSettingsEdit");
|
|
|
|
imageView.setVisibility(loaded.getShowInviteSettings() ? 0 : 8);
|
|
|
|
CheckedSetting checkedSetting2 = getBinding().e;
|
|
|
|
m.checkNotNullExpressionValue(checkedSetting2, "binding.guildInviteNeverExpire");
|
|
|
|
if (!loaded.getShowInviteSettings()) {
|
|
|
|
i = 8;
|
|
|
|
}
|
|
|
|
checkedSetting2.setVisibility(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
private final WidgetGuildInviteShareBinding getBinding() {
|
|
|
|
return (WidgetGuildInviteShareBinding) this.binding$delegate.getValue((Fragment) this, $$delegatedProperties[0]);
|
|
|
|
}
|
|
|
|
|
|
|
|
private final String getInviteLink(ModelInvite modelInvite) {
|
2021-08-09 22:51:56 +00:00
|
|
|
return modelInvite == null ? BuildConfig.HOST_INVITE : modelInvite.toLink(getResources(), BuildConfig.HOST_INVITE);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private final WidgetGuildInviteShareViewModel getViewModel() {
|
|
|
|
return (WidgetGuildInviteShareViewModel) this.viewModel$delegate.getValue();
|
|
|
|
}
|
|
|
|
|
|
|
|
private final void initBottomSheet() {
|
|
|
|
getBinding().k.setOnGenerateLinkListener(new WidgetGuildInviteShare$initBottomSheet$1(this));
|
|
|
|
getBinding().k.setViewModel(getViewModel());
|
|
|
|
}
|
|
|
|
|
|
|
|
private final void initBottomSheetBehavior(BottomSheetBehavior<ViewInviteSettingsSheet> bottomSheetBehavior) {
|
|
|
|
bottomSheetBehavior.setState(5);
|
|
|
|
bottomSheetBehavior.addBottomSheetCallback(new WidgetGuildInviteShare$initBottomSheetBehavior$1(this));
|
|
|
|
bottomSheetBehavior.setUpdateImportantForAccessibilityOnSiblings(true);
|
|
|
|
}
|
|
|
|
|
2021-08-31 06:34:54 +00:00
|
|
|
public static final void launch(Context context, FragmentManager fragmentManager, long j, Long l, boolean z2, Long l2, String str, String str2) {
|
|
|
|
Companion.launch(context, fragmentManager, j, l, z2, l2, str, str2);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private final void sendInvite(InviteSuggestionItem inviteSuggestionItem, WidgetGuildInviteShareViewModel.ViewState.Loaded loaded, ModelInvite modelInvite) {
|
|
|
|
if (inviteSuggestionItem instanceof InviteSuggestionItem.ChannelItem) {
|
|
|
|
getViewModel().sendInviteToChannel(((InviteSuggestionItem.ChannelItem) inviteSuggestionItem).getChannel().h(), loaded, modelInvite);
|
|
|
|
} else if (inviteSuggestionItem instanceof InviteSuggestionItem.UserItem) {
|
|
|
|
getViewModel().sendInviteToUser(((InviteSuggestionItem.UserItem) inviteSuggestionItem).getUser().getId(), loaded, modelInvite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-14 06:40:53 +00:00
|
|
|
@Override // com.discord.app.AppFragment, com.discord.app.AppLogger.a
|
|
|
|
public LoggingConfig getLoggingConfig() {
|
|
|
|
return this.loggingConfig;
|
|
|
|
}
|
|
|
|
|
2021-08-03 07:33:18 +00:00
|
|
|
@Override // com.discord.app.AppFragment
|
|
|
|
public void onViewBound(View view) {
|
|
|
|
Window window;
|
|
|
|
m.checkNotNullParameter(view, "view");
|
|
|
|
super.onViewBound(view);
|
|
|
|
MGRecyclerAdapter.Companion companion = MGRecyclerAdapter.Companion;
|
|
|
|
RecyclerView recyclerView = getBinding().i;
|
|
|
|
m.checkNotNullExpressionValue(recyclerView, "binding.guildInviteSuggestionList");
|
|
|
|
this.adapter = (PrivateChannelAdapter) companion.configure(new PrivateChannelAdapter(recyclerView));
|
2021-08-09 22:51:56 +00:00
|
|
|
boolean booleanExtra = getMostRecentIntent().getBooleanExtra(INTENT_IS_NUX_FLOW, false);
|
2021-08-03 07:33:18 +00:00
|
|
|
long longExtra = getMostRecentIntent().getLongExtra("com.discord.intent.extra.EXTRA_CHANNEL_ID", 0);
|
|
|
|
if (longExtra != 0) {
|
|
|
|
getViewModel().selectChannel(longExtra);
|
|
|
|
}
|
2021-08-09 22:51:56 +00:00
|
|
|
AppFragment.setActionBarDisplayHomeAsUpEnabled$default(this, true, booleanExtra ? Integer.valueOf(DrawableCompat.getThemedDrawableRes$default(requireContext(), (int) R.attr.ic_close_24dp, 0, 2, (Object) null)) : null, booleanExtra ? Integer.valueOf((int) R.string.close) : null, null, 8, null);
|
|
|
|
setActionBarTitle(R.string.invite_people);
|
2021-08-03 07:33:18 +00:00
|
|
|
AppActivity appActivity = getAppActivity();
|
|
|
|
if (!(appActivity == null || (window = appActivity.getWindow()) == null)) {
|
|
|
|
window.setSoftInputMode(32);
|
|
|
|
}
|
|
|
|
AppFragment.setOnBackPressed$default(this, new WidgetGuildInviteShare$onViewBound$1(this, booleanExtra), 0, 2, null);
|
|
|
|
TextInputLayout textInputLayout = getBinding().h;
|
|
|
|
m.checkNotNullExpressionValue(textInputLayout, "binding.guildInviteShareSearch");
|
|
|
|
ViewExtensions.addBindedTextWatcher(textInputLayout, this, new WidgetGuildInviteShare$onViewBound$2(this));
|
|
|
|
BottomSheetBehavior<ViewInviteSettingsSheet> from = BottomSheetBehavior.from(getBinding().k);
|
|
|
|
m.checkNotNullExpressionValue(from, "BottomSheetBehavior.from…nviteSettingsBottomSheet)");
|
|
|
|
this.bottomSheetBehavior = from;
|
|
|
|
if (from == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("bottomSheetBehavior");
|
|
|
|
}
|
|
|
|
initBottomSheetBehavior(from);
|
|
|
|
initBottomSheet();
|
|
|
|
getBinding().f.setOnClickListener(new WidgetGuildInviteShare$onViewBound$3(this));
|
|
|
|
getBinding().b.setOnClickListener(new WidgetGuildInviteShare$onViewBound$4(this));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.app.AppFragment
|
|
|
|
public void onViewBoundOrOnResume() {
|
|
|
|
super.onViewBoundOrOnResume();
|
2021-08-27 06:37:59 +00:00
|
|
|
Observable<WidgetGuildInviteShareViewModel.ViewState> J = getViewModel().observeViewState().J();
|
|
|
|
m.checkNotNullExpressionValue(J, "viewModel.observeViewSta… .onBackpressureBuffer()");
|
|
|
|
Observable<R> F = J.x(WidgetGuildInviteShare$onViewBoundOrOnResume$$inlined$filterIs$1.INSTANCE).F(WidgetGuildInviteShare$onViewBoundOrOnResume$$inlined$filterIs$2.INSTANCE);
|
2021-08-03 07:33:18 +00:00
|
|
|
m.checkNotNullExpressionValue(F, "filter { it is T }.map { it as T }");
|
|
|
|
PrivateChannelAdapter privateChannelAdapter = this.adapter;
|
|
|
|
if (privateChannelAdapter == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("adapter");
|
|
|
|
}
|
2021-08-27 06:37:59 +00:00
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.bindToComponentLifecycle(F, this, privateChannelAdapter), WidgetGuildInviteShare.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new WidgetGuildInviteShare$onViewBoundOrOnResume$1(this), 62, (Object) null);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
}
|