566 lines
27 KiB
Java
566 lines
27 KiB
Java
package com.discord.widgets.user;
|
|
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.content.res.Resources;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.ImageView;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.RelativeLayout;
|
|
import android.widget.TextView;
|
|
import androidx.fragment.app.Fragment;
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
import c.a.d.l;
|
|
import c.a.i.s5;
|
|
import c.d.b.a.a;
|
|
import com.discord.app.AppFragment;
|
|
import com.discord.databinding.WidgetUserMutualFriendsBinding;
|
|
import com.discord.databinding.WidgetUserProfileAdapterItemFriendBinding;
|
|
import com.discord.models.guild.Guild;
|
|
import com.discord.models.presence.Presence;
|
|
import com.discord.models.user.User;
|
|
import com.discord.utilities.icon.IconUtils;
|
|
import com.discord.utilities.images.MGImages;
|
|
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.presence.PresenceUtils;
|
|
import com.discord.utilities.resources.StringResourceUtilsKt;
|
|
import com.discord.utilities.rest.RestAPI;
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
import com.discord.utilities.view.text.SimpleDraweeSpanTextView;
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
|
|
import com.discord.views.StatusView;
|
|
import com.discord.widgets.user.profile.WidgetUserProfileEmptyListItem;
|
|
import com.facebook.drawee.view.SimpleDraweeView;
|
|
import d0.g;
|
|
import d0.t.u;
|
|
import d0.z.d.m;
|
|
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: WidgetUserMutualFriends.kt */
|
|
public final class WidgetUserMutualFriends extends AppFragment {
|
|
public static final /* synthetic */ KProperty[] $$delegatedProperties = {a.V(WidgetUserMutualFriends.class, "binding", "getBinding()Lcom/discord/databinding/WidgetUserMutualFriendsBinding;", 0)};
|
|
public static final Companion Companion = new Companion(null);
|
|
private MutualFriendsAdapter adapter;
|
|
private final FragmentViewBindingDelegate binding$delegate = FragmentViewBindingDelegateKt.viewBinding$default(this, WidgetUserMutualFriends$binding$2.INSTANCE, null, 2, null);
|
|
private final Lazy userId$delegate = g.lazy(new WidgetUserMutualFriends$userId$2(this));
|
|
|
|
/* compiled from: WidgetUserMutualFriends.kt */
|
|
public static final class Companion {
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
public final void show(Context context, User user) {
|
|
m.checkNotNullParameter(context, "context");
|
|
m.checkNotNullParameter(user, "user");
|
|
Intent putExtra = new Intent().putExtra("com.discord.intent.extra.EXTRA_USER_ID", user.getId());
|
|
m.checkNotNullExpressionValue(putExtra, "Intent().putExtra(Intents.EXTRA_USER_ID, user.id)");
|
|
l.d(context, WidgetUserMutualFriends.class, putExtra);
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetUserMutualFriends.kt */
|
|
public static final class Model {
|
|
public static final Companion Companion = new Companion(null);
|
|
private final List<Item> items;
|
|
private final int numMutualFriends;
|
|
private final User user;
|
|
|
|
/* compiled from: WidgetUserMutualFriends.kt */
|
|
public static final class Companion {
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
public final Observable<Model> get(long j) {
|
|
Observable Y = ObservableExtensionsKt.restSubscribeOn$default(RestAPI.Companion.getApi().getRelationships(j), false, 1, null).Y(new WidgetUserMutualFriends$Model$Companion$get$1(j));
|
|
m.checkNotNullExpressionValue(Y, "RestAPI\n .api… )\n }");
|
|
Observable<Model> r = ObservableExtensionsKt.computationLatest(Y).r();
|
|
m.checkNotNullExpressionValue(r, "RestAPI\n .api… .distinctUntilChanged()");
|
|
return r;
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetUserMutualFriends.kt */
|
|
public static abstract class Item implements MGRecyclerDataPayload {
|
|
public static final Companion Companion = new Companion(null);
|
|
public static final int TYPE_EMPTY = 0;
|
|
public static final int TYPE_FRIEND = 1;
|
|
|
|
/* compiled from: WidgetUserMutualFriends.kt */
|
|
public static final class Companion {
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetUserMutualFriends.kt */
|
|
public static final class Empty extends Item {
|
|
public static final Empty INSTANCE;
|
|
private static final String key;
|
|
private static final int type = 0;
|
|
|
|
static {
|
|
Empty empty = new Empty();
|
|
INSTANCE = empty;
|
|
StringBuilder K = a.K("empty");
|
|
K.append(empty.getType());
|
|
key = K.toString();
|
|
}
|
|
|
|
private Empty() {
|
|
super(null);
|
|
}
|
|
|
|
@Override // com.discord.utilities.mg_recycler.MGRecyclerDataPayload, com.discord.utilities.recycler.DiffKeyProvider
|
|
public String getKey() {
|
|
return key;
|
|
}
|
|
|
|
@Override // com.discord.utilities.mg_recycler.MGRecyclerDataPayload
|
|
public int getType() {
|
|
return type;
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetUserMutualFriends.kt */
|
|
public static final class MutualFriend extends Item {
|
|
private final Boolean isApplicationStreaming;
|
|
private final String key;
|
|
private final List<Guild> mutualGuilds;
|
|
private final Presence presence;
|
|
private final int type;
|
|
private final User user;
|
|
|
|
/* JADX DEBUG: TODO: convert one arg to string using `String.valueOf()`, args: [(wrap: int : 0x001e: INVOKE (r4v1 int) = (r1v0 'this' com.discord.widgets.user.WidgetUserMutualFriends$Model$Item$MutualFriend A[IMMUTABLE_TYPE, THIS]) type: VIRTUAL call: com.discord.widgets.user.WidgetUserMutualFriends.Model.Item.MutualFriend.getType():int), (wrap: long : 0x0025: INVOKE (r4v2 long) = (r2v0 com.discord.models.user.User) type: INTERFACE call: com.discord.models.user.User.getId():long)] */
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public MutualFriend(User user, Presence presence, List<Guild> list, Boolean bool) {
|
|
super(null);
|
|
m.checkNotNullParameter(user, "user");
|
|
m.checkNotNullParameter(list, "mutualGuilds");
|
|
this.user = user;
|
|
this.presence = presence;
|
|
this.mutualGuilds = list;
|
|
this.isApplicationStreaming = bool;
|
|
this.type = 1;
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(getType());
|
|
sb.append(user.getId());
|
|
this.key = sb.toString();
|
|
}
|
|
|
|
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
|
|
public /* synthetic */ MutualFriend(User user, Presence presence, List list, Boolean bool, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(user, presence, list, (i & 8) != 0 ? null : bool);
|
|
}
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r0v0, resolved type: com.discord.widgets.user.WidgetUserMutualFriends$Model$Item$MutualFriend */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public static /* synthetic */ MutualFriend copy$default(MutualFriend mutualFriend, User user, Presence presence, List list, Boolean bool, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
user = mutualFriend.user;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
presence = mutualFriend.presence;
|
|
}
|
|
if ((i & 4) != 0) {
|
|
list = mutualFriend.mutualGuilds;
|
|
}
|
|
if ((i & 8) != 0) {
|
|
bool = mutualFriend.isApplicationStreaming;
|
|
}
|
|
return mutualFriend.copy(user, presence, list, bool);
|
|
}
|
|
|
|
public final User component1() {
|
|
return this.user;
|
|
}
|
|
|
|
public final Presence component2() {
|
|
return this.presence;
|
|
}
|
|
|
|
public final List<Guild> component3() {
|
|
return this.mutualGuilds;
|
|
}
|
|
|
|
public final Boolean component4() {
|
|
return this.isApplicationStreaming;
|
|
}
|
|
|
|
public final MutualFriend copy(User user, Presence presence, List<Guild> list, Boolean bool) {
|
|
m.checkNotNullParameter(user, "user");
|
|
m.checkNotNullParameter(list, "mutualGuilds");
|
|
return new MutualFriend(user, presence, list, bool);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof MutualFriend)) {
|
|
return false;
|
|
}
|
|
MutualFriend mutualFriend = (MutualFriend) obj;
|
|
return m.areEqual(this.user, mutualFriend.user) && m.areEqual(this.presence, mutualFriend.presence) && m.areEqual(this.mutualGuilds, mutualFriend.mutualGuilds) && m.areEqual(this.isApplicationStreaming, mutualFriend.isApplicationStreaming);
|
|
}
|
|
|
|
@Override // com.discord.utilities.mg_recycler.MGRecyclerDataPayload, com.discord.utilities.recycler.DiffKeyProvider
|
|
public String getKey() {
|
|
return this.key;
|
|
}
|
|
|
|
public final List<Guild> getMutualGuilds() {
|
|
return this.mutualGuilds;
|
|
}
|
|
|
|
public final Presence getPresence() {
|
|
return this.presence;
|
|
}
|
|
|
|
@Override // com.discord.utilities.mg_recycler.MGRecyclerDataPayload
|
|
public int getType() {
|
|
return this.type;
|
|
}
|
|
|
|
public final User getUser() {
|
|
return this.user;
|
|
}
|
|
|
|
public int hashCode() {
|
|
User user = this.user;
|
|
int i = 0;
|
|
int hashCode = (user != null ? user.hashCode() : 0) * 31;
|
|
Presence presence = this.presence;
|
|
int hashCode2 = (hashCode + (presence != null ? presence.hashCode() : 0)) * 31;
|
|
List<Guild> list = this.mutualGuilds;
|
|
int hashCode3 = (hashCode2 + (list != null ? list.hashCode() : 0)) * 31;
|
|
Boolean bool = this.isApplicationStreaming;
|
|
if (bool != null) {
|
|
i = bool.hashCode();
|
|
}
|
|
return hashCode3 + i;
|
|
}
|
|
|
|
public final Boolean isApplicationStreaming() {
|
|
return this.isApplicationStreaming;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder K = a.K("MutualFriend(user=");
|
|
K.append(this.user);
|
|
K.append(", presence=");
|
|
K.append(this.presence);
|
|
K.append(", mutualGuilds=");
|
|
K.append(this.mutualGuilds);
|
|
K.append(", isApplicationStreaming=");
|
|
K.append(this.isApplicationStreaming);
|
|
K.append(")");
|
|
return K.toString();
|
|
}
|
|
}
|
|
|
|
private Item() {
|
|
}
|
|
|
|
public /* synthetic */ Item(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
}
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r3v0, resolved type: java.util.List<? extends com.discord.widgets.user.WidgetUserMutualFriends$Model$Item> */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public Model(User user, List<? extends Item> list, int i) {
|
|
m.checkNotNullParameter(list, "items");
|
|
this.user = user;
|
|
this.items = list;
|
|
this.numMutualFriends = i;
|
|
}
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r0v0, resolved type: com.discord.widgets.user.WidgetUserMutualFriends$Model */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public static /* synthetic */ Model copy$default(Model model, User user, List list, int i, int i2, Object obj) {
|
|
if ((i2 & 1) != 0) {
|
|
user = model.user;
|
|
}
|
|
if ((i2 & 2) != 0) {
|
|
list = model.items;
|
|
}
|
|
if ((i2 & 4) != 0) {
|
|
i = model.numMutualFriends;
|
|
}
|
|
return model.copy(user, list, i);
|
|
}
|
|
|
|
public final User component1() {
|
|
return this.user;
|
|
}
|
|
|
|
public final List<Item> component2() {
|
|
return this.items;
|
|
}
|
|
|
|
public final int component3() {
|
|
return this.numMutualFriends;
|
|
}
|
|
|
|
public final Model copy(User user, List<? extends Item> list, int i) {
|
|
m.checkNotNullParameter(list, "items");
|
|
return new Model(user, list, i);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof Model)) {
|
|
return false;
|
|
}
|
|
Model model = (Model) obj;
|
|
return m.areEqual(this.user, model.user) && m.areEqual(this.items, model.items) && this.numMutualFriends == model.numMutualFriends;
|
|
}
|
|
|
|
public final List<Item> getItems() {
|
|
return this.items;
|
|
}
|
|
|
|
public final int getNumMutualFriends() {
|
|
return this.numMutualFriends;
|
|
}
|
|
|
|
public final User getUser() {
|
|
return this.user;
|
|
}
|
|
|
|
public int hashCode() {
|
|
User user = this.user;
|
|
int i = 0;
|
|
int hashCode = (user != null ? user.hashCode() : 0) * 31;
|
|
List<Item> list = this.items;
|
|
if (list != null) {
|
|
i = list.hashCode();
|
|
}
|
|
return ((hashCode + i) * 31) + this.numMutualFriends;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder K = a.K("Model(user=");
|
|
K.append(this.user);
|
|
K.append(", items=");
|
|
K.append(this.items);
|
|
K.append(", numMutualFriends=");
|
|
return a.w(K, this.numMutualFriends, ")");
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetUserMutualFriends.kt */
|
|
public static final class MutualFriendsAdapter extends MGRecyclerAdapterSimple<Model.Item> {
|
|
private final AppFragment fragment;
|
|
|
|
/* compiled from: WidgetUserMutualFriends.kt */
|
|
public static final class ViewHolder extends MGRecyclerViewHolder<MutualFriendsAdapter, Model.Item> {
|
|
private final WidgetUserProfileAdapterItemFriendBinding binding;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public ViewHolder(MutualFriendsAdapter mutualFriendsAdapter) {
|
|
super(2131559301, mutualFriendsAdapter);
|
|
m.checkNotNullParameter(mutualFriendsAdapter, "adapter");
|
|
View view = this.itemView;
|
|
int i = 2131364084;
|
|
View findViewById = view.findViewById(2131364084);
|
|
if (findViewById != null) {
|
|
s5 a = s5.a(findViewById);
|
|
i = 2131364085;
|
|
View findViewById2 = view.findViewById(2131364085);
|
|
if (findViewById2 != null) {
|
|
s5 a2 = s5.a(findViewById2);
|
|
i = 2131364086;
|
|
View findViewById3 = view.findViewById(2131364086);
|
|
if (findViewById3 != null) {
|
|
s5 a3 = s5.a(findViewById3);
|
|
i = 2131364087;
|
|
View findViewById4 = view.findViewById(2131364087);
|
|
if (findViewById4 != null) {
|
|
s5 a4 = s5.a(findViewById4);
|
|
i = 2131365535;
|
|
SimpleDraweeView simpleDraweeView = (SimpleDraweeView) view.findViewById(2131365535);
|
|
if (simpleDraweeView != null) {
|
|
i = 2131365536;
|
|
LinearLayout linearLayout = (LinearLayout) view.findViewById(2131365536);
|
|
if (linearLayout != null) {
|
|
i = 2131365539;
|
|
StatusView statusView = (StatusView) view.findViewById(2131365539);
|
|
if (statusView != null) {
|
|
i = 2131365540;
|
|
SimpleDraweeSpanTextView simpleDraweeSpanTextView = (SimpleDraweeSpanTextView) view.findViewById(2131365540);
|
|
if (simpleDraweeSpanTextView != null) {
|
|
i = 2131365541;
|
|
TextView textView = (TextView) view.findViewById(2131365541);
|
|
if (textView != null) {
|
|
WidgetUserProfileAdapterItemFriendBinding widgetUserProfileAdapterItemFriendBinding = new WidgetUserProfileAdapterItemFriendBinding((RelativeLayout) view, a, a2, a3, a4, simpleDraweeView, linearLayout, statusView, simpleDraweeSpanTextView, textView);
|
|
m.checkNotNullExpressionValue(widgetUserProfileAdapterItemFriendBinding, "WidgetUserProfileAdapter…endBinding.bind(itemView)");
|
|
this.binding = widgetUserProfileAdapterItemFriendBinding;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
throw new NullPointerException("Missing required view with ID: ".concat(view.getResources().getResourceName(i)));
|
|
}
|
|
|
|
public static final /* synthetic */ MutualFriendsAdapter access$getAdapter$p(ViewHolder viewHolder) {
|
|
return (MutualFriendsAdapter) viewHolder.adapter;
|
|
}
|
|
|
|
public void onConfigure(int i, Model.Item item) {
|
|
m.checkNotNullParameter(item, "data");
|
|
super.onConfigure(i, (int) item);
|
|
Model.Item.MutualFriend mutualFriend = (Model.Item.MutualFriend) item;
|
|
this.itemView.setOnClickListener(new WidgetUserMutualFriends$MutualFriendsAdapter$ViewHolder$onConfigure$1(this, mutualFriend));
|
|
TextView textView = this.binding.i;
|
|
m.checkNotNullExpressionValue(textView, "binding.userProfileAdapterItemFriendUserName");
|
|
textView.setText(mutualFriend.getUser().getUsername());
|
|
this.binding.g.setPresence(mutualFriend.getPresence());
|
|
SimpleDraweeSpanTextView simpleDraweeSpanTextView = this.binding.h;
|
|
Presence presence = mutualFriend.getPresence();
|
|
Boolean isApplicationStreaming = mutualFriend.isApplicationStreaming();
|
|
m.checkNotNull(isApplicationStreaming);
|
|
boolean booleanValue = isApplicationStreaming.booleanValue();
|
|
m.checkNotNullExpressionValue(simpleDraweeSpanTextView, "it");
|
|
PresenceUtils.setPresenceText$default(presence, booleanValue, simpleDraweeSpanTextView, true, false, 16, null);
|
|
SimpleDraweeView simpleDraweeView = this.binding.f;
|
|
m.checkNotNullExpressionValue(simpleDraweeView, "binding.userProfileAdapterItemFriendAvatar");
|
|
IconUtils.setIcon$default(simpleDraweeView, mutualFriend.getUser(), 2131165296, null, null, null, 56, null);
|
|
int i2 = 0;
|
|
while (i2 <= 3) {
|
|
s5 s5Var = i2 != 1 ? i2 != 2 ? i2 != 3 ? i2 != 4 ? this.binding.e : this.binding.e : this.binding.d : this.binding.f2012c : this.binding.b;
|
|
m.checkNotNullExpressionValue(s5Var, "when (i) {\n 1…mutualServer4\n }");
|
|
RelativeLayout relativeLayout = s5Var.a;
|
|
m.checkNotNullExpressionValue(relativeLayout, "item.root");
|
|
relativeLayout.setVisibility(8);
|
|
TextView textView2 = s5Var.f158c;
|
|
m.checkNotNullExpressionValue(textView2, "item.userProfileAdapterItemFriendMutualText");
|
|
textView2.setVisibility(8);
|
|
SimpleDraweeView simpleDraweeView2 = s5Var.b;
|
|
m.checkNotNullExpressionValue(simpleDraweeView2, "item.userProfileAdapterItemFriendMutualImage");
|
|
simpleDraweeView2.setVisibility(8);
|
|
Guild guild = (Guild) u.getOrNull(mutualFriend.getMutualGuilds(), i2);
|
|
if (guild != null) {
|
|
RelativeLayout relativeLayout2 = s5Var.a;
|
|
m.checkNotNullExpressionValue(relativeLayout2, "item.root");
|
|
relativeLayout2.setVisibility(0);
|
|
if (guild.getIcon() != null) {
|
|
SimpleDraweeView simpleDraweeView3 = s5Var.b;
|
|
m.checkNotNullExpressionValue(simpleDraweeView3, "item.userProfileAdapterItemFriendMutualImage");
|
|
simpleDraweeView3.setVisibility(0);
|
|
SimpleDraweeView simpleDraweeView4 = s5Var.b;
|
|
m.checkNotNullExpressionValue(simpleDraweeView4, "imageView");
|
|
IconUtils.setIcon$default((ImageView) simpleDraweeView4, guild, 0, (MGImages.ChangeDetector) null, false, 28, (Object) null);
|
|
} else {
|
|
TextView textView3 = s5Var.f158c;
|
|
m.checkNotNullExpressionValue(textView3, "item.userProfileAdapterItemFriendMutualText");
|
|
textView3.setVisibility(0);
|
|
TextView textView4 = s5Var.f158c;
|
|
m.checkNotNullExpressionValue(textView4, "item.userProfileAdapterItemFriendMutualText");
|
|
textView4.setText(guild.getShortName());
|
|
}
|
|
}
|
|
i2++;
|
|
}
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public MutualFriendsAdapter(RecyclerView recyclerView, AppFragment appFragment) {
|
|
super(recyclerView, false, 2, null);
|
|
m.checkNotNullParameter(recyclerView, "recyclerView");
|
|
m.checkNotNullParameter(appFragment, "fragment");
|
|
this.fragment = appFragment;
|
|
}
|
|
|
|
public static final /* synthetic */ AppFragment access$getFragment$p(MutualFriendsAdapter mutualFriendsAdapter) {
|
|
return mutualFriendsAdapter.fragment;
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
|
|
public MGRecyclerViewHolder<?, Model.Item> onCreateViewHolder(ViewGroup viewGroup, int i) {
|
|
m.checkNotNullParameter(viewGroup, "parent");
|
|
if (i == 0) {
|
|
return new WidgetUserProfileEmptyListItem(2131559300, this, 2130969516, 2131891560);
|
|
}
|
|
if (i == 1) {
|
|
return new ViewHolder(this);
|
|
}
|
|
throw invalidViewTypeException(i);
|
|
}
|
|
}
|
|
|
|
public WidgetUserMutualFriends() {
|
|
super(2131559295);
|
|
}
|
|
|
|
public static final /* synthetic */ void access$configureUI(WidgetUserMutualFriends widgetUserMutualFriends, Model model) {
|
|
widgetUserMutualFriends.configureUI(model);
|
|
}
|
|
|
|
private final void configureUI(Model model) {
|
|
Resources resources = getResources();
|
|
m.checkNotNullExpressionValue(resources, "resources");
|
|
setActionBarTitle(StringResourceUtilsKt.getQuantityString(resources, 2131755356, 2131891471, model.getNumMutualFriends(), Integer.valueOf(model.getNumMutualFriends())));
|
|
User user = model.getUser();
|
|
setActionBarSubtitle(user != null ? user.getUsername() : null);
|
|
MutualFriendsAdapter mutualFriendsAdapter = this.adapter;
|
|
if (mutualFriendsAdapter != null) {
|
|
mutualFriendsAdapter.setData(model.getItems());
|
|
}
|
|
}
|
|
|
|
private final WidgetUserMutualFriendsBinding getBinding() {
|
|
return (WidgetUserMutualFriendsBinding) this.binding$delegate.getValue((Fragment) this, $$delegatedProperties[0]);
|
|
}
|
|
|
|
private final long getUserId() {
|
|
return ((Number) this.userId$delegate.getValue()).longValue();
|
|
}
|
|
|
|
@Override // com.discord.app.AppFragment
|
|
public void onViewBound(View view) {
|
|
m.checkNotNullParameter(view, "view");
|
|
super.onViewBound(view);
|
|
MGRecyclerAdapter.Companion companion = MGRecyclerAdapter.Companion;
|
|
RecyclerView recyclerView = getBinding().b;
|
|
m.checkNotNullExpressionValue(recyclerView, "binding.userMutualFriendsRecyclerView");
|
|
this.adapter = (MutualFriendsAdapter) companion.configure(new MutualFriendsAdapter(recyclerView, this));
|
|
}
|
|
|
|
@Override // com.discord.app.AppFragment
|
|
public void onViewBoundOrOnResume() {
|
|
super.onViewBoundOrOnResume();
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(Model.Companion.get(getUserId()), this, null, 2, null), WidgetUserMutualFriends.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new WidgetUserMutualFriends$onViewBoundOrOnResume$1(this), 62, (Object) null);
|
|
}
|
|
}
|