2021-06-27 20:44:35 +00:00
package com.discord.widgets.channels.memberlist.adapter ;
import a0.a.a.b ;
import android.content.Context ;
import android.view.LayoutInflater ;
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.ColorInt ;
import androidx.annotation.StringRes ;
import androidx.constraintlayout.widget.ConstraintLayout ;
import androidx.constraintlayout.widget.Guideline ;
import androidx.recyclerview.widget.DiffUtil ;
import androidx.recyclerview.widget.RecyclerView ;
import c.d.b.a.a ;
import com.discord.app.AppLog ;
import com.discord.databinding.WidgetChannelMembersListItemAddBinding ;
import com.discord.databinding.WidgetChannelMembersListItemHeaderBinding ;
import com.discord.databinding.WidgetChannelMembersListItemLoadingBinding ;
import com.discord.databinding.WidgetChannelMembersListItemPlaceholderHeaderBinding ;
import com.discord.databinding.WidgetChannelMembersListItemUserBinding ;
import com.discord.models.presence.Presence ;
import com.discord.utilities.logging.Logger ;
import com.discord.utilities.rx.ObservableExtensionsKt ;
import com.discord.utilities.view.text.SimpleDraweeSpanTextView ;
import com.discord.utilities.views.StickyHeaderItemDecoration ;
import com.discord.views.StatusView ;
import com.discord.views.UsernameView ;
import com.discord.widgets.channels.memberlist.WidgetChannelMembersListViewModel ;
import com.facebook.drawee.view.SimpleDraweeView ;
import d0.z.d.m ;
import d0.z.d.o ;
import java.util.Objects ;
import kotlin.NoWhenBranchMatchedException ;
import kotlin.Unit ;
import kotlin.jvm.functions.Function0 ;
import kotlin.jvm.functions.Function1 ;
import kotlin.jvm.functions.Function2 ;
import kotlin.jvm.internal.DefaultConstructorMarker ;
import rx.Observable ;
import rx.Subscription ;
import rx.functions.Func2 ;
import rx.subjects.PublishSubject ;
/* compiled from: ChannelMembersListAdapter.kt */
public final class ChannelMembersListAdapter extends RecyclerView . Adapter < RecyclerView . ViewHolder > implements StickyHeaderItemDecoration . StickyHeaderAdapter {
private WidgetChannelMembersListViewModel . MemberList memberList ;
private Function0 < Unit > onAddMemberClicked ;
private Function1 < ? super Long , Unit > onUserClicked ;
private StickyHeadersManager stickyHeadersManager ;
private final PublishSubject < ListUpdateRequest > updatesSubject ;
private Subscription updatesSubscription ;
/* compiled from: ChannelMembersListAdapter.kt */
/* renamed from: com.discord.widgets.channels.memberlist.adapter.ChannelMembersListAdapter$1 reason: invalid class name */
public static final class AnonymousClass1 extends o implements Function2 < ListUpdateRequest , ListUpdateRequest , ListUpdateOperation > {
public static final AnonymousClass1 INSTANCE = new AnonymousClass1 ( ) ;
public AnonymousClass1 ( ) {
super ( 2 ) ;
}
public final ListUpdateOperation invoke ( ListUpdateRequest listUpdateRequest , ListUpdateRequest listUpdateRequest2 ) {
m . checkNotNullParameter ( listUpdateRequest , " prevRequest " ) ;
m . checkNotNullParameter ( listUpdateRequest2 , " nextRequest " ) ;
if ( listUpdateRequest2 . getForceOverwrite ( ) ) {
return new ListUpdateOperation . OverwriteUpdate ( listUpdateRequest2 ) ;
}
String component1 = listUpdateRequest . component1 ( ) ;
WidgetChannelMembersListViewModel . MemberList component2 = listUpdateRequest . component2 ( ) ;
String component12 = listUpdateRequest2 . component1 ( ) ;
WidgetChannelMembersListViewModel . MemberList component22 = listUpdateRequest2 . component2 ( ) ;
if ( ! m . areEqual ( component1 , component12 ) | | Math . abs ( component2 . getSize ( ) - component22 . getSize ( ) ) > = 255 ) {
return new ListUpdateOperation . OverwriteUpdate ( listUpdateRequest2 ) ;
}
DiffUtil . DiffResult calculateDiff = DiffUtil . calculateDiff ( new DiffUtilCallback ( component2 , component22 ) ) ;
m . checkNotNullExpressionValue ( calculateDiff , " DiffUtil.calculateDiff(diffUtilCallback) " ) ;
return new ListUpdateOperation . DiffUpdate ( calculateDiff , listUpdateRequest2 ) ;
}
}
/* compiled from: ChannelMembersListAdapter.kt */
/* renamed from: com.discord.widgets.channels.memberlist.adapter.ChannelMembersListAdapter$2 reason: invalid class name */
public static final class AnonymousClass2 < T1 , T2 , R > implements Func2 < ListUpdateOperation , ListUpdateRequest , ListUpdateOperation > {
public static final AnonymousClass2 INSTANCE = new AnonymousClass2 ( ) ;
public final ListUpdateOperation call ( ListUpdateOperation listUpdateOperation , ListUpdateRequest listUpdateRequest ) {
AnonymousClass1 r0 = AnonymousClass1 . INSTANCE ;
ListUpdateRequest request = listUpdateOperation . getRequest ( ) ;
m . checkNotNullExpressionValue ( listUpdateRequest , " nextUpdate " ) ;
return r0 . invoke ( request , listUpdateRequest ) ;
}
}
/* compiled from: ChannelMembersListAdapter.kt */
/* renamed from: com.discord.widgets.channels.memberlist.adapter.ChannelMembersListAdapter$3 reason: invalid class name */
public static final class AnonymousClass3 extends o implements Function1 < ListUpdateOperation , Unit > {
public final /* synthetic */ ChannelMembersListAdapter this $0 ;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass3 ( ChannelMembersListAdapter channelMembersListAdapter ) {
super ( 1 ) ;
this . this$0 = channelMembersListAdapter ;
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke ( ListUpdateOperation listUpdateOperation ) {
invoke ( listUpdateOperation ) ;
return Unit . a ;
}
public final void invoke ( ListUpdateOperation listUpdateOperation ) {
ChannelMembersListAdapter . access$setMemberList$p ( this . this$0 , listUpdateOperation . getRequest ( ) . getRows ( ) ) ;
if ( listUpdateOperation instanceof ListUpdateOperation . DiffUpdate ) {
( ( ListUpdateOperation . DiffUpdate ) listUpdateOperation ) . getDiffResult ( ) . dispatchUpdatesTo ( this . this$0 ) ;
} else if ( listUpdateOperation instanceof ListUpdateOperation . OverwriteUpdate ) {
this . this$0 . notifyDataSetChanged ( ) ;
}
}
}
/* compiled from: ChannelMembersListAdapter.kt */
/* renamed from: com.discord.widgets.channels.memberlist.adapter.ChannelMembersListAdapter$4 reason: invalid class name */
public static final class AnonymousClass4 extends o implements Function1 < Subscription , Unit > {
public final /* synthetic */ ChannelMembersListAdapter this $0 ;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass4 ( ChannelMembersListAdapter channelMembersListAdapter ) {
super ( 1 ) ;
this . this$0 = channelMembersListAdapter ;
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke ( Subscription subscription ) {
invoke ( subscription ) ;
return Unit . a ;
}
public final void invoke ( Subscription subscription ) {
m . checkNotNullParameter ( subscription , " it " ) ;
ChannelMembersListAdapter . access$setUpdatesSubscription$p ( this . this$0 , subscription ) ;
}
}
/* compiled from: ChannelMembersListAdapter.kt */
public static final class DiffUtilCallback extends DiffUtil . Callback {
private final WidgetChannelMembersListViewModel . MemberList nextMemberList ;
private final WidgetChannelMembersListViewModel . MemberList prevMemberList ;
public DiffUtilCallback ( WidgetChannelMembersListViewModel . MemberList memberList , WidgetChannelMembersListViewModel . MemberList memberList2 ) {
m . checkNotNullParameter ( memberList , " prevMemberList " ) ;
m . checkNotNullParameter ( memberList2 , " nextMemberList " ) ;
this . prevMemberList = memberList ;
this . nextMemberList = memberList2 ;
}
@Override // androidx.recyclerview.widget.DiffUtil.Callback
public boolean areContentsTheSame ( int i , int i2 ) {
return m . areEqual ( this . prevMemberList . get ( i ) , this . nextMemberList . get ( i2 ) ) ;
}
@Override // androidx.recyclerview.widget.DiffUtil.Callback
public boolean areItemsTheSame ( int i , int i2 ) {
return m . areEqual ( this . prevMemberList . get ( i ) . getRowId ( ) , this . nextMemberList . get ( i2 ) . getRowId ( ) ) ;
}
@Override // androidx.recyclerview.widget.DiffUtil.Callback
public int getNewListSize ( ) {
return this . nextMemberList . getSize ( ) ;
}
@Override // androidx.recyclerview.widget.DiffUtil.Callback
public int getOldListSize ( ) {
return this . prevMemberList . getSize ( ) ;
}
}
/* compiled from: ChannelMembersListAdapter.kt */
public static abstract class Item {
private final Object rowId ;
private final ViewType type ;
/* compiled from: ChannelMembersListAdapter.kt */
public static final class AddMember extends Item {
private final String rowId ;
private final int title ;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AddMember ( String str , @StringRes int i ) {
super ( ViewType . ADD_MEMBER , str , null ) ;
m . checkNotNullParameter ( str , " rowId " ) ;
this . rowId = str ;
this . title = i ;
}
public static /* synthetic */ AddMember copy$default ( AddMember addMember , String str , int i , int i2 , Object obj ) {
if ( ( i2 & 1 ) ! = 0 ) {
str = addMember . getRowId ( ) ;
}
if ( ( i2 & 2 ) ! = 0 ) {
i = addMember . title ;
}
return addMember . copy ( str , i ) ;
}
public final String component1 ( ) {
return getRowId ( ) ;
}
public final int component2 ( ) {
return this . title ;
}
public final AddMember copy ( String str , @StringRes int i ) {
m . checkNotNullParameter ( str , " rowId " ) ;
return new AddMember ( str , i ) ;
}
public boolean equals ( Object obj ) {
if ( this = = obj ) {
return true ;
}
if ( ! ( obj instanceof AddMember ) ) {
return false ;
}
AddMember addMember = ( AddMember ) obj ;
return m . areEqual ( getRowId ( ) , addMember . getRowId ( ) ) & & this . title = = addMember . title ;
}
@Override // com.discord.widgets.channels.memberlist.adapter.ChannelMembersListAdapter.Item
public String getRowId ( ) {
return this . rowId ;
}
public final int getTitle ( ) {
return this . title ;
}
public int hashCode ( ) {
String rowId = getRowId ( ) ;
return ( ( rowId ! = null ? rowId . hashCode ( ) : 0 ) * 31 ) + this . title ;
}
public String toString ( ) {
2021-07-19 19:45:22 +00:00
StringBuilder K = a . K ( " AddMember(rowId= " ) ;
K . append ( getRowId ( ) ) ;
K . append ( " , title= " ) ;
return a . w ( K , this . title , " ) " ) ;
2021-06-27 20:44:35 +00:00
}
}
/* compiled from: ChannelMembersListAdapter.kt */
public static final class Header extends Item {
private final Type headerType ;
private final int memberCount ;
private final String rowId ;
/* compiled from: ChannelMembersListAdapter.kt */
public enum Type {
ONLINE ,
OFFLINE ,
GROUP_DM
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public Header ( String str , Type type , int i ) {
super ( ViewType . HEADER , str , null ) ;
m . checkNotNullParameter ( str , " rowId " ) ;
m . checkNotNullParameter ( type , " headerType " ) ;
this . rowId = str ;
this . headerType = type ;
this . memberCount = i ;
}
public static /* synthetic */ Header copy$default ( Header header , String str , Type type , int i , int i2 , Object obj ) {
if ( ( i2 & 1 ) ! = 0 ) {
str = header . getRowId ( ) ;
}
if ( ( i2 & 2 ) ! = 0 ) {
type = header . headerType ;
}
if ( ( i2 & 4 ) ! = 0 ) {
i = header . memberCount ;
}
return header . copy ( str , type , i ) ;
}
public final String component1 ( ) {
return getRowId ( ) ;
}
public final Type component2 ( ) {
return this . headerType ;
}
public final int component3 ( ) {
return this . memberCount ;
}
public final Header copy ( String str , Type type , int i ) {
m . checkNotNullParameter ( str , " rowId " ) ;
m . checkNotNullParameter ( type , " headerType " ) ;
return new Header ( str , type , i ) ;
}
public boolean equals ( Object obj ) {
if ( this = = obj ) {
return true ;
}
if ( ! ( obj instanceof Header ) ) {
return false ;
}
Header header = ( Header ) obj ;
return m . areEqual ( getRowId ( ) , header . getRowId ( ) ) & & m . areEqual ( this . headerType , header . headerType ) & & this . memberCount = = header . memberCount ;
}
public final Type getHeaderType ( ) {
return this . headerType ;
}
public final int getMemberCount ( ) {
return this . memberCount ;
}
@Override // com.discord.widgets.channels.memberlist.adapter.ChannelMembersListAdapter.Item
public String getRowId ( ) {
return this . rowId ;
}
public int hashCode ( ) {
String rowId = getRowId ( ) ;
int i = 0 ;
int hashCode = ( rowId ! = null ? rowId . hashCode ( ) : 0 ) * 31 ;
Type type = this . headerType ;
if ( type ! = null ) {
i = type . hashCode ( ) ;
}
return ( ( hashCode + i ) * 31 ) + this . memberCount ;
}
public String toString ( ) {
2021-07-19 19:45:22 +00:00
StringBuilder K = a . K ( " Header(rowId= " ) ;
K . append ( getRowId ( ) ) ;
K . append ( " , headerType= " ) ;
K . append ( this . headerType ) ;
K . append ( " , memberCount= " ) ;
return a . w ( K , this . memberCount , " ) " ) ;
2021-06-27 20:44:35 +00:00
}
}
/* compiled from: ChannelMembersListAdapter.kt */
public static final class Member extends Item {
private final String avatarUrl ;
2021-06-27 20:53:42 +00:00
private final boolean canDisplayStatusEmoji ;
2021-06-27 20:44:35 +00:00
private final Integer color ;
2021-06-27 20:53:42 +00:00
private final Long guildId ;
2021-06-27 20:44:35 +00:00
private final boolean isApplicationStreaming ;
private final boolean isBot ;
private final String name ;
private final String premiumSince ;
private final Presence presence ;
private final boolean showOwnerIndicator ;
private final Integer tagText ;
private final boolean tagVerified ;
private final long userId ;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
2021-06-27 20:53:42 +00:00
public Member ( long j , Long l , String str , boolean z2 , Integer num , boolean z3 , Presence presence , @ColorInt Integer num2 , String str2 , boolean z4 , String str3 , boolean z5 , boolean z6 ) {
2021-06-27 20:44:35 +00:00
super ( ViewType . MEMBER , Long . valueOf ( j ) , null ) ;
m . checkNotNullParameter ( str , " name " ) ;
this . userId = j ;
2021-06-27 20:53:42 +00:00
this . guildId = l ;
2021-06-27 20:44:35 +00:00
this . name = str ;
this . isBot = z2 ;
this . tagText = num ;
this . tagVerified = z3 ;
this . presence = presence ;
this . color = num2 ;
this . avatarUrl = str2 ;
this . showOwnerIndicator = z4 ;
this . premiumSince = str3 ;
this . isApplicationStreaming = z5 ;
2021-06-27 20:53:42 +00:00
this . canDisplayStatusEmoji = z6 ;
2021-06-27 20:44:35 +00:00
}
2021-06-27 20:53:42 +00:00
public static /* synthetic */ Member copy$default ( Member member , long j , Long l , String str , boolean z2 , Integer num , boolean z3 , Presence presence , Integer num2 , String str2 , boolean z4 , String str3 , boolean z5 , boolean z6 , int i , Object obj ) {
return member . copy ( ( i & 1 ) ! = 0 ? member . userId : j , ( i & 2 ) ! = 0 ? member . guildId : l , ( i & 4 ) ! = 0 ? member . name : str , ( i & 8 ) ! = 0 ? member . isBot : z2 , ( i & 16 ) ! = 0 ? member . tagText : num , ( i & 32 ) ! = 0 ? member . tagVerified : z3 , ( i & 64 ) ! = 0 ? member . presence : presence , ( i & 128 ) ! = 0 ? member . color : num2 , ( i & 256 ) ! = 0 ? member . avatarUrl : str2 , ( i & 512 ) ! = 0 ? member . showOwnerIndicator : z4 , ( i & 1024 ) ! = 0 ? member . premiumSince : str3 , ( i & 2048 ) ! = 0 ? member . isApplicationStreaming : z5 , ( i & 4096 ) ! = 0 ? member . canDisplayStatusEmoji : z6 ) ;
2021-06-27 20:44:35 +00:00
}
public final long component1 ( ) {
return this . userId ;
}
2021-06-27 20:53:42 +00:00
public final boolean component10 ( ) {
return this . showOwnerIndicator ;
}
public final String component11 ( ) {
2021-06-27 20:44:35 +00:00
return this . premiumSince ;
}
2021-06-27 20:53:42 +00:00
public final boolean component12 ( ) {
2021-06-27 20:44:35 +00:00
return this . isApplicationStreaming ;
}
2021-06-27 20:53:42 +00:00
public final boolean component13 ( ) {
return this . canDisplayStatusEmoji ;
}
public final Long component2 ( ) {
return this . guildId ;
}
public final String component3 ( ) {
2021-06-27 20:44:35 +00:00
return this . name ;
}
2021-06-27 20:53:42 +00:00
public final boolean component4 ( ) {
2021-06-27 20:44:35 +00:00
return this . isBot ;
}
2021-06-27 20:53:42 +00:00
public final Integer component5 ( ) {
2021-06-27 20:44:35 +00:00
return this . tagText ;
}
2021-06-27 20:53:42 +00:00
public final boolean component6 ( ) {
2021-06-27 20:44:35 +00:00
return this . tagVerified ;
}
2021-06-27 20:53:42 +00:00
public final Presence component7 ( ) {
2021-06-27 20:44:35 +00:00
return this . presence ;
}
2021-06-27 20:53:42 +00:00
public final Integer component8 ( ) {
2021-06-27 20:44:35 +00:00
return this . color ;
}
2021-06-27 20:53:42 +00:00
public final String component9 ( ) {
2021-06-27 20:44:35 +00:00
return this . avatarUrl ;
}
2021-06-27 20:53:42 +00:00
public final Member copy ( long j , Long l , String str , boolean z2 , Integer num , boolean z3 , Presence presence , @ColorInt Integer num2 , String str2 , boolean z4 , String str3 , boolean z5 , boolean z6 ) {
2021-06-27 20:44:35 +00:00
m . checkNotNullParameter ( str , " name " ) ;
2021-06-27 20:53:42 +00:00
return new Member ( j , l , str , z2 , num , z3 , presence , num2 , str2 , z4 , str3 , z5 , z6 ) ;
2021-06-27 20:44:35 +00:00
}
public boolean equals ( Object obj ) {
if ( this = = obj ) {
return true ;
}
if ( ! ( obj instanceof Member ) ) {
return false ;
}
Member member = ( Member ) obj ;
2021-06-27 20:53:42 +00:00
return this . userId = = member . userId & & m . areEqual ( this . guildId , member . guildId ) & & m . areEqual ( this . name , member . name ) & & this . isBot = = member . isBot & & m . areEqual ( this . tagText , member . tagText ) & & this . tagVerified = = member . tagVerified & & m . areEqual ( this . presence , member . presence ) & & m . areEqual ( this . color , member . color ) & & m . areEqual ( this . avatarUrl , member . avatarUrl ) & & this . showOwnerIndicator = = member . showOwnerIndicator & & m . areEqual ( this . premiumSince , member . premiumSince ) & & this . isApplicationStreaming = = member . isApplicationStreaming & & this . canDisplayStatusEmoji = = member . canDisplayStatusEmoji ;
2021-06-27 20:44:35 +00:00
}
public final String getAvatarUrl ( ) {
return this . avatarUrl ;
}
2021-06-27 20:53:42 +00:00
public final boolean getCanDisplayStatusEmoji ( ) {
return this . canDisplayStatusEmoji ;
}
2021-06-27 20:44:35 +00:00
public final Integer getColor ( ) {
return this . color ;
}
2021-06-27 20:53:42 +00:00
public final Long getGuildId ( ) {
return this . guildId ;
}
2021-06-27 20:44:35 +00:00
public final String getName ( ) {
return this . name ;
}
public final String getPremiumSince ( ) {
return this . premiumSince ;
}
public final Presence getPresence ( ) {
return this . presence ;
}
public final boolean getShowOwnerIndicator ( ) {
return this . showOwnerIndicator ;
}
public final Integer getTagText ( ) {
return this . tagText ;
}
public final boolean getTagVerified ( ) {
return this . tagVerified ;
}
public final long getUserId ( ) {
return this . userId ;
}
public int hashCode ( ) {
int a = b . a ( this . userId ) * 31 ;
2021-06-27 20:53:42 +00:00
Long l = this . guildId ;
2021-06-27 20:44:35 +00:00
int i = 0 ;
2021-06-27 20:53:42 +00:00
int hashCode = ( a + ( l ! = null ? l . hashCode ( ) : 0 ) ) * 31 ;
String str = this . name ;
int hashCode2 = ( hashCode + ( str ! = null ? str . hashCode ( ) : 0 ) ) * 31 ;
2021-06-27 20:44:35 +00:00
boolean z2 = this . isBot ;
int i2 = 1 ;
if ( z2 ) {
z2 = true ;
}
int i3 = z2 ? 1 : 0 ;
int i4 = z2 ? 1 : 0 ;
int i5 = z2 ? 1 : 0 ;
2021-06-27 20:53:42 +00:00
int i6 = ( hashCode2 + i3 ) * 31 ;
2021-06-27 20:44:35 +00:00
Integer num = this . tagText ;
2021-06-27 20:53:42 +00:00
int hashCode3 = ( i6 + ( num ! = null ? num . hashCode ( ) : 0 ) ) * 31 ;
2021-06-27 20:44:35 +00:00
boolean z3 = this . tagVerified ;
if ( z3 ) {
z3 = true ;
}
int i7 = z3 ? 1 : 0 ;
int i8 = z3 ? 1 : 0 ;
int i9 = z3 ? 1 : 0 ;
2021-06-27 20:53:42 +00:00
int i10 = ( hashCode3 + i7 ) * 31 ;
2021-06-27 20:44:35 +00:00
Presence presence = this . presence ;
2021-06-27 20:53:42 +00:00
int hashCode4 = ( i10 + ( presence ! = null ? presence . hashCode ( ) : 0 ) ) * 31 ;
2021-06-27 20:44:35 +00:00
Integer num2 = this . color ;
2021-06-27 20:53:42 +00:00
int hashCode5 = ( hashCode4 + ( num2 ! = null ? num2 . hashCode ( ) : 0 ) ) * 31 ;
2021-06-27 20:44:35 +00:00
String str2 = this . avatarUrl ;
2021-06-27 20:53:42 +00:00
int hashCode6 = ( hashCode5 + ( str2 ! = null ? str2 . hashCode ( ) : 0 ) ) * 31 ;
2021-06-27 20:44:35 +00:00
boolean z4 = this . showOwnerIndicator ;
if ( z4 ) {
z4 = true ;
}
int i11 = z4 ? 1 : 0 ;
int i12 = z4 ? 1 : 0 ;
int i13 = z4 ? 1 : 0 ;
2021-06-27 20:53:42 +00:00
int i14 = ( hashCode6 + i11 ) * 31 ;
2021-06-27 20:44:35 +00:00
String str3 = this . premiumSince ;
if ( str3 ! = null ) {
i = str3 . hashCode ( ) ;
}
int i15 = ( i14 + i ) * 31 ;
boolean z5 = this . isApplicationStreaming ;
2021-06-27 20:53:42 +00:00
if ( z5 ) {
z5 = true ;
}
int i16 = z5 ? 1 : 0 ;
int i17 = z5 ? 1 : 0 ;
int i18 = z5 ? 1 : 0 ;
int i19 = ( i15 + i16 ) * 31 ;
boolean z6 = this . canDisplayStatusEmoji ;
if ( ! z6 ) {
i2 = z6 ? 1 : 0 ;
2021-06-27 20:44:35 +00:00
}
2021-06-27 20:53:42 +00:00
return i19 + i2 ;
2021-06-27 20:44:35 +00:00
}
public final boolean isApplicationStreaming ( ) {
return this . isApplicationStreaming ;
}
public final boolean isBot ( ) {
return this . isBot ;
}
public String toString ( ) {
2021-07-19 19:45:22 +00:00
StringBuilder K = a . K ( " Member(userId= " ) ;
K . append ( this . userId ) ;
K . append ( " , guildId= " ) ;
K . append ( this . guildId ) ;
K . append ( " , name= " ) ;
K . append ( this . name ) ;
K . append ( " , isBot= " ) ;
K . append ( this . isBot ) ;
K . append ( " , tagText= " ) ;
K . append ( this . tagText ) ;
K . append ( " , tagVerified= " ) ;
K . append ( this . tagVerified ) ;
K . append ( " , presence= " ) ;
K . append ( this . presence ) ;
K . append ( " , color= " ) ;
K . append ( this . color ) ;
K . append ( " , avatarUrl= " ) ;
K . append ( this . avatarUrl ) ;
K . append ( " , showOwnerIndicator= " ) ;
K . append ( this . showOwnerIndicator ) ;
K . append ( " , premiumSince= " ) ;
K . append ( this . premiumSince ) ;
K . append ( " , isApplicationStreaming= " ) ;
K . append ( this . isApplicationStreaming ) ;
K . append ( " , canDisplayStatusEmoji= " ) ;
return a . F ( K , this . canDisplayStatusEmoji , " ) " ) ;
2021-06-27 20:44:35 +00:00
}
}
/* compiled from: ChannelMembersListAdapter.kt */
public static final class PlaceholderHeader extends Item {
private final String listId ;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public PlaceholderHeader ( String str ) {
2021-07-19 19:45:22 +00:00
super ( ViewType . PLACEHOLDER_HEADER , a . s ( " placeholder: " , str ) , null ) ;
2021-06-27 20:44:35 +00:00
m . checkNotNullParameter ( str , " listId " ) ;
this . listId = str ;
}
public static /* synthetic */ PlaceholderHeader copy$default ( PlaceholderHeader placeholderHeader , String str , int i , Object obj ) {
if ( ( i & 1 ) ! = 0 ) {
str = placeholderHeader . listId ;
}
return placeholderHeader . copy ( str ) ;
}
public final String component1 ( ) {
return this . listId ;
}
public final PlaceholderHeader copy ( String str ) {
m . checkNotNullParameter ( str , " listId " ) ;
return new PlaceholderHeader ( str ) ;
}
public boolean equals ( Object obj ) {
if ( this ! = obj ) {
return ( obj instanceof PlaceholderHeader ) & & m . areEqual ( this . listId , ( ( PlaceholderHeader ) obj ) . listId ) ;
}
return true ;
}
public final String getListId ( ) {
return this . listId ;
}
public int hashCode ( ) {
String str = this . listId ;
if ( str ! = null ) {
return str . hashCode ( ) ;
}
return 0 ;
}
public String toString ( ) {
2021-07-19 19:45:22 +00:00
return a . C ( a . K ( " PlaceholderHeader(listId= " ) , this . listId , " ) " ) ;
2021-06-27 20:44:35 +00:00
}
}
/* compiled from: ChannelMembersListAdapter.kt */
public static final class PlaceholderMember extends Item {
private final float placeholderSize ;
public PlaceholderMember ( float f ) {
super ( ViewType . LOADING , " " , null ) ;
this . placeholderSize = f ;
}
private final float component1 ( ) {
return this . placeholderSize ;
}
public static /* synthetic */ PlaceholderMember copy$default ( PlaceholderMember placeholderMember , float f , int i , Object obj ) {
if ( ( i & 1 ) ! = 0 ) {
f = placeholderMember . placeholderSize ;
}
return placeholderMember . copy ( f ) ;
}
public final PlaceholderMember copy ( float f ) {
return new PlaceholderMember ( f ) ;
}
public boolean equals ( Object obj ) {
if ( this ! = obj ) {
return ( obj instanceof PlaceholderMember ) & & Float . compare ( this . placeholderSize , ( ( PlaceholderMember ) obj ) . placeholderSize ) = = 0 ;
}
return true ;
}
public int hashCode ( ) {
return Float . floatToIntBits ( this . placeholderSize ) ;
}
public String toString ( ) {
2021-07-19 19:45:22 +00:00
StringBuilder K = a . K ( " PlaceholderMember(placeholderSize= " ) ;
K . append ( this . placeholderSize ) ;
K . append ( " ) " ) ;
return K . toString ( ) ;
2021-06-27 20:44:35 +00:00
}
}
/* compiled from: ChannelMembersListAdapter.kt */
public static final class RoleHeader extends Item {
private final int memberCount ;
private final long roleId ;
private final String roleName ;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public RoleHeader ( long j , String str , int i ) {
super ( ViewType . ROLE_HEADER , Long . valueOf ( j ) , null ) ;
m . checkNotNullParameter ( str , " roleName " ) ;
this . roleId = j ;
this . roleName = str ;
this . memberCount = i ;
}
public static /* synthetic */ RoleHeader copy$default ( RoleHeader roleHeader , long j , String str , int i , int i2 , Object obj ) {
if ( ( i2 & 1 ) ! = 0 ) {
j = roleHeader . roleId ;
}
if ( ( i2 & 2 ) ! = 0 ) {
str = roleHeader . roleName ;
}
if ( ( i2 & 4 ) ! = 0 ) {
i = roleHeader . memberCount ;
}
return roleHeader . copy ( j , str , i ) ;
}
public final long component1 ( ) {
return this . roleId ;
}
public final String component2 ( ) {
return this . roleName ;
}
public final int component3 ( ) {
return this . memberCount ;
}
public final RoleHeader copy ( long j , String str , int i ) {
m . checkNotNullParameter ( str , " roleName " ) ;
return new RoleHeader ( j , str , i ) ;
}
public boolean equals ( Object obj ) {
if ( this = = obj ) {
return true ;
}
if ( ! ( obj instanceof RoleHeader ) ) {
return false ;
}
RoleHeader roleHeader = ( RoleHeader ) obj ;
return this . roleId = = roleHeader . roleId & & m . areEqual ( this . roleName , roleHeader . roleName ) & & this . memberCount = = roleHeader . memberCount ;
}
public final int getMemberCount ( ) {
return this . memberCount ;
}
public final long getRoleId ( ) {
return this . roleId ;
}
public final String getRoleName ( ) {
return this . roleName ;
}
public int hashCode ( ) {
int a = b . a ( this . roleId ) * 31 ;
String str = this . roleName ;
return ( ( a + ( str ! = null ? str . hashCode ( ) : 0 ) ) * 31 ) + this . memberCount ;
}
public String toString ( ) {
2021-07-19 19:45:22 +00:00
StringBuilder K = a . K ( " RoleHeader(roleId= " ) ;
K . append ( this . roleId ) ;
K . append ( " , roleName= " ) ;
K . append ( this . roleName ) ;
K . append ( " , memberCount= " ) ;
return a . w ( K , this . memberCount , " ) " ) ;
2021-06-27 20:44:35 +00:00
}
}
private Item ( ViewType viewType , Object obj ) {
this . type = viewType ;
this . rowId = obj ;
}
public /* synthetic */ Item ( ViewType viewType , Object obj , DefaultConstructorMarker defaultConstructorMarker ) {
this ( viewType , obj ) ;
}
public Object getRowId ( ) {
return this . rowId ;
}
public final ViewType getType ( ) {
return this . type ;
}
}
/* compiled from: ChannelMembersListAdapter.kt */
public static abstract class ListUpdateOperation {
private final ListUpdateRequest request ;
/* compiled from: ChannelMembersListAdapter.kt */
public static final class DiffUpdate extends ListUpdateOperation {
private final DiffUtil . DiffResult diffResult ;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public DiffUpdate ( DiffUtil . DiffResult diffResult , ListUpdateRequest listUpdateRequest ) {
super ( listUpdateRequest , null ) ;
m . checkNotNullParameter ( diffResult , " diffResult " ) ;
m . checkNotNullParameter ( listUpdateRequest , " listUpdateRequest " ) ;
this . diffResult = diffResult ;
}
public final DiffUtil . DiffResult getDiffResult ( ) {
return this . diffResult ;
}
}
/* compiled from: ChannelMembersListAdapter.kt */
public static final class OverwriteUpdate extends ListUpdateOperation {
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public OverwriteUpdate ( ListUpdateRequest listUpdateRequest ) {
super ( listUpdateRequest , null ) ;
m . checkNotNullParameter ( listUpdateRequest , " listUpdateRequest " ) ;
}
}
private ListUpdateOperation ( ListUpdateRequest listUpdateRequest ) {
this . request = listUpdateRequest ;
}
public /* synthetic */ ListUpdateOperation ( ListUpdateRequest listUpdateRequest , DefaultConstructorMarker defaultConstructorMarker ) {
this ( listUpdateRequest ) ;
}
public final ListUpdateRequest getRequest ( ) {
return this . request ;
}
}
/* compiled from: ChannelMembersListAdapter.kt */
public static final class ListUpdateRequest {
private final boolean forceOverwrite ;
private final String listId ;
private final WidgetChannelMembersListViewModel . MemberList rows ;
public ListUpdateRequest ( String str , WidgetChannelMembersListViewModel . MemberList memberList , boolean z2 ) {
m . checkNotNullParameter ( str , " listId " ) ;
m . checkNotNullParameter ( memberList , " rows " ) ;
this . listId = str ;
this . rows = memberList ;
this . forceOverwrite = z2 ;
}
public static /* synthetic */ ListUpdateRequest copy$default ( ListUpdateRequest listUpdateRequest , String str , WidgetChannelMembersListViewModel . MemberList memberList , boolean z2 , int i , Object obj ) {
if ( ( i & 1 ) ! = 0 ) {
str = listUpdateRequest . listId ;
}
if ( ( i & 2 ) ! = 0 ) {
memberList = listUpdateRequest . rows ;
}
if ( ( i & 4 ) ! = 0 ) {
z2 = listUpdateRequest . forceOverwrite ;
}
return listUpdateRequest . copy ( str , memberList , z2 ) ;
}
public final String component1 ( ) {
return this . listId ;
}
public final WidgetChannelMembersListViewModel . MemberList component2 ( ) {
return this . rows ;
}
public final boolean component3 ( ) {
return this . forceOverwrite ;
}
public final ListUpdateRequest copy ( String str , WidgetChannelMembersListViewModel . MemberList memberList , boolean z2 ) {
m . checkNotNullParameter ( str , " listId " ) ;
m . checkNotNullParameter ( memberList , " rows " ) ;
return new ListUpdateRequest ( str , memberList , z2 ) ;
}
public boolean equals ( Object obj ) {
if ( this = = obj ) {
return true ;
}
if ( ! ( obj instanceof ListUpdateRequest ) ) {
return false ;
}
ListUpdateRequest listUpdateRequest = ( ListUpdateRequest ) obj ;
return m . areEqual ( this . listId , listUpdateRequest . listId ) & & m . areEqual ( this . rows , listUpdateRequest . rows ) & & this . forceOverwrite = = listUpdateRequest . forceOverwrite ;
}
public final boolean getForceOverwrite ( ) {
return this . forceOverwrite ;
}
public final String getListId ( ) {
return this . listId ;
}
public final WidgetChannelMembersListViewModel . MemberList getRows ( ) {
return this . rows ;
}
public int hashCode ( ) {
String str = this . listId ;
int i = 0 ;
int hashCode = ( str ! = null ? str . hashCode ( ) : 0 ) * 31 ;
WidgetChannelMembersListViewModel . MemberList memberList = this . rows ;
if ( memberList ! = null ) {
i = memberList . hashCode ( ) ;
}
int i2 = ( hashCode + i ) * 31 ;
boolean z2 = this . forceOverwrite ;
if ( z2 ) {
z2 = true ;
}
int i3 = z2 ? 1 : 0 ;
int i4 = z2 ? 1 : 0 ;
int i5 = z2 ? 1 : 0 ;
return i2 + i3 ;
}
public String toString ( ) {
2021-07-19 19:45:22 +00:00
StringBuilder K = a . K ( " ListUpdateRequest(listId= " ) ;
K . append ( this . listId ) ;
K . append ( " , rows= " ) ;
K . append ( this . rows ) ;
K . append ( " , forceOverwrite= " ) ;
return a . F ( K , this . forceOverwrite , " ) " ) ;
2021-06-27 20:44:35 +00:00
}
}
/* compiled from: ChannelMembersListAdapter.kt */
public static final class StickyHeadersManager {
private View currentStickyHeaderView ;
private final WidgetChannelMembersListItemHeaderBinding headerViewBinding ;
private final ChannelMembersListViewHolderHeader onlineOfflineStickyHeader ;
private final WidgetChannelMembersListItemPlaceholderHeaderBinding placeholderHeaderViewBinding ;
private final ChannelMembersListViewHolderRoleHeader roleStickyHeader ;
public StickyHeadersManager ( WidgetChannelMembersListItemHeaderBinding widgetChannelMembersListItemHeaderBinding , WidgetChannelMembersListItemPlaceholderHeaderBinding widgetChannelMembersListItemPlaceholderHeaderBinding ) {
m . checkNotNullParameter ( widgetChannelMembersListItemHeaderBinding , " headerViewBinding " ) ;
m . checkNotNullParameter ( widgetChannelMembersListItemPlaceholderHeaderBinding , " placeholderHeaderViewBinding " ) ;
this . headerViewBinding = widgetChannelMembersListItemHeaderBinding ;
this . placeholderHeaderViewBinding = widgetChannelMembersListItemPlaceholderHeaderBinding ;
this . roleStickyHeader = new ChannelMembersListViewHolderRoleHeader ( widgetChannelMembersListItemHeaderBinding ) ;
this . onlineOfflineStickyHeader = new ChannelMembersListViewHolderHeader ( widgetChannelMembersListItemHeaderBinding ) ;
this . currentStickyHeaderView = widgetChannelMembersListItemHeaderBinding . a ;
}
public final void bindStickyHeaderView ( Item item ) {
m . checkNotNullParameter ( item , " row " ) ;
if ( item instanceof Item . RoleHeader ) {
this . roleStickyHeader . bind ( ( Item . RoleHeader ) item ) ;
this . currentStickyHeaderView = this . headerViewBinding . a ;
} else if ( item instanceof Item . Header ) {
this . onlineOfflineStickyHeader . bind ( ( Item . Header ) item ) ;
this . currentStickyHeaderView = this . headerViewBinding . a ;
} else if ( item instanceof Item . PlaceholderHeader ) {
this . currentStickyHeaderView = this . placeholderHeaderViewBinding . a ;
} else if ( item instanceof Item . AddMember ) {
this . currentStickyHeaderView = null ;
}
}
public final View getCurrentStickyHeaderView ( ) {
return this . currentStickyHeaderView ;
}
public final void layoutViews ( RecyclerView recyclerView ) {
m . checkNotNullParameter ( recyclerView , " recyclerView " ) ;
FrameLayout frameLayout = this . headerViewBinding . a ;
m . checkNotNullExpressionValue ( frameLayout , " headerViewBinding.root " ) ;
StickyHeaderItemDecoration . LayoutManager . layoutHeaderView ( recyclerView , frameLayout ) ;
FrameLayout frameLayout2 = this . placeholderHeaderViewBinding . a ;
m . checkNotNullExpressionValue ( frameLayout2 , " placeholderHeaderViewBinding.root " ) ;
StickyHeaderItemDecoration . LayoutManager . layoutHeaderView ( recyclerView , frameLayout2 ) ;
}
}
/* compiled from: ChannelMembersListAdapter.kt */
public enum ViewType {
ROLE_HEADER ,
PLACEHOLDER_HEADER ,
HEADER ,
MEMBER ,
ADD_MEMBER ,
LOADING ;
public static final Companion Companion = new Companion ( null ) ;
private static final ViewType [ ] cachedValues = values ( ) ;
/* compiled from: ChannelMembersListAdapter.kt */
public static final class Companion {
private Companion ( ) {
}
public /* synthetic */ Companion ( DefaultConstructorMarker defaultConstructorMarker ) {
this ( ) ;
}
public final ViewType fromOrdinal ( int i ) {
return ViewType . access$getCachedValues$cp ( ) [ i ] ;
}
}
public static final /* synthetic */ ViewType [ ] access$getCachedValues$cp ( ) {
return cachedValues ;
}
}
public final /* synthetic */ class WhenMappings {
public static final /* synthetic */ int [ ] $EnumSwitchMapping$0 ;
public static final /* synthetic */ int [ ] $EnumSwitchMapping$1 ;
static {
Item . Header . Type . values ( ) ;
int [ ] iArr = new int [ 3 ] ;
$EnumSwitchMapping$0 = iArr ;
iArr [ Item . Header . Type . ONLINE . ordinal ( ) ] = 1 ;
iArr [ Item . Header . Type . OFFLINE . ordinal ( ) ] = 2 ;
iArr [ Item . Header . Type . GROUP_DM . ordinal ( ) ] = 3 ;
ViewType . values ( ) ;
int [ ] iArr2 = new int [ 6 ] ;
$EnumSwitchMapping$1 = iArr2 ;
iArr2 [ ViewType . HEADER . ordinal ( ) ] = 1 ;
iArr2 [ ViewType . ROLE_HEADER . ordinal ( ) ] = 2 ;
iArr2 [ ViewType . MEMBER . ordinal ( ) ] = 3 ;
iArr2 [ ViewType . LOADING . ordinal ( ) ] = 4 ;
iArr2 [ ViewType . PLACEHOLDER_HEADER . ordinal ( ) ] = 5 ;
iArr2 [ ViewType . ADD_MEMBER . ordinal ( ) ] = 6 ;
}
}
public ChannelMembersListAdapter ( ) {
2021-07-03 23:36:06 +00:00
PublishSubject < ListUpdateRequest > k0 = PublishSubject . k0 ( ) ;
this . updatesSubject = k0 ;
2021-06-27 20:44:35 +00:00
WidgetChannelMembersListViewModel . MemberList empty = WidgetChannelMembersListViewModel . MemberList . Companion . getEMPTY ( ) ;
this . memberList = empty ;
ListUpdateOperation . OverwriteUpdate overwriteUpdate = new ListUpdateOperation . OverwriteUpdate ( new ListUpdateRequest ( " " , empty , false ) ) ;
AnonymousClass1 r1 = AnonymousClass1 . INSTANCE ;
2021-07-03 23:36:06 +00:00
m . checkNotNullExpressionValue ( k0 , " updatesSubject " ) ;
Observable S = ObservableExtensionsKt . computationLatest ( k0 ) . P ( overwriteUpdate , AnonymousClass2 . INSTANCE ) . S ( 1 ) ;
m . checkNotNullExpressionValue ( S , " updatesSubject \ n .… }) \ n .skip(1) " ) ;
ObservableExtensionsKt . appSubscribe$default ( ObservableExtensionsKt . ui ( S ) , ChannelMembersListAdapter . class , ( Context ) null , new AnonymousClass4 ( this ) , ( Function1 ) null , ( Function0 ) null , ( Function0 ) null , new AnonymousClass3 ( this ) , 58 , ( Object ) null ) ;
2021-06-27 20:44:35 +00:00
}
public static final /* synthetic */ WidgetChannelMembersListViewModel . MemberList access$getMemberList$p ( ChannelMembersListAdapter channelMembersListAdapter ) {
return channelMembersListAdapter . memberList ;
}
public static final /* synthetic */ Function0 access$getOnAddMemberClicked$p ( ChannelMembersListAdapter channelMembersListAdapter ) {
return channelMembersListAdapter . onAddMemberClicked ;
}
public static final /* synthetic */ Function1 access$getOnUserClicked$p ( ChannelMembersListAdapter channelMembersListAdapter ) {
return channelMembersListAdapter . onUserClicked ;
}
public static final /* synthetic */ StickyHeadersManager access$getStickyHeadersManager$p ( ChannelMembersListAdapter channelMembersListAdapter ) {
StickyHeadersManager stickyHeadersManager = channelMembersListAdapter . stickyHeadersManager ;
if ( stickyHeadersManager = = null ) {
m . throwUninitializedPropertyAccessException ( " stickyHeadersManager " ) ;
}
return stickyHeadersManager ;
}
public static final /* synthetic */ Subscription access$getUpdatesSubscription$p ( ChannelMembersListAdapter channelMembersListAdapter ) {
return channelMembersListAdapter . updatesSubscription ;
}
public static final /* synthetic */ void access$setMemberList$p ( ChannelMembersListAdapter channelMembersListAdapter , WidgetChannelMembersListViewModel . MemberList memberList ) {
channelMembersListAdapter . memberList = memberList ;
}
public static final /* synthetic */ void access$setOnAddMemberClicked$p ( ChannelMembersListAdapter channelMembersListAdapter , Function0 function0 ) {
channelMembersListAdapter . onAddMemberClicked = function0 ;
}
public static final /* synthetic */ void access$setOnUserClicked$p ( ChannelMembersListAdapter channelMembersListAdapter , Function1 function1 ) {
channelMembersListAdapter . onUserClicked = function1 ;
}
public static final /* synthetic */ void access$setStickyHeadersManager$p ( ChannelMembersListAdapter channelMembersListAdapter , StickyHeadersManager stickyHeadersManager ) {
channelMembersListAdapter . stickyHeadersManager = stickyHeadersManager ;
}
public static final /* synthetic */ void access$setUpdatesSubscription$p ( ChannelMembersListAdapter channelMembersListAdapter , Subscription subscription ) {
channelMembersListAdapter . updatesSubscription = subscription ;
}
public final Unit dispose ( ) {
Subscription subscription = this . updatesSubscription ;
if ( subscription = = null ) {
return null ;
}
subscription . unsubscribe ( ) ;
return Unit . a ;
}
@Override // com.discord.utilities.views.StickyHeaderItemDecoration.StickyHeaderAdapter
public View getAndBindHeaderView ( int i ) {
Item item = this . memberList . get ( i ) ;
try {
StickyHeadersManager stickyHeadersManager = this . stickyHeadersManager ;
if ( stickyHeadersManager = = null ) {
m . throwUninitializedPropertyAccessException ( " stickyHeadersManager " ) ;
}
stickyHeadersManager . bindStickyHeaderView ( item ) ;
StickyHeadersManager stickyHeadersManager2 = this . stickyHeadersManager ;
if ( stickyHeadersManager2 = = null ) {
m . throwUninitializedPropertyAccessException ( " stickyHeadersManager " ) ;
}
return stickyHeadersManager2 . getCurrentStickyHeaderView ( ) ;
} catch ( ClassCastException unused ) {
Logger . e$default ( AppLog . g , " Failed to cast header " , null , null , 6 , null ) ;
StickyHeadersManager stickyHeadersManager3 = this . stickyHeadersManager ;
if ( stickyHeadersManager3 = = null ) {
m . throwUninitializedPropertyAccessException ( " stickyHeadersManager " ) ;
}
return stickyHeadersManager3 . getCurrentStickyHeaderView ( ) ;
} catch ( Throwable unused2 ) {
StickyHeadersManager stickyHeadersManager4 = this . stickyHeadersManager ;
if ( stickyHeadersManager4 = = null ) {
m . throwUninitializedPropertyAccessException ( " stickyHeadersManager " ) ;
}
return stickyHeadersManager4 . getCurrentStickyHeaderView ( ) ;
}
}
@Override // com.discord.utilities.views.StickyHeaderItemDecoration.StickyHeaderAdapter
public Integer getHeaderPositionForItem ( int i ) {
return this . memberList . getHeaderPositionForItem ( i ) ;
}
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
public int getItemCount ( ) {
return this . memberList . getSize ( ) ;
}
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
public long getItemId ( int i ) {
Item item = this . memberList . get ( i ) ;
if ( item instanceof Item . Member ) {
return ( ( Item . Member ) item ) . getUserId ( ) ;
}
if ( item instanceof Item . RoleHeader ) {
return ( ( Item . RoleHeader ) item ) . getRoleId ( ) ;
}
if ( item instanceof Item . AddMember ) {
return - 1 ;
}
if ( item instanceof Item . Header ) {
int ordinal = ( ( Item . Header ) item ) . getHeaderType ( ) . ordinal ( ) ;
if ( ordinal = = 0 ) {
return - 2 ;
}
if ( ordinal = = 1 ) {
return - 3 ;
}
if ( ordinal = = 2 ) {
return - 4 ;
}
throw new NoWhenBranchMatchedException ( ) ;
} else if ( item instanceof Item . PlaceholderHeader ) {
return - 5 ;
} else {
if ( item instanceof Item . PlaceholderMember ) {
return - 1 * ( ( long ) ( i + 6 ) ) ;
}
throw new NoWhenBranchMatchedException ( ) ;
}
}
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
public int getItemViewType ( int i ) {
return this . memberList . get ( i ) . getType ( ) . ordinal ( ) ;
}
@Override // com.discord.utilities.views.StickyHeaderItemDecoration.StickyHeaderAdapter
public boolean isHeader ( int i ) {
Item item = this . memberList . get ( i ) ;
return ( item instanceof Item . Header ) | | ( item instanceof Item . RoleHeader ) | | ( item instanceof Item . PlaceholderHeader ) ;
}
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
public void onAttachedToRecyclerView ( RecyclerView recyclerView ) {
m . checkNotNullParameter ( recyclerView , " recyclerView " ) ;
super . onAttachedToRecyclerView ( recyclerView ) ;
WidgetChannelMembersListItemHeaderBinding a = WidgetChannelMembersListItemHeaderBinding . a ( LayoutInflater . from ( recyclerView . getContext ( ) ) , recyclerView , false ) ;
m . checkNotNullExpressionValue ( a , " WidgetChannelMembersList…View, \ n false \ n ) " ) ;
WidgetChannelMembersListItemPlaceholderHeaderBinding a2 = WidgetChannelMembersListItemPlaceholderHeaderBinding . a ( LayoutInflater . from ( recyclerView . getContext ( ) ) , recyclerView , false ) ;
m . checkNotNullExpressionValue ( a2 , " WidgetChannelMembersList…View, \ n false \ n ) " ) ;
this . stickyHeadersManager = new StickyHeadersManager ( a , a2 ) ;
recyclerView . addOnLayoutChangeListener ( new ChannelMembersListAdapter$onAttachedToRecyclerView$1 ( this , recyclerView ) ) ;
}
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
public void onBindViewHolder ( RecyclerView . ViewHolder viewHolder , int i ) {
m . checkNotNullParameter ( viewHolder , " holder " ) ;
if ( viewHolder instanceof ChannelMembersListViewHolderHeader ) {
Item item = this . memberList . get ( i ) ;
Objects . requireNonNull ( item , " null cannot be cast to non-null type com.discord.widgets.channels.memberlist.adapter.ChannelMembersListAdapter.Item.Header " ) ;
( ( ChannelMembersListViewHolderHeader ) viewHolder ) . bind ( ( Item . Header ) item ) ;
} else if ( viewHolder instanceof ChannelMembersListViewHolderMember ) {
Item item2 = this . memberList . get ( i ) ;
Objects . requireNonNull ( item2 , " null cannot be cast to non-null type com.discord.widgets.channels.memberlist.adapter.ChannelMembersListAdapter.Item.Member " ) ;
Item . Member member = ( Item . Member ) item2 ;
( ( ChannelMembersListViewHolderMember ) viewHolder ) . bind ( member , new ChannelMembersListAdapter$onBindViewHolder$1 ( this , member ) ) ;
} else if ( viewHolder instanceof ChannelMembersListViewHolderLoading ) {
( ( ChannelMembersListViewHolderLoading ) viewHolder ) . bind ( i ) ;
} else if ( viewHolder instanceof ChannelMembersListViewHolderRoleHeader ) {
Item item3 = this . memberList . get ( i ) ;
Objects . requireNonNull ( item3 , " null cannot be cast to non-null type com.discord.widgets.channels.memberlist.adapter.ChannelMembersListAdapter.Item.RoleHeader " ) ;
( ( ChannelMembersListViewHolderRoleHeader ) viewHolder ) . bind ( ( Item . RoleHeader ) item3 ) ;
} else if ( viewHolder instanceof ChannelMembersListViewHolderAdd ) {
Item item4 = this . memberList . get ( i ) ;
Objects . requireNonNull ( item4 , " null cannot be cast to non-null type com.discord.widgets.channels.memberlist.adapter.ChannelMembersListAdapter.Item.AddMember " ) ;
( ( ChannelMembersListViewHolderAdd ) viewHolder ) . bind ( new ChannelMembersListAdapter$onBindViewHolder$2 ( this ) , ( ( Item . AddMember ) item4 ) . getTitle ( ) ) ;
}
}
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
public RecyclerView . ViewHolder onCreateViewHolder ( ViewGroup viewGroup , int i ) {
m . checkNotNullParameter ( viewGroup , " parent " ) ;
LayoutInflater from = LayoutInflater . from ( viewGroup . getContext ( ) ) ;
int ordinal = ViewType . Companion . fromOrdinal ( i ) . ordinal ( ) ;
if ( ordinal = = 0 ) {
WidgetChannelMembersListItemHeaderBinding a = WidgetChannelMembersListItemHeaderBinding . a ( from , viewGroup , false ) ;
m . checkNotNullExpressionValue ( a , " WidgetChannelMembersList…(inflater, parent, false) " ) ;
return new ChannelMembersListViewHolderRoleHeader ( a ) ;
} else if ( ordinal = = 1 ) {
WidgetChannelMembersListItemPlaceholderHeaderBinding a2 = WidgetChannelMembersListItemPlaceholderHeaderBinding . a ( from , viewGroup , false ) ;
m . checkNotNullExpressionValue ( a2 , " WidgetChannelMembersList…(inflater, parent, false) " ) ;
return new ChannelMembersListViewHolderPlaceholderHeader ( a2 ) ;
} else if ( ordinal = = 2 ) {
WidgetChannelMembersListItemHeaderBinding a3 = WidgetChannelMembersListItemHeaderBinding . a ( from , viewGroup , false ) ;
m . checkNotNullExpressionValue ( a3 , " WidgetChannelMembersList…(inflater, parent, false) " ) ;
return new ChannelMembersListViewHolderHeader ( a3 ) ;
} else if ( ordinal = = 3 ) {
2021-07-19 19:45:22 +00:00
View inflate = from . inflate ( 2131558880 , viewGroup , false ) ;
int i2 = 2131362296 ;
SimpleDraweeView simpleDraweeView = ( SimpleDraweeView ) inflate . findViewById ( 2131362296 ) ;
2021-06-27 20:44:35 +00:00
if ( simpleDraweeView ! = null ) {
2021-07-19 19:45:22 +00:00
i2 = 2131362297 ;
ImageView imageView = ( ImageView ) inflate . findViewById ( 2131362297 ) ;
2021-06-27 20:44:35 +00:00
if ( imageView ! = null ) {
2021-07-19 19:45:22 +00:00
i2 = 2131362298 ;
SimpleDraweeSpanTextView simpleDraweeSpanTextView = ( SimpleDraweeSpanTextView ) inflate . findViewById ( 2131362298 ) ;
2021-06-27 20:44:35 +00:00
if ( simpleDraweeSpanTextView ! = null ) {
2021-07-19 19:45:22 +00:00
i2 = 2131362299 ;
ImageView imageView2 = ( ImageView ) inflate . findViewById ( 2131362299 ) ;
2021-06-27 20:44:35 +00:00
if ( imageView2 ! = null ) {
2021-07-19 19:45:22 +00:00
i2 = 2131362302 ;
UsernameView usernameView = ( UsernameView ) inflate . findViewById ( 2131362302 ) ;
2021-06-27 20:44:35 +00:00
if ( usernameView ! = null ) {
2021-07-19 19:45:22 +00:00
i2 = 2131362303 ;
StatusView statusView = ( StatusView ) inflate . findViewById ( 2131362303 ) ;
2021-06-27 20:44:35 +00:00
if ( statusView ! = null ) {
2021-07-19 19:45:22 +00:00
i2 = 2131362304 ;
ImageView imageView3 = ( ImageView ) inflate . findViewById ( 2131362304 ) ;
2021-06-27 20:44:35 +00:00
if ( imageView3 ! = null ) {
WidgetChannelMembersListItemUserBinding widgetChannelMembersListItemUserBinding = new WidgetChannelMembersListItemUserBinding ( ( ConstraintLayout ) inflate , simpleDraweeView , imageView , simpleDraweeSpanTextView , imageView2 , usernameView , statusView , imageView3 ) ;
m . checkNotNullExpressionValue ( widgetChannelMembersListItemUserBinding , " WidgetChannelMembersList…(inflater, parent, false) " ) ;
return new ChannelMembersListViewHolderMember ( widgetChannelMembersListItemUserBinding ) ;
}
}
}
}
}
}
}
throw new NullPointerException ( " Missing required view with ID: " . concat ( inflate . getResources ( ) . getResourceName ( i2 ) ) ) ;
} else if ( ordinal = = 4 ) {
2021-07-19 19:45:22 +00:00
View inflate2 = from . inflate ( 2131558876 , viewGroup , false ) ;
int i3 = 2131362294 ;
ImageView imageView4 = ( ImageView ) inflate2 . findViewById ( 2131362294 ) ;
2021-06-27 20:44:35 +00:00
if ( imageView4 ! = null ) {
2021-07-19 19:45:22 +00:00
i3 = 2131362295 ;
TextView textView = ( TextView ) inflate2 . findViewById ( 2131362295 ) ;
2021-06-27 20:44:35 +00:00
if ( textView ! = null ) {
WidgetChannelMembersListItemAddBinding widgetChannelMembersListItemAddBinding = new WidgetChannelMembersListItemAddBinding ( ( LinearLayout ) inflate2 , imageView4 , textView ) ;
m . checkNotNullExpressionValue ( widgetChannelMembersListItemAddBinding , " WidgetChannelMembersList…(inflater, parent, false) " ) ;
return new ChannelMembersListViewHolderAdd ( widgetChannelMembersListItemAddBinding ) ;
}
}
throw new NullPointerException ( " Missing required view with ID: " . concat ( inflate2 . getResources ( ) . getResourceName ( i3 ) ) ) ;
} else if ( ordinal = = 5 ) {
2021-07-19 19:45:22 +00:00
View inflate3 = from . inflate ( 2131558878 , viewGroup , false ) ;
int i4 = 2131362127 ;
View findViewById = inflate3 . findViewById ( 2131362127 ) ;
2021-06-27 20:44:35 +00:00
if ( findViewById ! = null ) {
2021-07-19 19:45:22 +00:00
i4 = 2131362128 ;
View findViewById2 = inflate3 . findViewById ( 2131362128 ) ;
2021-06-27 20:44:35 +00:00
if ( findViewById2 ! = null ) {
2021-07-20 00:17:12 +00:00
i4 = 2131365620 ;
Guideline guideline = ( Guideline ) inflate3 . findViewById ( 2131365620 ) ;
2021-06-27 20:44:35 +00:00
if ( guideline ! = null ) {
WidgetChannelMembersListItemLoadingBinding widgetChannelMembersListItemLoadingBinding = new WidgetChannelMembersListItemLoadingBinding ( ( ConstraintLayout ) inflate3 , findViewById , findViewById2 , guideline ) ;
m . checkNotNullExpressionValue ( widgetChannelMembersListItemLoadingBinding , " WidgetChannelMembersList…(inflater, parent, false) " ) ;
return new ChannelMembersListViewHolderLoading ( widgetChannelMembersListItemLoadingBinding ) ;
}
}
}
throw new NullPointerException ( " Missing required view with ID: " . concat ( inflate3 . getResources ( ) . getResourceName ( i4 ) ) ) ;
} else {
throw new NoWhenBranchMatchedException ( ) ;
}
}
public final void setData ( String str , WidgetChannelMembersListViewModel . MemberList memberList , boolean z2 ) {
m . checkNotNullParameter ( str , " listId " ) ;
m . checkNotNullParameter ( memberList , " rows " ) ;
PublishSubject < ListUpdateRequest > publishSubject = this . updatesSubject ;
publishSubject . j . onNext ( new ListUpdateRequest ( str , memberList , z2 ) ) ;
}
public final void setOnAddMemberClicked ( Function0 < Unit > function0 ) {
m . checkNotNullParameter ( function0 , " addMember " ) ;
this . onAddMemberClicked = function0 ;
}
public final void setOnUserClicked ( Function1 < ? super Long , Unit > function1 ) {
this . onUserClicked = function1 ;
}
}