2021-08-03 07:33:18 +00:00
|
|
|
package com.discord.widgets.guilds;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.view.View;
|
|
|
|
import android.view.ViewGroup;
|
|
|
|
import android.widget.FrameLayout;
|
|
|
|
import android.widget.LinearLayout;
|
|
|
|
import android.widget.TextView;
|
|
|
|
import androidx.annotation.LayoutRes;
|
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
|
import androidx.fragment.app.FragmentKt;
|
|
|
|
import androidx.fragment.app.FragmentManager;
|
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
2021-12-17 21:59:34 +00:00
|
|
|
import b.a.k.b;
|
|
|
|
import b.d.b.a.a;
|
2021-08-09 22:51:56 +00:00
|
|
|
import com.discord.R;
|
2021-08-03 07:33:18 +00:00
|
|
|
import com.discord.app.AppBottomSheet;
|
|
|
|
import com.discord.databinding.WidgetGuildSelectorBinding;
|
|
|
|
import com.discord.databinding.WidgetGuildSelectorItemBinding;
|
|
|
|
import com.discord.models.guild.Guild;
|
|
|
|
import com.discord.stores.StoreStream;
|
|
|
|
import com.discord.utilities.color.ColorCompat;
|
|
|
|
import com.discord.utilities.extensions.SimpleDraweeViewExtensionsKt;
|
|
|
|
import com.discord.utilities.mg_recycler.MGRecyclerAdapter;
|
|
|
|
import com.discord.utilities.mg_recycler.MGRecyclerAdapterSimple;
|
|
|
|
import com.discord.utilities.mg_recycler.MGRecyclerDataPayload;
|
|
|
|
import com.discord.utilities.mg_recycler.MGRecyclerViewHolder;
|
|
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
|
|
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
|
|
|
|
import com.facebook.drawee.view.SimpleDraweeView;
|
2021-11-02 06:38:17 +00:00
|
|
|
import d0.g;
|
|
|
|
import d0.z.d.m;
|
2021-08-03 07:33:18 +00:00
|
|
|
import java.io.Serializable;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Set;
|
|
|
|
import kotlin.Lazy;
|
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function0;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
import kotlin.jvm.functions.Function2;
|
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
|
|
import kotlin.reflect.KProperty;
|
|
|
|
import rx.Observable;
|
|
|
|
import rx.subscriptions.CompositeSubscription;
|
|
|
|
/* compiled from: WidgetGuildSelector.kt */
|
|
|
|
public final class WidgetGuildSelector extends AppBottomSheet {
|
2021-11-05 06:48:17 +00:00
|
|
|
public static final /* synthetic */ KProperty[] $$delegatedProperties = {a.b0(WidgetGuildSelector.class, "binding", "getBinding()Lcom/discord/databinding/WidgetGuildSelectorBinding;", 0)};
|
2021-08-03 07:33:18 +00:00
|
|
|
private static final String ARG_FILTER_FUNCTION = "INTENT_EXTRA_FILTER_FUNCTION";
|
|
|
|
private static final String ARG_INCLUDE_NO_GUILD = "INTENT_EXTRA_INCLUDE_NO_GUILD";
|
|
|
|
private static final String ARG_NO_GUILD_STRING_ID = "INTENT_EXTRA_NO_GUILD_STRING_ID";
|
|
|
|
private static final String ARG_REQUEST_KEY = "INTENT_EXTRA_REQUEST_CODE";
|
|
|
|
public static final Companion Companion = new Companion(null);
|
|
|
|
private static final String REQUEST_KEY_DEFAULT = "GUILD_SELECTOR_DEFAULT_REQUEST_KEY";
|
|
|
|
private static final String RESULT_EXTRA_GUILD_ID = "INTENT_EXTRA_GUILD_ID";
|
|
|
|
private static final String RESULT_EXTRA_GUILD_NAME = "INTENT_EXTRA_GUILD_NAME";
|
|
|
|
private Adapter adapter;
|
|
|
|
private final FragmentViewBindingDelegate binding$delegate = FragmentViewBindingDelegateKt.viewBinding$default(this, WidgetGuildSelector$binding$2.INSTANCE, null, 2, null);
|
|
|
|
private final Lazy requestKey$delegate = g.lazy(new WidgetGuildSelector$requestKey$2(this));
|
|
|
|
|
|
|
|
/* compiled from: WidgetGuildSelector.kt */
|
|
|
|
public static final class Adapter extends MGRecyclerAdapterSimple<Item> {
|
|
|
|
private final WidgetGuildSelector dialog;
|
|
|
|
private final int noGuildStringId;
|
|
|
|
|
|
|
|
/* compiled from: WidgetGuildSelector.kt */
|
|
|
|
public static final class ItemGuild extends MGRecyclerViewHolder<Adapter, Item> {
|
|
|
|
private final WidgetGuildSelectorItemBinding binding;
|
|
|
|
private final int noGuildStringId;
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public ItemGuild(@LayoutRes int i, Adapter adapter, int i2) {
|
|
|
|
super(i, adapter);
|
|
|
|
m.checkNotNullParameter(adapter, "adapter");
|
|
|
|
this.noGuildStringId = i2;
|
|
|
|
View view = this.itemView;
|
2021-08-09 22:51:56 +00:00
|
|
|
int i3 = R.id.item_avatar_wrap;
|
|
|
|
FrameLayout frameLayout = (FrameLayout) view.findViewById(R.id.item_avatar_wrap);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (frameLayout != null) {
|
2021-08-09 22:51:56 +00:00
|
|
|
i3 = R.id.item_icon;
|
|
|
|
SimpleDraweeView simpleDraweeView = (SimpleDraweeView) view.findViewById(R.id.item_icon);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (simpleDraweeView != null) {
|
2021-08-09 22:51:56 +00:00
|
|
|
i3 = R.id.item_name;
|
|
|
|
TextView textView = (TextView) view.findViewById(R.id.item_name);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (textView != null) {
|
2021-08-09 22:51:56 +00:00
|
|
|
i3 = R.id.item_text;
|
|
|
|
TextView textView2 = (TextView) view.findViewById(R.id.item_text);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (textView2 != null) {
|
|
|
|
WidgetGuildSelectorItemBinding widgetGuildSelectorItemBinding = new WidgetGuildSelectorItemBinding((LinearLayout) view, frameLayout, simpleDraweeView, textView, textView2);
|
|
|
|
m.checkNotNullExpressionValue(widgetGuildSelectorItemBinding, "WidgetGuildSelectorItemBinding.bind(itemView)");
|
|
|
|
this.binding = widgetGuildSelectorItemBinding;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
throw new NullPointerException("Missing required view with ID: ".concat(view.getResources().getResourceName(i3)));
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ Adapter access$getAdapter$p(ItemGuild itemGuild) {
|
|
|
|
return (Adapter) itemGuild.adapter;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final int getNoGuildStringId() {
|
|
|
|
return this.noGuildStringId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void onConfigure(int i, Item item) {
|
|
|
|
CharSequence charSequence;
|
|
|
|
Guild guild;
|
|
|
|
String icon;
|
|
|
|
m.checkNotNullParameter(item, "data");
|
|
|
|
super.onConfigure(i, (int) item);
|
|
|
|
this.binding.a.setOnClickListener(new WidgetGuildSelector$Adapter$ItemGuild$onConfigure$1(this, item));
|
|
|
|
TextView textView = this.binding.d;
|
|
|
|
m.checkNotNullExpressionValue(textView, "binding.itemName");
|
|
|
|
Guild guild2 = item.getGuild();
|
|
|
|
boolean z2 = false;
|
|
|
|
String str = null;
|
|
|
|
if (guild2 == null || (charSequence = guild2.getName()) == null) {
|
|
|
|
TextView textView2 = this.binding.d;
|
|
|
|
m.checkNotNullExpressionValue(textView2, "binding.itemName");
|
|
|
|
charSequence = b.j(textView2, this.noGuildStringId, new Object[0], null, 4);
|
|
|
|
}
|
|
|
|
textView.setText(charSequence);
|
|
|
|
Guild guild3 = item.getGuild();
|
|
|
|
if (!(guild3 == null || (icon = guild3.getIcon()) == null)) {
|
|
|
|
if (icon.length() > 0) {
|
|
|
|
z2 = true;
|
|
|
|
}
|
|
|
|
}
|
2021-12-17 21:59:34 +00:00
|
|
|
SimpleDraweeView simpleDraweeView = this.binding.c;
|
2021-08-03 07:33:18 +00:00
|
|
|
m.checkNotNullExpressionValue(simpleDraweeView, "binding.itemIcon");
|
|
|
|
Guild guild4 = item.getGuild();
|
|
|
|
View view = this.itemView;
|
|
|
|
m.checkNotNullExpressionValue(view, "itemView");
|
2021-08-09 22:51:56 +00:00
|
|
|
Integer valueOf = Integer.valueOf(ColorCompat.getThemedColor(view, (int) R.attr.colorBackgroundPrimary));
|
2021-12-17 21:59:34 +00:00
|
|
|
SimpleDraweeView simpleDraweeView2 = this.binding.c;
|
2021-08-03 07:33:18 +00:00
|
|
|
m.checkNotNullExpressionValue(simpleDraweeView2, "binding.itemIcon");
|
2021-08-09 22:51:56 +00:00
|
|
|
SimpleDraweeViewExtensionsKt.setGuildIcon$default(simpleDraweeView, false, guild4, (float) simpleDraweeView2.getResources().getDimensionPixelSize(R.dimen.guild_icon_radius), null, valueOf, null, null, true, null, 360, null);
|
2021-12-20 07:27:17 +00:00
|
|
|
FrameLayout frameLayout = this.binding.f2417b;
|
2021-08-03 07:33:18 +00:00
|
|
|
m.checkNotNullExpressionValue(frameLayout, "binding.itemAvatarWrap");
|
|
|
|
frameLayout.setClipToOutline(true);
|
|
|
|
TextView textView3 = this.binding.e;
|
|
|
|
m.checkNotNullExpressionValue(textView3, "binding.itemText");
|
|
|
|
if (!z2 && (guild = item.getGuild()) != null) {
|
|
|
|
str = guild.getShortName();
|
|
|
|
}
|
|
|
|
textView3.setText(str);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public Adapter(RecyclerView recyclerView, WidgetGuildSelector widgetGuildSelector, int i) {
|
|
|
|
super(recyclerView, false, 2, null);
|
|
|
|
m.checkNotNullParameter(recyclerView, "recycler");
|
|
|
|
m.checkNotNullParameter(widgetGuildSelector, "dialog");
|
|
|
|
this.dialog = widgetGuildSelector;
|
|
|
|
this.noGuildStringId = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ WidgetGuildSelector access$getDialog$p(Adapter adapter) {
|
|
|
|
return adapter.dialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
|
|
|
|
public ItemGuild onCreateViewHolder(ViewGroup viewGroup, int i) {
|
|
|
|
m.checkNotNullParameter(viewGroup, "parent");
|
2021-08-09 22:51:56 +00:00
|
|
|
return new ItemGuild(R.layout.widget_guild_selector_item, this, this.noGuildStringId);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: WidgetGuildSelector.kt */
|
|
|
|
public static final class BaseFilterFunction implements FilterFunction {
|
|
|
|
@Override // com.discord.widgets.guilds.WidgetGuildSelector.FilterFunction
|
|
|
|
public boolean includeGuild(Guild guild) {
|
|
|
|
m.checkNotNullParameter(guild, "guild");
|
|
|
|
return FilterFunction.DefaultImpls.includeGuild(this, guild);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: WidgetGuildSelector.kt */
|
|
|
|
public static final class Companion {
|
|
|
|
private Companion() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ void launch$default(Companion companion, Fragment fragment, String str, boolean z2, int i, FilterFunction filterFunction, int i2, Object obj) {
|
|
|
|
if ((i2 & 2) != 0) {
|
2021-08-09 22:51:56 +00:00
|
|
|
str = WidgetGuildSelector.REQUEST_KEY_DEFAULT;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
boolean z3 = (i2 & 4) != 0 ? false : z2;
|
2021-08-09 22:51:56 +00:00
|
|
|
int i3 = (i2 & 8) != 0 ? R.string.none : i;
|
2021-08-03 07:33:18 +00:00
|
|
|
if ((i2 & 16) != 0) {
|
|
|
|
filterFunction = null;
|
|
|
|
}
|
|
|
|
companion.launch(fragment, str, z3, i3, filterFunction);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ void registerForResult$default(Companion companion, Fragment fragment, String str, boolean z2, Function2 function2, int i, Object obj) {
|
|
|
|
if ((i & 2) != 0) {
|
2021-08-09 22:51:56 +00:00
|
|
|
str = WidgetGuildSelector.REQUEST_KEY_DEFAULT;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
if ((i & 4) != 0) {
|
|
|
|
z2 = false;
|
|
|
|
}
|
|
|
|
companion.registerForResult(fragment, str, z2, function2);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void launch(Fragment fragment, String str, boolean z2, int i, FilterFunction filterFunction) {
|
|
|
|
m.checkNotNullParameter(fragment, "fragment");
|
|
|
|
m.checkNotNullParameter(str, "requestKey");
|
|
|
|
WidgetGuildSelector widgetGuildSelector = new WidgetGuildSelector();
|
|
|
|
Bundle bundle = new Bundle();
|
2021-08-09 22:51:56 +00:00
|
|
|
bundle.putString(WidgetGuildSelector.ARG_REQUEST_KEY, str);
|
|
|
|
bundle.putBoolean(WidgetGuildSelector.ARG_INCLUDE_NO_GUILD, z2);
|
|
|
|
bundle.putInt(WidgetGuildSelector.ARG_NO_GUILD_STRING_ID, i);
|
|
|
|
bundle.putSerializable(WidgetGuildSelector.ARG_FILTER_FUNCTION, filterFunction);
|
2021-08-03 07:33:18 +00:00
|
|
|
widgetGuildSelector.setArguments(bundle);
|
|
|
|
FragmentManager parentFragmentManager = fragment.getParentFragmentManager();
|
|
|
|
m.checkNotNullExpressionValue(parentFragmentManager, "fragment.parentFragmentManager");
|
|
|
|
widgetGuildSelector.show(parentFragmentManager, WidgetGuildSelector.class.getName());
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void registerForResult(Fragment fragment, String str, boolean z2, Function2<? super Long, ? super String, Unit> function2) {
|
|
|
|
m.checkNotNullParameter(fragment, "fragment");
|
|
|
|
m.checkNotNullParameter(str, "requestKey");
|
|
|
|
m.checkNotNullParameter(function2, "onGuildSelected");
|
|
|
|
FragmentKt.setFragmentResultListener(fragment, str, new WidgetGuildSelector$Companion$registerForResult$1(str, z2, function2));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: WidgetGuildSelector.kt */
|
|
|
|
public interface FilterFunction extends Serializable {
|
|
|
|
|
|
|
|
/* compiled from: WidgetGuildSelector.kt */
|
|
|
|
public static final class DefaultImpls {
|
|
|
|
public static boolean includeGuild(FilterFunction filterFunction, Guild guild) {
|
|
|
|
m.checkNotNullParameter(guild, "guild");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
boolean includeGuild(Guild guild);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: WidgetGuildSelector.kt */
|
|
|
|
public static final class GuildFilterFunction implements FilterFunction {
|
|
|
|
private final Set<Long> guildIds;
|
|
|
|
|
|
|
|
public GuildFilterFunction(Set<Long> set) {
|
|
|
|
m.checkNotNullParameter(set, "guildIds");
|
|
|
|
this.guildIds = set;
|
|
|
|
}
|
|
|
|
|
|
|
|
private final Set<Long> component1() {
|
|
|
|
return this.guildIds;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r0v0, resolved type: com.discord.widgets.guilds.WidgetGuildSelector$GuildFilterFunction */
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
|
|
public static /* synthetic */ GuildFilterFunction copy$default(GuildFilterFunction guildFilterFunction, Set set, int i, Object obj) {
|
|
|
|
if ((i & 1) != 0) {
|
|
|
|
set = guildFilterFunction.guildIds;
|
|
|
|
}
|
|
|
|
return guildFilterFunction.copy(set);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final GuildFilterFunction copy(Set<Long> set) {
|
|
|
|
m.checkNotNullParameter(set, "guildIds");
|
|
|
|
return new GuildFilterFunction(set);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Object
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (this != obj) {
|
|
|
|
return (obj instanceof GuildFilterFunction) && m.areEqual(this.guildIds, ((GuildFilterFunction) obj).guildIds);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Object
|
|
|
|
public int hashCode() {
|
|
|
|
Set<Long> set = this.guildIds;
|
|
|
|
if (set != null) {
|
|
|
|
return set.hashCode();
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.widgets.guilds.WidgetGuildSelector.FilterFunction
|
|
|
|
public boolean includeGuild(Guild guild) {
|
|
|
|
m.checkNotNullParameter(guild, "guild");
|
|
|
|
return this.guildIds.contains(Long.valueOf(guild.getId()));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Object
|
|
|
|
public String toString() {
|
2021-11-05 06:48:17 +00:00
|
|
|
StringBuilder R = a.R("GuildFilterFunction(guildIds=");
|
|
|
|
R.append(this.guildIds);
|
|
|
|
R.append(")");
|
|
|
|
return R.toString();
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: WidgetGuildSelector.kt */
|
|
|
|
public static final class Item implements MGRecyclerDataPayload {
|
|
|
|
private final Guild guild;
|
|
|
|
private final String key;
|
|
|
|
private final int type = 1;
|
|
|
|
|
|
|
|
public Item(Guild guild) {
|
|
|
|
String str;
|
|
|
|
this.guild = guild;
|
|
|
|
this.key = (guild == null || (str = String.valueOf(guild.getId())) == null) ? "" : str;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ Item copy$default(Item item, Guild guild, int i, Object obj) {
|
|
|
|
if ((i & 1) != 0) {
|
|
|
|
guild = item.guild;
|
|
|
|
}
|
|
|
|
return item.copy(guild);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Guild component1() {
|
|
|
|
return this.guild;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Item copy(Guild guild) {
|
|
|
|
return new Item(guild);
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (this != obj) {
|
|
|
|
return (obj instanceof Item) && m.areEqual(this.guild, ((Item) obj).guild);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Guild getGuild() {
|
|
|
|
return this.guild;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.utilities.mg_recycler.MGRecyclerDataPayload, com.discord.utilities.recycler.DiffKeyProvider
|
|
|
|
public String getKey() {
|
|
|
|
return this.key;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.utilities.mg_recycler.MGRecyclerDataPayload
|
|
|
|
public int getType() {
|
|
|
|
return this.type;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int hashCode() {
|
|
|
|
Guild guild = this.guild;
|
|
|
|
if (guild != null) {
|
|
|
|
return guild.hashCode();
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
2021-11-05 06:48:17 +00:00
|
|
|
StringBuilder R = a.R("Item(guild=");
|
|
|
|
R.append(this.guild);
|
|
|
|
R.append(")");
|
|
|
|
return R.toString();
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public WidgetGuildSelector() {
|
|
|
|
super(false, 1, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ Adapter access$getAdapter$p(WidgetGuildSelector widgetGuildSelector) {
|
|
|
|
Adapter adapter = widgetGuildSelector.adapter;
|
|
|
|
if (adapter == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("adapter");
|
|
|
|
}
|
|
|
|
return adapter;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ Bundle access$getArgumentsOrDefault$p(WidgetGuildSelector widgetGuildSelector) {
|
|
|
|
return widgetGuildSelector.getArgumentsOrDefault();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$onGuildSelected(WidgetGuildSelector widgetGuildSelector, Guild guild) {
|
|
|
|
widgetGuildSelector.onGuildSelected(guild);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$setAdapter$p(WidgetGuildSelector widgetGuildSelector, Adapter adapter) {
|
|
|
|
widgetGuildSelector.adapter = adapter;
|
|
|
|
}
|
|
|
|
|
|
|
|
private final Observable<List<Item>> get(boolean z2, FilterFunction filterFunction) {
|
2021-10-22 06:43:45 +00:00
|
|
|
Observable<R> F = StoreStream.Companion.getGuildsSorted().observeOrderedGuilds().F(new WidgetGuildSelector$get$1(filterFunction, z2));
|
|
|
|
m.checkNotNullExpressionValue(F, "StoreStream.getGuildsSor….map { Item(it) }\n }");
|
|
|
|
Observable<List<Item>> q = ObservableExtensionsKt.computationLatest(F).q();
|
2021-10-15 06:18:26 +00:00
|
|
|
m.checkNotNullExpressionValue(q, "StoreStream.getGuildsSor… .distinctUntilChanged()");
|
|
|
|
return q;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private final WidgetGuildSelectorBinding getBinding() {
|
|
|
|
return (WidgetGuildSelectorBinding) this.binding$delegate.getValue((Fragment) this, $$delegatedProperties[0]);
|
|
|
|
}
|
|
|
|
|
|
|
|
private final String getRequestKey() {
|
|
|
|
return (String) this.requestKey$delegate.getValue();
|
|
|
|
}
|
|
|
|
|
|
|
|
private final void onGuildSelected(Guild guild) {
|
|
|
|
String requestKey = getRequestKey();
|
|
|
|
m.checkNotNullExpressionValue(requestKey, "requestKey");
|
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
bundle.putLong("INTENT_EXTRA_GUILD_ID", guild != null ? guild.getId() : -1);
|
2021-08-09 22:51:56 +00:00
|
|
|
bundle.putString(RESULT_EXTRA_GUILD_NAME, guild != null ? guild.getName() : null);
|
2021-08-03 07:33:18 +00:00
|
|
|
FragmentKt.setFragmentResult(this, requestKey, bundle);
|
|
|
|
dismiss();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.app.AppBottomSheet
|
|
|
|
public void bindSubscriptions(CompositeSubscription compositeSubscription) {
|
|
|
|
m.checkNotNullParameter(compositeSubscription, "compositeSubscription");
|
|
|
|
super.bindSubscriptions(compositeSubscription);
|
2021-08-09 22:51:56 +00:00
|
|
|
boolean z2 = getArgumentsOrDefault().getBoolean(ARG_INCLUDE_NO_GUILD, false);
|
|
|
|
Serializable serializable = getArgumentsOrDefault().getSerializable(ARG_FILTER_FUNCTION);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (!(serializable instanceof FilterFunction)) {
|
|
|
|
serializable = null;
|
|
|
|
}
|
|
|
|
FilterFunction filterFunction = (FilterFunction) serializable;
|
|
|
|
if (filterFunction == null) {
|
|
|
|
filterFunction = new BaseFilterFunction();
|
|
|
|
}
|
|
|
|
Observable<List<Item>> observable = get(z2, filterFunction);
|
|
|
|
Adapter adapter = this.adapter;
|
|
|
|
if (adapter == null) {
|
|
|
|
m.throwUninitializedPropertyAccessException("adapter");
|
|
|
|
}
|
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui(observable, this, adapter), WidgetGuildSelector.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new WidgetGuildSelector$bindSubscriptions$1(this), 62, (Object) null);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.app.AppBottomSheet
|
|
|
|
public int getContentViewResId() {
|
2021-08-09 22:51:56 +00:00
|
|
|
return R.layout.widget_guild_selector;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.app.AppBottomSheet, androidx.fragment.app.Fragment
|
|
|
|
public void onViewCreated(View view, Bundle bundle) {
|
|
|
|
m.checkNotNullParameter(view, "view");
|
|
|
|
super.onViewCreated(view, bundle);
|
|
|
|
MGRecyclerAdapter.Companion companion = MGRecyclerAdapter.Companion;
|
2021-12-20 07:27:17 +00:00
|
|
|
RecyclerView recyclerView = getBinding().f2416b;
|
2021-08-03 07:33:18 +00:00
|
|
|
m.checkNotNullExpressionValue(recyclerView, "binding.guildSelectorList");
|
2021-08-09 22:51:56 +00:00
|
|
|
this.adapter = (Adapter) companion.configure(new Adapter(recyclerView, this, getArgumentsOrDefault().getInt(ARG_NO_GUILD_STRING_ID)));
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
}
|