821 lines
40 KiB
Java
821 lines
40 KiB
Java
package com.discord.widgets.voice.sheet;
|
|
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.FrameLayout;
|
|
import android.widget.ImageView;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.TextView;
|
|
import androidx.annotation.StringRes;
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
import c.a.k.b;
|
|
import c.d.b.a.a;
|
|
import com.discord.R;
|
|
import com.discord.api.guildscheduledevent.GuildScheduledEvent;
|
|
import com.discord.api.voice.state.VoiceState;
|
|
import com.discord.databinding.VoiceUserListItemEventBinding;
|
|
import com.discord.databinding.VoiceUserListItemHeaderBinding;
|
|
import com.discord.databinding.VoiceUserListItemUserBinding;
|
|
import com.discord.stores.StoreApplicationStreamPreviews;
|
|
import com.discord.stores.StoreVoiceParticipants;
|
|
import com.discord.utilities.colors.RepresentativeColorsKt;
|
|
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.streams.StreamContext;
|
|
import com.discord.views.StreamPreviewView;
|
|
import com.discord.views.VoiceUserView;
|
|
import com.discord.widgets.guildscheduledevent.GuildScheduledEventItemView;
|
|
import com.google.android.material.button.MaterialButton;
|
|
import d0.z.d.m;
|
|
import java.util.Objects;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
/* compiled from: CallParticipantsAdapter.kt */
|
|
public final class CallParticipantsAdapter extends MGRecyclerAdapterSimple<MGRecyclerDataPayload> {
|
|
public static final Companion Companion = new Companion(null);
|
|
private static final int VIEW_TYPE_DIVIDER = 3;
|
|
private static final int VIEW_TYPE_EVENT = 5;
|
|
private static final int VIEW_TYPE_HEADER = 1;
|
|
private static final int VIEW_TYPE_INVITE = 4;
|
|
private static final int VIEW_TYPE_SPECTATORS_HEADER = 2;
|
|
private static final int VIEW_TYPE_VOICE_USER = 0;
|
|
private Function1<? super GuildScheduledEvent, Unit> onEventClicked;
|
|
private Function1<? super View, Unit> onInviteFriendsClicked;
|
|
private Function1<? super GuildScheduledEvent, Unit> onStartEventClicked;
|
|
private Function1<? super StreamContext, Unit> onStreamPreviewClicked;
|
|
private Function1<? super StoreVoiceParticipants.VoiceUser, Unit> onToggleRingingClicked;
|
|
private Function1<? super StoreVoiceParticipants.VoiceUser, Unit> onVoiceUserClicked;
|
|
private final boolean quantizeUserAvatars;
|
|
|
|
/* compiled from: CallParticipantsAdapter.kt */
|
|
public static final class Companion {
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
}
|
|
|
|
/* compiled from: CallParticipantsAdapter.kt */
|
|
public static abstract class ListItem implements MGRecyclerDataPayload {
|
|
|
|
/* compiled from: CallParticipantsAdapter.kt */
|
|
public static final class Divider extends ListItem {
|
|
public static final Divider INSTANCE = new Divider();
|
|
private static final String key = String.valueOf(3);
|
|
private static final int type = 3;
|
|
|
|
private Divider() {
|
|
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: CallParticipantsAdapter.kt */
|
|
public static final class Event extends ListItem {
|
|
private final boolean canStartEvent;
|
|
private final GuildScheduledEvent event;
|
|
private final boolean isCurrentUserInCall;
|
|
private final String key = String.valueOf(5);
|
|
private final int type = 5;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public Event(GuildScheduledEvent guildScheduledEvent, boolean z2, boolean z3) {
|
|
super(null);
|
|
m.checkNotNullParameter(guildScheduledEvent, "event");
|
|
this.event = guildScheduledEvent;
|
|
this.canStartEvent = z2;
|
|
this.isCurrentUserInCall = z3;
|
|
}
|
|
|
|
public static /* synthetic */ Event copy$default(Event event, GuildScheduledEvent guildScheduledEvent, boolean z2, boolean z3, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
guildScheduledEvent = event.event;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
z2 = event.canStartEvent;
|
|
}
|
|
if ((i & 4) != 0) {
|
|
z3 = event.isCurrentUserInCall;
|
|
}
|
|
return event.copy(guildScheduledEvent, z2, z3);
|
|
}
|
|
|
|
public final GuildScheduledEvent component1() {
|
|
return this.event;
|
|
}
|
|
|
|
public final boolean component2() {
|
|
return this.canStartEvent;
|
|
}
|
|
|
|
public final boolean component3() {
|
|
return this.isCurrentUserInCall;
|
|
}
|
|
|
|
public final Event copy(GuildScheduledEvent guildScheduledEvent, boolean z2, boolean z3) {
|
|
m.checkNotNullParameter(guildScheduledEvent, "event");
|
|
return new Event(guildScheduledEvent, z2, z3);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof Event)) {
|
|
return false;
|
|
}
|
|
Event event = (Event) obj;
|
|
return m.areEqual(this.event, event.event) && this.canStartEvent == event.canStartEvent && this.isCurrentUserInCall == event.isCurrentUserInCall;
|
|
}
|
|
|
|
public final boolean getCanStartEvent() {
|
|
return this.canStartEvent;
|
|
}
|
|
|
|
public final GuildScheduledEvent getEvent() {
|
|
return this.event;
|
|
}
|
|
|
|
@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() {
|
|
GuildScheduledEvent guildScheduledEvent = this.event;
|
|
int hashCode = (guildScheduledEvent != null ? guildScheduledEvent.hashCode() : 0) * 31;
|
|
boolean z2 = this.canStartEvent;
|
|
int i = 1;
|
|
if (z2) {
|
|
z2 = true;
|
|
}
|
|
int i2 = z2 ? 1 : 0;
|
|
int i3 = z2 ? 1 : 0;
|
|
int i4 = z2 ? 1 : 0;
|
|
int i5 = (hashCode + i2) * 31;
|
|
boolean z3 = this.isCurrentUserInCall;
|
|
if (!z3) {
|
|
i = z3 ? 1 : 0;
|
|
}
|
|
return i5 + i;
|
|
}
|
|
|
|
public final boolean isCurrentUserInCall() {
|
|
return this.isCurrentUserInCall;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder P = a.P("Event(event=");
|
|
P.append(this.event);
|
|
P.append(", canStartEvent=");
|
|
P.append(this.canStartEvent);
|
|
P.append(", isCurrentUserInCall=");
|
|
return a.L(P, this.isCurrentUserInCall, ")");
|
|
}
|
|
}
|
|
|
|
/* compiled from: CallParticipantsAdapter.kt */
|
|
public static final class Header extends ListItem {
|
|
private final String key;
|
|
private final int stringResId;
|
|
private final int type = 1;
|
|
|
|
public Header(@StringRes int i) {
|
|
super(null);
|
|
this.stringResId = i;
|
|
this.key = String.valueOf(i);
|
|
}
|
|
|
|
public static /* synthetic */ Header copy$default(Header header, int i, int i2, Object obj) {
|
|
if ((i2 & 1) != 0) {
|
|
i = header.stringResId;
|
|
}
|
|
return header.copy(i);
|
|
}
|
|
|
|
public final int component1() {
|
|
return this.stringResId;
|
|
}
|
|
|
|
public final Header copy(@StringRes int i) {
|
|
return new Header(i);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this != obj) {
|
|
return (obj instanceof Header) && this.stringResId == ((Header) obj).stringResId;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@Override // com.discord.utilities.mg_recycler.MGRecyclerDataPayload, com.discord.utilities.recycler.DiffKeyProvider
|
|
public String getKey() {
|
|
return this.key;
|
|
}
|
|
|
|
public final int getStringResId() {
|
|
return this.stringResId;
|
|
}
|
|
|
|
@Override // com.discord.utilities.mg_recycler.MGRecyclerDataPayload
|
|
public int getType() {
|
|
return this.type;
|
|
}
|
|
|
|
public int hashCode() {
|
|
return this.stringResId;
|
|
}
|
|
|
|
public String toString() {
|
|
return a.z(a.P("Header(stringResId="), this.stringResId, ")");
|
|
}
|
|
}
|
|
|
|
/* compiled from: CallParticipantsAdapter.kt */
|
|
public static final class Invite extends ListItem {
|
|
public static final Invite INSTANCE = new Invite();
|
|
private static final String key = String.valueOf(4);
|
|
private static final int type = 4;
|
|
|
|
private Invite() {
|
|
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: CallParticipantsAdapter.kt */
|
|
public static final class SpectatorsHeader extends ListItem {
|
|
private final String key = "SpectatorsHeader";
|
|
private final String streamerName;
|
|
private final int type = 2;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public SpectatorsHeader(String str) {
|
|
super(null);
|
|
m.checkNotNullParameter(str, "streamerName");
|
|
this.streamerName = str;
|
|
}
|
|
|
|
public static /* synthetic */ SpectatorsHeader copy$default(SpectatorsHeader spectatorsHeader, String str, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
str = spectatorsHeader.streamerName;
|
|
}
|
|
return spectatorsHeader.copy(str);
|
|
}
|
|
|
|
public final String component1() {
|
|
return this.streamerName;
|
|
}
|
|
|
|
public final SpectatorsHeader copy(String str) {
|
|
m.checkNotNullParameter(str, "streamerName");
|
|
return new SpectatorsHeader(str);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this != obj) {
|
|
return (obj instanceof SpectatorsHeader) && m.areEqual(this.streamerName, ((SpectatorsHeader) obj).streamerName);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@Override // com.discord.utilities.mg_recycler.MGRecyclerDataPayload, com.discord.utilities.recycler.DiffKeyProvider
|
|
public String getKey() {
|
|
return this.key;
|
|
}
|
|
|
|
public final String getStreamerName() {
|
|
return this.streamerName;
|
|
}
|
|
|
|
@Override // com.discord.utilities.mg_recycler.MGRecyclerDataPayload
|
|
public int getType() {
|
|
return this.type;
|
|
}
|
|
|
|
public int hashCode() {
|
|
String str = this.streamerName;
|
|
if (str != null) {
|
|
return str.hashCode();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public String toString() {
|
|
return a.H(a.P("SpectatorsHeader(streamerName="), this.streamerName, ")");
|
|
}
|
|
}
|
|
|
|
/* compiled from: CallParticipantsAdapter.kt */
|
|
public static final class VoiceUser extends ListItem {
|
|
private final boolean canRing;
|
|
private final boolean isSpectatingSameStream;
|
|
private final String key;
|
|
private final StoreVoiceParticipants.VoiceUser participant;
|
|
private final int type;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public VoiceUser(StoreVoiceParticipants.VoiceUser voiceUser, boolean z2, boolean z3) {
|
|
super(null);
|
|
m.checkNotNullParameter(voiceUser, "participant");
|
|
this.participant = voiceUser;
|
|
this.canRing = z2;
|
|
this.isSpectatingSameStream = z3;
|
|
this.key = String.valueOf(voiceUser.getUser().getId());
|
|
}
|
|
|
|
public static /* synthetic */ VoiceUser copy$default(VoiceUser voiceUser, StoreVoiceParticipants.VoiceUser voiceUser2, boolean z2, boolean z3, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
voiceUser2 = voiceUser.participant;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
z2 = voiceUser.canRing;
|
|
}
|
|
if ((i & 4) != 0) {
|
|
z3 = voiceUser.isSpectatingSameStream;
|
|
}
|
|
return voiceUser.copy(voiceUser2, z2, z3);
|
|
}
|
|
|
|
public final StoreVoiceParticipants.VoiceUser component1() {
|
|
return this.participant;
|
|
}
|
|
|
|
public final boolean component2() {
|
|
return this.canRing;
|
|
}
|
|
|
|
public final boolean component3() {
|
|
return this.isSpectatingSameStream;
|
|
}
|
|
|
|
public final VoiceUser copy(StoreVoiceParticipants.VoiceUser voiceUser, boolean z2, boolean z3) {
|
|
m.checkNotNullParameter(voiceUser, "participant");
|
|
return new VoiceUser(voiceUser, z2, z3);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof VoiceUser)) {
|
|
return false;
|
|
}
|
|
VoiceUser voiceUser = (VoiceUser) obj;
|
|
return m.areEqual(this.participant, voiceUser.participant) && this.canRing == voiceUser.canRing && this.isSpectatingSameStream == voiceUser.isSpectatingSameStream;
|
|
}
|
|
|
|
public final boolean getCanRing() {
|
|
return this.canRing;
|
|
}
|
|
|
|
@Override // com.discord.utilities.mg_recycler.MGRecyclerDataPayload, com.discord.utilities.recycler.DiffKeyProvider
|
|
public String getKey() {
|
|
return this.key;
|
|
}
|
|
|
|
public final StoreVoiceParticipants.VoiceUser getParticipant() {
|
|
return this.participant;
|
|
}
|
|
|
|
@Override // com.discord.utilities.mg_recycler.MGRecyclerDataPayload
|
|
public int getType() {
|
|
return this.type;
|
|
}
|
|
|
|
public int hashCode() {
|
|
StoreVoiceParticipants.VoiceUser voiceUser = this.participant;
|
|
int hashCode = (voiceUser != null ? voiceUser.hashCode() : 0) * 31;
|
|
boolean z2 = this.canRing;
|
|
int i = 1;
|
|
if (z2) {
|
|
z2 = true;
|
|
}
|
|
int i2 = z2 ? 1 : 0;
|
|
int i3 = z2 ? 1 : 0;
|
|
int i4 = z2 ? 1 : 0;
|
|
int i5 = (hashCode + i2) * 31;
|
|
boolean z3 = this.isSpectatingSameStream;
|
|
if (!z3) {
|
|
i = z3 ? 1 : 0;
|
|
}
|
|
return i5 + i;
|
|
}
|
|
|
|
public final boolean isSpectatingSameStream() {
|
|
return this.isSpectatingSameStream;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder P = a.P("VoiceUser(participant=");
|
|
P.append(this.participant);
|
|
P.append(", canRing=");
|
|
P.append(this.canRing);
|
|
P.append(", isSpectatingSameStream=");
|
|
return a.L(P, this.isSpectatingSameStream, ")");
|
|
}
|
|
}
|
|
|
|
private ListItem() {
|
|
}
|
|
|
|
public /* synthetic */ ListItem(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
}
|
|
|
|
/* compiled from: CallParticipantsAdapter.kt */
|
|
public static final class ViewHolderDivider extends MGRecyclerViewHolder<CallParticipantsAdapter, MGRecyclerDataPayload> {
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public ViewHolderDivider(CallParticipantsAdapter callParticipantsAdapter) {
|
|
super((int) R.layout.voice_user_list_item_divider, callParticipantsAdapter);
|
|
m.checkNotNullParameter(callParticipantsAdapter, "adapter");
|
|
}
|
|
}
|
|
|
|
/* compiled from: CallParticipantsAdapter.kt */
|
|
public static final class ViewHolderEvent extends MGRecyclerViewHolder<CallParticipantsAdapter, MGRecyclerDataPayload> {
|
|
private final VoiceUserListItemEventBinding binding;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public ViewHolderEvent(CallParticipantsAdapter callParticipantsAdapter) {
|
|
super((int) R.layout.voice_user_list_item_event, callParticipantsAdapter);
|
|
m.checkNotNullParameter(callParticipantsAdapter, "adapter");
|
|
View view = this.itemView;
|
|
GuildScheduledEventItemView guildScheduledEventItemView = (GuildScheduledEventItemView) view.findViewById(R.id.event_card);
|
|
if (guildScheduledEventItemView != null) {
|
|
VoiceUserListItemEventBinding voiceUserListItemEventBinding = new VoiceUserListItemEventBinding((FrameLayout) view, guildScheduledEventItemView);
|
|
m.checkNotNullExpressionValue(voiceUserListItemEventBinding, "VoiceUserListItemEventBinding.bind(itemView)");
|
|
this.binding = voiceUserListItemEventBinding;
|
|
return;
|
|
}
|
|
throw new NullPointerException("Missing required view with ID: ".concat(view.getResources().getResourceName(R.id.event_card)));
|
|
}
|
|
|
|
public static final /* synthetic */ CallParticipantsAdapter access$getAdapter$p(ViewHolderEvent viewHolderEvent) {
|
|
return (CallParticipantsAdapter) viewHolderEvent.adapter;
|
|
}
|
|
|
|
public void onConfigure(int i, MGRecyclerDataPayload mGRecyclerDataPayload) {
|
|
m.checkNotNullParameter(mGRecyclerDataPayload, "data");
|
|
super.onConfigure(i, (int) mGRecyclerDataPayload);
|
|
if (mGRecyclerDataPayload instanceof ListItem.Event) {
|
|
ListItem.Event event = (ListItem.Event) mGRecyclerDataPayload;
|
|
this.binding.b.configureInVoiceChannel(event.getEvent(), event.getCanStartEvent() && event.isCurrentUserInCall(), event.isCurrentUserInCall(), new CallParticipantsAdapter$ViewHolderEvent$onConfigure$1(this, mGRecyclerDataPayload));
|
|
this.binding.b.setOnClickListener(new CallParticipantsAdapter$ViewHolderEvent$onConfigure$2(this, mGRecyclerDataPayload));
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: CallParticipantsAdapter.kt */
|
|
public static final class ViewHolderHeader extends MGRecyclerViewHolder<CallParticipantsAdapter, MGRecyclerDataPayload> {
|
|
private final VoiceUserListItemHeaderBinding binding;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public ViewHolderHeader(CallParticipantsAdapter callParticipantsAdapter) {
|
|
super((int) R.layout.voice_user_list_item_header, callParticipantsAdapter);
|
|
m.checkNotNullParameter(callParticipantsAdapter, "adapter");
|
|
View view = this.itemView;
|
|
Objects.requireNonNull(view, "rootView");
|
|
TextView textView = (TextView) view;
|
|
VoiceUserListItemHeaderBinding voiceUserListItemHeaderBinding = new VoiceUserListItemHeaderBinding(textView, textView);
|
|
m.checkNotNullExpressionValue(voiceUserListItemHeaderBinding, "VoiceUserListItemHeaderBinding.bind(itemView)");
|
|
this.binding = voiceUserListItemHeaderBinding;
|
|
}
|
|
|
|
public void onConfigure(int i, MGRecyclerDataPayload mGRecyclerDataPayload) {
|
|
m.checkNotNullParameter(mGRecyclerDataPayload, "data");
|
|
super.onConfigure(i, (int) mGRecyclerDataPayload);
|
|
if (mGRecyclerDataPayload instanceof ListItem.Header) {
|
|
this.binding.b.setText(((ListItem.Header) mGRecyclerDataPayload).getStringResId());
|
|
} else if (mGRecyclerDataPayload instanceof ListItem.SpectatorsHeader) {
|
|
TextView textView = this.binding.b;
|
|
m.checkNotNullExpressionValue(textView, "binding.voiceUserListItemHeaderLabel");
|
|
TextView textView2 = this.binding.b;
|
|
m.checkNotNullExpressionValue(textView2, "binding.voiceUserListItemHeaderLabel");
|
|
textView.setText(b.j(textView2, R.string.go_live_watching_user, new Object[]{((ListItem.SpectatorsHeader) mGRecyclerDataPayload).getStreamerName()}, null, 4));
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: CallParticipantsAdapter.kt */
|
|
public static final class ViewHolderInvite extends MGRecyclerViewHolder<CallParticipantsAdapter, MGRecyclerDataPayload> {
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public ViewHolderInvite(CallParticipantsAdapter callParticipantsAdapter) {
|
|
super((int) R.layout.voice_user_list_item_invite, callParticipantsAdapter);
|
|
m.checkNotNullParameter(callParticipantsAdapter, "adapter");
|
|
}
|
|
|
|
public static final /* synthetic */ CallParticipantsAdapter access$getAdapter$p(ViewHolderInvite viewHolderInvite) {
|
|
return (CallParticipantsAdapter) viewHolderInvite.adapter;
|
|
}
|
|
|
|
public void onConfigure(int i, MGRecyclerDataPayload mGRecyclerDataPayload) {
|
|
m.checkNotNullParameter(mGRecyclerDataPayload, "data");
|
|
super.onConfigure(i, (int) mGRecyclerDataPayload);
|
|
if (mGRecyclerDataPayload instanceof ListItem.Invite) {
|
|
this.itemView.setOnClickListener(new CallParticipantsAdapter$ViewHolderInvite$onConfigure$1(this));
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: CallParticipantsAdapter.kt */
|
|
public static final class ViewHolderUser extends MGRecyclerViewHolder<CallParticipantsAdapter, MGRecyclerDataPayload> {
|
|
private final VoiceUserListItemUserBinding binding;
|
|
private final boolean quantizeUserAvatar;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public ViewHolderUser(CallParticipantsAdapter callParticipantsAdapter, boolean z2) {
|
|
super((int) R.layout.voice_user_list_item_user, callParticipantsAdapter);
|
|
m.checkNotNullParameter(callParticipantsAdapter, "adapter");
|
|
this.quantizeUserAvatar = z2;
|
|
View view = this.itemView;
|
|
int i = R.id.voice_user_list_item_deafen_indicator;
|
|
ImageView imageView = (ImageView) view.findViewById(R.id.voice_user_list_item_deafen_indicator);
|
|
if (imageView != null) {
|
|
i = R.id.voice_user_list_item_live_indicator;
|
|
TextView textView = (TextView) view.findViewById(R.id.voice_user_list_item_live_indicator);
|
|
if (textView != null) {
|
|
i = R.id.voice_user_list_item_mute_indicator;
|
|
ImageView imageView2 = (ImageView) view.findViewById(R.id.voice_user_list_item_mute_indicator);
|
|
if (imageView2 != null) {
|
|
i = R.id.voice_user_list_item_spectating_indicator;
|
|
ImageView imageView3 = (ImageView) view.findViewById(R.id.voice_user_list_item_spectating_indicator);
|
|
if (imageView3 != null) {
|
|
i = R.id.voice_user_list_item_toggle_ringing;
|
|
MaterialButton materialButton = (MaterialButton) view.findViewById(R.id.voice_user_list_item_toggle_ringing);
|
|
if (materialButton != null) {
|
|
i = R.id.voice_user_list_item_user_avatar;
|
|
VoiceUserView voiceUserView = (VoiceUserView) view.findViewById(R.id.voice_user_list_item_user_avatar);
|
|
if (voiceUserView != null) {
|
|
i = R.id.voice_user_list_item_user_name;
|
|
TextView textView2 = (TextView) view.findViewById(R.id.voice_user_list_item_user_name);
|
|
if (textView2 != null) {
|
|
i = R.id.voice_user_list_item_user_stream_preview;
|
|
StreamPreviewView streamPreviewView = (StreamPreviewView) view.findViewById(R.id.voice_user_list_item_user_stream_preview);
|
|
if (streamPreviewView != null) {
|
|
i = R.id.voice_user_list_item_video_indicator;
|
|
ImageView imageView4 = (ImageView) view.findViewById(R.id.voice_user_list_item_video_indicator);
|
|
if (imageView4 != null) {
|
|
VoiceUserListItemUserBinding voiceUserListItemUserBinding = new VoiceUserListItemUserBinding((LinearLayout) view, imageView, textView, imageView2, imageView3, materialButton, voiceUserView, textView2, streamPreviewView, imageView4);
|
|
m.checkNotNullExpressionValue(voiceUserListItemUserBinding, "VoiceUserListItemUserBinding.bind(itemView)");
|
|
this.binding = voiceUserListItemUserBinding;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
throw new NullPointerException("Missing required view with ID: ".concat(view.getResources().getResourceName(i)));
|
|
}
|
|
|
|
public static final /* synthetic */ CallParticipantsAdapter access$getAdapter$p(ViewHolderUser viewHolderUser) {
|
|
return (CallParticipantsAdapter) viewHolderUser.adapter;
|
|
}
|
|
|
|
public void onConfigure(int i, MGRecyclerDataPayload mGRecyclerDataPayload) {
|
|
CharSequence charSequence;
|
|
CharSequence charSequence2;
|
|
StreamContext.Joinability joinability;
|
|
m.checkNotNullParameter(mGRecyclerDataPayload, "data");
|
|
super.onConfigure(i, (int) mGRecyclerDataPayload);
|
|
ListItem.VoiceUser voiceUser = (ListItem.VoiceUser) mGRecyclerDataPayload;
|
|
StoreVoiceParticipants.VoiceUser participant = voiceUser.getParticipant();
|
|
String colorId = RepresentativeColorsKt.getColorId(participant.getUser());
|
|
if (this.quantizeUserAvatar) {
|
|
this.binding.g.setOnBitmapLoadedListener(new CallParticipantsAdapter$ViewHolderUser$onConfigure$1(colorId));
|
|
}
|
|
this.binding.g.a(participant, R.dimen.avatar_size_standard);
|
|
TextView textView = this.binding.h;
|
|
m.checkNotNullExpressionValue(textView, "binding.voiceUserListItemUserName");
|
|
textView.setText(participant.getDisplayName());
|
|
this.itemView.setOnClickListener(new CallParticipantsAdapter$ViewHolderUser$onConfigure$2(this, participant));
|
|
MaterialButton materialButton = this.binding.f;
|
|
m.checkNotNullExpressionValue(materialButton, "binding.voiceUserListItemToggleRinging");
|
|
boolean z2 = false;
|
|
materialButton.setVisibility(voiceUser.getCanRing() ? 0 : 8);
|
|
MaterialButton materialButton2 = this.binding.f;
|
|
m.checkNotNullExpressionValue(materialButton2, "binding.voiceUserListItemToggleRinging");
|
|
if (participant.isRinging()) {
|
|
MaterialButton materialButton3 = this.binding.f;
|
|
m.checkNotNullExpressionValue(materialButton3, "binding.voiceUserListItemToggleRinging");
|
|
charSequence = b.j(materialButton3, R.string.stop_ringing, new Object[0], null, 4);
|
|
} else {
|
|
MaterialButton materialButton4 = this.binding.f;
|
|
m.checkNotNullExpressionValue(materialButton4, "binding.voiceUserListItemToggleRinging");
|
|
charSequence = b.j(materialButton4, R.string.ring, new Object[0], null, 4);
|
|
}
|
|
materialButton2.setText(charSequence);
|
|
this.binding.f.setOnClickListener(new CallParticipantsAdapter$ViewHolderUser$onConfigure$3(this, participant));
|
|
MaterialButton materialButton5 = this.binding.f;
|
|
m.checkNotNullExpressionValue(materialButton5, "binding.voiceUserListItemToggleRinging");
|
|
if (participant.isRinging()) {
|
|
MaterialButton materialButton6 = this.binding.f;
|
|
m.checkNotNullExpressionValue(materialButton6, "binding.voiceUserListItemToggleRinging");
|
|
charSequence2 = b.j(materialButton6, R.string.stop_ringing_username_a11y_label, new Object[]{participant.getDisplayName()}, null, 4);
|
|
} else {
|
|
MaterialButton materialButton7 = this.binding.f;
|
|
m.checkNotNullExpressionValue(materialButton7, "binding.voiceUserListItemToggleRinging");
|
|
charSequence2 = b.j(materialButton7, R.string.ring_username_a11y_label, new Object[]{participant.getDisplayName()}, null, 4);
|
|
}
|
|
materialButton5.setContentDescription(charSequence2);
|
|
if (!participant.isConnected() || participant.getVoiceState() == null) {
|
|
ImageView imageView = this.binding.b;
|
|
m.checkNotNullExpressionValue(imageView, "binding.voiceUserListItemDeafenIndicator");
|
|
imageView.setVisibility(8);
|
|
ImageView imageView2 = this.binding.d;
|
|
m.checkNotNullExpressionValue(imageView2, "binding.voiceUserListItemMuteIndicator");
|
|
imageView2.setVisibility(8);
|
|
StreamPreviewView streamPreviewView = this.binding.i;
|
|
m.checkNotNullExpressionValue(streamPreviewView, "binding.voiceUserListItemUserStreamPreview");
|
|
streamPreviewView.setVisibility(8);
|
|
ImageView imageView3 = this.binding.j;
|
|
m.checkNotNullExpressionValue(imageView3, "binding.voiceUserListItemVideoIndicator");
|
|
imageView3.setVisibility(8);
|
|
ImageView imageView4 = this.binding.e;
|
|
m.checkNotNullExpressionValue(imageView4, "binding.voiceUserListItemSpectatingIndicator");
|
|
imageView4.setVisibility(8);
|
|
TextView textView2 = this.binding.f1702c;
|
|
m.checkNotNullExpressionValue(textView2, "binding.voiceUserListItemLiveIndicator");
|
|
textView2.setVisibility(8);
|
|
return;
|
|
}
|
|
ImageView imageView5 = this.binding.b;
|
|
m.checkNotNullExpressionValue(imageView5, "binding.voiceUserListItemDeafenIndicator");
|
|
imageView5.setVisibility(0);
|
|
ImageView imageView6 = this.binding.d;
|
|
m.checkNotNullExpressionValue(imageView6, "binding.voiceUserListItemMuteIndicator");
|
|
imageView6.setVisibility(0);
|
|
VoiceState voiceState = participant.getVoiceState();
|
|
boolean z3 = voiceState.g() || voiceState.b();
|
|
boolean z4 = voiceState.h() || voiceState.e() || voiceState.l();
|
|
boolean j = voiceState.j();
|
|
ImageView imageView7 = this.binding.e;
|
|
m.checkNotNullExpressionValue(imageView7, "binding.voiceUserListItemSpectatingIndicator");
|
|
imageView7.setVisibility(voiceUser.isSpectatingSameStream() ? 0 : 8);
|
|
ImageView imageView8 = this.binding.b;
|
|
m.checkNotNullExpressionValue(imageView8, "binding.voiceUserListItemDeafenIndicator");
|
|
imageView8.setVisibility(z3 ? 0 : 8);
|
|
ImageView imageView9 = this.binding.d;
|
|
m.checkNotNullExpressionValue(imageView9, "binding.voiceUserListItemMuteIndicator");
|
|
imageView9.setVisibility(z4 ? 0 : 8);
|
|
ImageView imageView10 = this.binding.j;
|
|
m.checkNotNullExpressionValue(imageView10, "binding.voiceUserListItemVideoIndicator");
|
|
imageView10.setVisibility(j ? 0 : 8);
|
|
StreamContext streamContext = participant.getStreamContext();
|
|
TextView textView3 = this.binding.f1702c;
|
|
m.checkNotNullExpressionValue(textView3, "binding.voiceUserListItemLiveIndicator");
|
|
textView3.setVisibility(streamContext != null ? 0 : 8);
|
|
StoreApplicationStreamPreviews.StreamPreview preview = streamContext != null ? streamContext.getPreview() : null;
|
|
if (preview == null || streamContext.getJoinability() != (joinability = StreamContext.Joinability.CAN_CONNECT)) {
|
|
StreamPreviewView streamPreviewView2 = this.binding.i;
|
|
m.checkNotNullExpressionValue(streamPreviewView2, "binding.voiceUserListItemUserStreamPreview");
|
|
streamPreviewView2.setVisibility(8);
|
|
return;
|
|
}
|
|
StreamPreviewView streamPreviewView3 = this.binding.i;
|
|
m.checkNotNullExpressionValue(streamPreviewView3, "binding.voiceUserListItemUserStreamPreview");
|
|
streamPreviewView3.setVisibility(0);
|
|
this.binding.i.setOnClickListener(new CallParticipantsAdapter$ViewHolderUser$onConfigure$4(this, participant));
|
|
StreamContext streamContext2 = voiceUser.getParticipant().getStreamContext();
|
|
if (streamContext2 != null && streamContext2.isCurrentUserParticipating()) {
|
|
z2 = true;
|
|
}
|
|
this.binding.i.a(preview, joinability, z2);
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public CallParticipantsAdapter(RecyclerView recyclerView, boolean z2) {
|
|
super(recyclerView, false, 2, null);
|
|
m.checkNotNullParameter(recyclerView, "recycler");
|
|
this.quantizeUserAvatars = z2;
|
|
this.onVoiceUserClicked = CallParticipantsAdapter$onVoiceUserClicked$1.INSTANCE;
|
|
this.onStreamPreviewClicked = CallParticipantsAdapter$onStreamPreviewClicked$1.INSTANCE;
|
|
this.onToggleRingingClicked = CallParticipantsAdapter$onToggleRingingClicked$1.INSTANCE;
|
|
this.onInviteFriendsClicked = CallParticipantsAdapter$onInviteFriendsClicked$1.INSTANCE;
|
|
this.onEventClicked = CallParticipantsAdapter$onEventClicked$1.INSTANCE;
|
|
this.onStartEventClicked = CallParticipantsAdapter$onStartEventClicked$1.INSTANCE;
|
|
}
|
|
|
|
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
|
|
public /* synthetic */ CallParticipantsAdapter(RecyclerView recyclerView, boolean z2, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(recyclerView, (i & 2) != 0 ? false : z2);
|
|
}
|
|
|
|
/* JADX DEBUG: Type inference failed for r0v0. Raw type applied. Possible types: kotlin.jvm.functions.Function1<? super com.discord.api.guildscheduledevent.GuildScheduledEvent, kotlin.Unit>, kotlin.jvm.functions.Function1<com.discord.api.guildscheduledevent.GuildScheduledEvent, kotlin.Unit> */
|
|
public final Function1<GuildScheduledEvent, Unit> getOnEventClicked() {
|
|
return this.onEventClicked;
|
|
}
|
|
|
|
/* JADX DEBUG: Type inference failed for r0v0. Raw type applied. Possible types: kotlin.jvm.functions.Function1<? super android.view.View, kotlin.Unit>, kotlin.jvm.functions.Function1<android.view.View, kotlin.Unit> */
|
|
public final Function1<View, Unit> getOnInviteFriendsClicked() {
|
|
return this.onInviteFriendsClicked;
|
|
}
|
|
|
|
/* JADX DEBUG: Type inference failed for r0v0. Raw type applied. Possible types: kotlin.jvm.functions.Function1<? super com.discord.api.guildscheduledevent.GuildScheduledEvent, kotlin.Unit>, kotlin.jvm.functions.Function1<com.discord.api.guildscheduledevent.GuildScheduledEvent, kotlin.Unit> */
|
|
public final Function1<GuildScheduledEvent, Unit> getOnStartEventClicked() {
|
|
return this.onStartEventClicked;
|
|
}
|
|
|
|
/* JADX DEBUG: Type inference failed for r0v0. Raw type applied. Possible types: kotlin.jvm.functions.Function1<? super com.discord.utilities.streams.StreamContext, kotlin.Unit>, kotlin.jvm.functions.Function1<com.discord.utilities.streams.StreamContext, kotlin.Unit> */
|
|
public final Function1<StreamContext, Unit> getOnStreamPreviewClicked() {
|
|
return this.onStreamPreviewClicked;
|
|
}
|
|
|
|
/* JADX DEBUG: Type inference failed for r0v0. Raw type applied. Possible types: kotlin.jvm.functions.Function1<? super com.discord.stores.StoreVoiceParticipants$VoiceUser, kotlin.Unit>, kotlin.jvm.functions.Function1<com.discord.stores.StoreVoiceParticipants$VoiceUser, kotlin.Unit> */
|
|
public final Function1<StoreVoiceParticipants.VoiceUser, Unit> getOnToggleRingingClicked() {
|
|
return this.onToggleRingingClicked;
|
|
}
|
|
|
|
/* JADX DEBUG: Type inference failed for r0v0. Raw type applied. Possible types: kotlin.jvm.functions.Function1<? super com.discord.stores.StoreVoiceParticipants$VoiceUser, kotlin.Unit>, kotlin.jvm.functions.Function1<com.discord.stores.StoreVoiceParticipants$VoiceUser, kotlin.Unit> */
|
|
public final Function1<StoreVoiceParticipants.VoiceUser, Unit> getOnVoiceUserClicked() {
|
|
return this.onVoiceUserClicked;
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
|
|
public MGRecyclerViewHolder<?, MGRecyclerDataPayload> onCreateViewHolder(ViewGroup viewGroup, int i) {
|
|
m.checkNotNullParameter(viewGroup, "parent");
|
|
if (i == 0) {
|
|
return new ViewHolderUser(this, this.quantizeUserAvatars);
|
|
}
|
|
if (i == 1) {
|
|
return new ViewHolderHeader(this);
|
|
}
|
|
if (i == 2) {
|
|
return new ViewHolderHeader(this);
|
|
}
|
|
if (i == 3) {
|
|
return new ViewHolderDivider(this);
|
|
}
|
|
if (i == 4) {
|
|
return new ViewHolderInvite(this);
|
|
}
|
|
if (i == 5) {
|
|
return new ViewHolderEvent(this);
|
|
}
|
|
throw invalidViewTypeException(i);
|
|
}
|
|
|
|
public final void setOnEventClicked(Function1<? super GuildScheduledEvent, Unit> function1) {
|
|
m.checkNotNullParameter(function1, "<set-?>");
|
|
this.onEventClicked = function1;
|
|
}
|
|
|
|
public final void setOnInviteFriendsClicked(Function1<? super View, Unit> function1) {
|
|
m.checkNotNullParameter(function1, "<set-?>");
|
|
this.onInviteFriendsClicked = function1;
|
|
}
|
|
|
|
public final void setOnStartEventClicked(Function1<? super GuildScheduledEvent, Unit> function1) {
|
|
m.checkNotNullParameter(function1, "<set-?>");
|
|
this.onStartEventClicked = function1;
|
|
}
|
|
|
|
public final void setOnStreamPreviewClicked(Function1<? super StreamContext, Unit> function1) {
|
|
m.checkNotNullParameter(function1, "<set-?>");
|
|
this.onStreamPreviewClicked = function1;
|
|
}
|
|
|
|
public final void setOnToggleRingingClicked(Function1<? super StoreVoiceParticipants.VoiceUser, Unit> function1) {
|
|
m.checkNotNullParameter(function1, "<set-?>");
|
|
this.onToggleRingingClicked = function1;
|
|
}
|
|
|
|
public final void setOnVoiceUserClicked(Function1<? super StoreVoiceParticipants.VoiceUser, Unit> function1) {
|
|
m.checkNotNullParameter(function1, "<set-?>");
|
|
this.onVoiceUserClicked = function1;
|
|
}
|
|
}
|