74 lines
3.4 KiB
Java
74 lines
3.4 KiB
Java
package com.discord.widgets.home;
|
|
|
|
import android.content.Context;
|
|
import android.view.MenuItem;
|
|
import androidx.fragment.app.FragmentManager;
|
|
import com.airbnb.lottie.parser.AnimatableValueParser;
|
|
import com.discord.api.channel.Channel;
|
|
import com.discord.app.AppFragment;
|
|
import com.discord.stores.StoreStream;
|
|
import com.discord.utilities.channel.ChannelInviteLaunchUtils;
|
|
import com.discord.widgets.friends.WidgetFriendsAdd;
|
|
import com.discord.widgets.search.WidgetSearch;
|
|
import com.discord.widgets.user.calls.PrivateCallLauncher;
|
|
import d0.z.d.m;
|
|
import rx.functions.Action2;
|
|
/* compiled from: WidgetHomeHeaderManager.kt */
|
|
public final class WidgetHomeHeaderManager$getOnSelectedAction$1 implements Action2<MenuItem, Context> {
|
|
public final /* synthetic */ AppFragment $appFragment;
|
|
public final /* synthetic */ PanelLayout $panelLayout;
|
|
public final /* synthetic */ WidgetHomeModel $this_getOnSelectedAction;
|
|
|
|
public WidgetHomeHeaderManager$getOnSelectedAction$1(WidgetHomeModel widgetHomeModel, AppFragment appFragment, PanelLayout panelLayout) {
|
|
this.$this_getOnSelectedAction = widgetHomeModel;
|
|
this.$appFragment = appFragment;
|
|
this.$panelLayout = panelLayout;
|
|
}
|
|
|
|
private final void launchForSearch(Context context) {
|
|
Channel channel = this.$this_getOnSelectedAction.getChannel();
|
|
if (channel == null || !AnimatableValueParser.t1(channel)) {
|
|
Channel channel2 = this.$this_getOnSelectedAction.getChannel();
|
|
if (channel2 != null && AnimatableValueParser.l1(channel2)) {
|
|
WidgetSearch.Companion.launchForGuild(this.$this_getOnSelectedAction.getChannel().f(), context);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
WidgetSearch.Companion.launchForChannel(this.$this_getOnSelectedAction.getChannelId(), context);
|
|
}
|
|
|
|
public void call(MenuItem menuItem, Context context) {
|
|
m.checkNotNullParameter(menuItem, "menuItem");
|
|
m.checkNotNullParameter(context, "context");
|
|
AppFragment appFragment = this.$appFragment;
|
|
FragmentManager parentFragmentManager = appFragment.getParentFragmentManager();
|
|
m.checkNotNullExpressionValue(parentFragmentManager, "appFragment.parentFragmentManager");
|
|
PrivateCallLauncher privateCallLauncher = new PrivateCallLauncher(appFragment, appFragment, context, parentFragmentManager);
|
|
switch (menuItem.getItemId()) {
|
|
case 2131363965:
|
|
WidgetFriendsAdd.Companion.show$default(WidgetFriendsAdd.Companion, context, null, "Toolbar", 2, null);
|
|
break;
|
|
case 2131363966:
|
|
launchForSearch(context);
|
|
break;
|
|
case 2131363967:
|
|
this.$panelLayout.openEndPanel();
|
|
break;
|
|
case 2131363968:
|
|
privateCallLauncher.launchVoiceCall(this.$this_getOnSelectedAction.getChannelId());
|
|
break;
|
|
case 2131363969:
|
|
ChannelInviteLaunchUtils.INSTANCE.inviteToChannel(this.$appFragment, this.$this_getOnSelectedAction.getChannel(), "Toolbar");
|
|
break;
|
|
case 2131363970:
|
|
privateCallLauncher.launchVideoCall(this.$this_getOnSelectedAction.getChannelId());
|
|
break;
|
|
case 2131363971:
|
|
StoreStream.Companion.getVoiceChannelSelected().clear();
|
|
break;
|
|
}
|
|
AppFragment.hideKeyboard$default(this.$appFragment, null, 1, null);
|
|
}
|
|
}
|