2021-08-03 07:33:18 +00:00
package com.discord.widgets.channels.list ;
import android.annotation.SuppressLint ;
import android.content.Context ;
import android.content.res.ColorStateList ;
2021-09-14 06:27:26 +00:00
import android.graphics.drawable.Drawable ;
2021-08-03 07:33:18 +00:00
import android.view.View ;
import android.view.ViewGroup ;
import android.view.animation.AccelerateDecelerateInterpolator ;
import android.view.animation.RotateAnimation ;
import android.widget.ImageView ;
import android.widget.LinearLayout ;
import android.widget.RelativeLayout ;
import android.widget.TextView ;
import androidx.annotation.ColorInt ;
import androidx.annotation.DrawableRes ;
import androidx.annotation.LayoutRes ;
import androidx.constraintlayout.widget.ConstraintLayout ;
import androidx.core.content.ContextCompat ;
import androidx.core.view.ViewCompat ;
import androidx.fragment.app.FragmentManager ;
import androidx.recyclerview.widget.RecyclerView ;
2021-08-11 06:37:47 +00:00
import c.a.k.b ;
2021-10-08 22:11:56 +00:00
import c.c.a.a0.d ;
2021-08-03 07:33:18 +00:00
import c.d.b.a.a ;
2021-08-09 22:51:56 +00:00
import com.discord.R ;
2021-08-03 07:33:18 +00:00
import com.discord.api.channel.Channel ;
2021-10-08 22:11:56 +00:00
import com.discord.api.channel.ChannelUtils ;
2021-08-03 07:33:18 +00:00
import com.discord.api.guild.GuildMaxVideoChannelUsers ;
2021-09-15 06:33:54 +00:00
import com.discord.api.guildscheduledevent.GuildScheduledEvent ;
2021-08-09 22:51:56 +00:00
import com.discord.api.permission.Permission ;
2021-08-03 07:33:18 +00:00
import com.discord.api.stageinstance.StageInstance ;
import com.discord.api.voice.state.VoiceState ;
2021-09-14 06:27:26 +00:00
import com.discord.databinding.WidgetChannelsListItemActiveEventBinding ;
2021-08-03 07:33:18 +00:00
import com.discord.databinding.WidgetChannelsListItemAudienceCountBinding ;
import com.discord.databinding.WidgetChannelsListItemCategoryBinding ;
import com.discord.databinding.WidgetChannelsListItemChannelBinding ;
import com.discord.databinding.WidgetChannelsListItemChannelPrivateBinding ;
import com.discord.databinding.WidgetChannelsListItemChannelStageVoiceBinding ;
import com.discord.databinding.WidgetChannelsListItemChannelVoiceBinding ;
import com.discord.databinding.WidgetChannelsListItemDirectoryBinding ;
import com.discord.databinding.WidgetChannelsListItemGuildScheduledEventsBinding ;
import com.discord.databinding.WidgetChannelsListItemHeaderBinding ;
import com.discord.databinding.WidgetChannelsListItemMfaBinding ;
import com.discord.databinding.WidgetChannelsListItemThreadBinding ;
import com.discord.databinding.WidgetChannelsListItemVoiceUserBinding ;
import com.discord.models.member.GuildMember ;
import com.discord.models.presence.Presence ;
import com.discord.models.user.User ;
import com.discord.utilities.color.ColorCompat ;
import com.discord.utilities.drawable.DrawableCompat ;
import com.discord.utilities.font.FontUtils ;
import com.discord.utilities.icon.IconUtils ;
2021-08-19 06:48:32 +00:00
import com.discord.utilities.images.MGImages ;
2021-08-03 07:33:18 +00:00
import com.discord.utilities.mg_recycler.MGRecyclerAdapterSimple ;
import com.discord.utilities.mg_recycler.MGRecyclerViewHolder ;
import com.discord.utilities.permissions.PermissionUtils ;
import com.discord.utilities.presence.PresenceUtils ;
import com.discord.utilities.resources.StringResourceUtilsKt ;
import com.discord.utilities.view.extensions.ViewExtensions ;
import com.discord.utilities.view.text.LinkifiedTextView ;
import com.discord.utilities.view.text.SimpleDraweeSpanTextView ;
import com.discord.views.StatusView ;
import com.discord.views.VoiceUserLimitView ;
import com.discord.views.user.UserSummaryView ;
import com.discord.widgets.channels.list.WidgetChannelListModel ;
import com.discord.widgets.channels.list.items.ChannelListBottomNavSpaceItem ;
import com.discord.widgets.channels.list.items.ChannelListItem ;
2021-09-14 06:27:26 +00:00
import com.discord.widgets.channels.list.items.ChannelListItemActiveEvent ;
import com.discord.widgets.channels.list.items.ChannelListItemActiveEventData ;
2021-08-03 07:33:18 +00:00
import com.discord.widgets.channels.list.items.ChannelListItemAddServer ;
import com.discord.widgets.channels.list.items.ChannelListItemCategory ;
import com.discord.widgets.channels.list.items.ChannelListItemDirectory ;
import com.discord.widgets.channels.list.items.ChannelListItemGuildScheduledEvents ;
import com.discord.widgets.channels.list.items.ChannelListItemHeader ;
import com.discord.widgets.channels.list.items.ChannelListItemInvite ;
import com.discord.widgets.channels.list.items.ChannelListItemPrivate ;
import com.discord.widgets.channels.list.items.ChannelListItemStageAudienceCount ;
import com.discord.widgets.channels.list.items.ChannelListItemStageVoiceChannel ;
import com.discord.widgets.channels.list.items.ChannelListItemTextChannel ;
import com.discord.widgets.channels.list.items.ChannelListItemThread ;
import com.discord.widgets.channels.list.items.ChannelListItemVoiceChannel ;
import com.discord.widgets.channels.list.items.ChannelListItemVoiceUser ;
import com.discord.widgets.channels.list.items.ChannelListVocalItem ;
2021-09-24 06:27:57 +00:00
import com.discord.widgets.guildscheduledevent.GuildScheduledEventLocationInfo ;
import com.discord.widgets.guildscheduledevent.WidgetGuildScheduledEventDetailsBottomSheet ;
2021-08-03 07:33:18 +00:00
import com.facebook.drawee.view.SimpleDraweeView ;
import com.google.android.material.button.MaterialButton ;
import com.google.android.material.textview.MaterialTextView ;
2021-11-02 06:38:17 +00:00
import d0.z.d.m ;
2021-08-03 07:33:18 +00:00
import java.util.List ;
import kotlin.Unit ;
import kotlin.jvm.functions.Function0 ;
import kotlin.jvm.functions.Function1 ;
import kotlin.jvm.functions.Function2 ;
import kotlin.jvm.internal.DefaultConstructorMarker ;
/* compiled from: WidgetChannelsListAdapter.kt */
public final class WidgetChannelsListAdapter extends MGRecyclerAdapterSimple < ChannelListItem > {
private int bottomNavHeight ;
private final FragmentManager fragmentManager ;
private Function0 < Unit > onAddServer = WidgetChannelsListAdapter$onAddServer$1 . INSTANCE ;
private Function1 < ? super Channel , Unit > onCallChannel = WidgetChannelsListAdapter$onCallChannel$1 . INSTANCE ;
private Function2 < ? super Channel , ? super Boolean , Unit > onCollapseCategory = WidgetChannelsListAdapter$onCollapseCategory$1 . INSTANCE ;
private Function1 < ? super Channel , Unit > onJoinStageChannel = WidgetChannelsListAdapter$onJoinStageChannel$1 . INSTANCE ;
private Function1 < ? super Channel , Unit > onSelectChannel = WidgetChannelsListAdapter$onSelectChannel$1 . INSTANCE ;
private Function1 < ? super Channel , Unit > onSelectChannelOptions = WidgetChannelsListAdapter$onSelectChannelOptions$1 . INSTANCE ;
2021-11-02 06:38:17 +00:00
private Function1 < ? super Channel , Unit > onSelectGuildRoleSubscriptionLockedChannel = WidgetChannelsListAdapter$onSelectGuildRoleSubscriptionLockedChannel$1 . INSTANCE ;
2021-08-03 07:33:18 +00:00
private Function1 < ? super View , Unit > onSelectInvite = WidgetChannelsListAdapter$onSelectInvite$1 . INSTANCE ;
private Function2 < ? super User , ? super Channel , Unit > onSelectUserOptions = WidgetChannelsListAdapter$onSelectUserOptions$1 . INSTANCE ;
2021-09-21 06:31:55 +00:00
private Function0 < Unit > onViewGuildRoleSubscriptions = WidgetChannelsListAdapter$onViewGuildRoleSubscriptions$1 . INSTANCE ;
2021-09-22 06:37:51 +00:00
private Function1 < ? super Long , Unit > onViewGuildScheduledEvents = WidgetChannelsListAdapter$onViewGuildScheduledEvents$1 . INSTANCE ;
2021-08-03 07:33:18 +00:00
private long selectedGuildId ;
/* compiled from: WidgetChannelsListAdapter.kt */
public static abstract class Item extends MGRecyclerViewHolder < WidgetChannelsListAdapter , ChannelListItem > {
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public Item ( @LayoutRes int i , WidgetChannelsListAdapter widgetChannelsListAdapter ) {
super ( i , widgetChannelsListAdapter ) ;
m . checkNotNullParameter ( widgetChannelsListAdapter , " adapter " ) ;
}
public final void setBackground ( View view , boolean z2 , Channel channel ) {
int i ;
m . checkNotNullParameter ( view , " $this$setBackground " ) ;
m . checkNotNullParameter ( channel , " channel " ) ;
2021-11-10 07:31:25 +00:00
if ( ! z2 | | ChannelUtils . t ( channel ) ) {
2021-08-03 07:33:18 +00:00
Context context = view . getContext ( ) ;
m . checkNotNullExpressionValue ( context , " context " ) ;
2021-08-09 22:51:56 +00:00
i = DrawableCompat . getThemedDrawableRes$default ( context , ( int ) R . attr . drawable_overlay_channels , 0 , 2 , ( Object ) null ) ;
2021-08-03 07:33:18 +00:00
} else {
Context context2 = view . getContext ( ) ;
m . checkNotNullExpressionValue ( context2 , " context " ) ;
2021-08-09 22:51:56 +00:00
i = DrawableCompat . getThemedDrawableRes$default ( context2 , ( int ) R . attr . drawable_overlay_channels_selected , 0 , 2 , ( Object ) null ) ;
2021-08-03 07:33:18 +00:00
}
ViewExtensions . setBackgroundAndKeepPadding ( view , ContextCompat . getDrawable ( view . getContext ( ) , i ) ) ;
}
}
/* compiled from: WidgetChannelsListAdapter.kt */
public static final class ItemChannelAddServer extends Item {
private final WidgetChannelsListItemDirectoryBinding binding ;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ItemChannelAddServer ( int i , WidgetChannelsListAdapter widgetChannelsListAdapter ) {
super ( i , widgetChannelsListAdapter ) ;
m . checkNotNullParameter ( widgetChannelsListAdapter , " adapter " ) ;
WidgetChannelsListItemDirectoryBinding a = WidgetChannelsListItemDirectoryBinding . a ( this . itemView ) ;
m . checkNotNullExpressionValue ( a , " WidgetChannelsListItemDi…oryBinding.bind(itemView) " ) ;
this . binding = a ;
}
public static final /* synthetic */ WidgetChannelsListAdapter access$getAdapter$p ( ItemChannelAddServer itemChannelAddServer ) {
return ( WidgetChannelsListAdapter ) itemChannelAddServer . adapter ;
}
public void onConfigure ( int i , ChannelListItem channelListItem ) {
m . checkNotNullParameter ( channelListItem , " data " ) ;
super . onConfigure ( i , ( int ) channelListItem ) ;
if ( channelListItem instanceof ChannelListItemAddServer ) {
2021-11-20 07:11:29 +00:00
this . binding . f1796c . setText ( R . string . hub_sidebar_add_servers ) ;
2021-08-09 22:51:56 +00:00
this . binding . b . setImageResource ( R . drawable . ic_add_24dp ) ;
2021-08-03 07:33:18 +00:00
this . binding . a . setOnClickListener ( new WidgetChannelsListAdapter$ItemChannelAddServer$onConfigure$$inlined$apply$lambda$1 ( this ) ) ;
}
}
}
/* compiled from: WidgetChannelsListAdapter.kt */
public static final class ItemChannelCategory extends Item {
private static final long ANIMATION_DURATION = 300 ;
private static final RotateAnimation ARROW_ANIM_COLLAPSE ;
private static final RotateAnimation ARROW_ANIM_EXPAND ;
public static final Companion Companion ;
private final WidgetChannelsListItemCategoryBinding binding ;
private boolean isCollapsed ;
/* compiled from: WidgetChannelsListAdapter.kt */
public static final class Companion {
private Companion ( ) {
}
public /* synthetic */ Companion ( DefaultConstructorMarker defaultConstructorMarker ) {
this ( ) ;
}
public static final /* synthetic */ RotateAnimation access$getAnimation ( Companion companion , boolean z2 ) {
return companion . getAnimation ( z2 ) ;
}
public static final /* synthetic */ int access$getArrowDrawable ( Companion companion , ChannelListItemCategory channelListItemCategory ) {
return companion . getArrowDrawable ( channelListItemCategory ) ;
}
public static final /* synthetic */ int access$getChannelColor ( Companion companion , ChannelListItemCategory channelListItemCategory , Context context ) {
return companion . getChannelColor ( channelListItemCategory , context ) ;
}
private final RotateAnimation getAnimation ( boolean z2 ) {
RotateAnimation rotateAnimation = new RotateAnimation ( z2 ? - 90 . 0f : 90 . 0f , 0 . 0f , 1 , 0 . 5f , 1 , 0 . 5f ) ;
rotateAnimation . setInterpolator ( new AccelerateDecelerateInterpolator ( ) ) ;
rotateAnimation . setDuration ( 300 ) ;
return rotateAnimation ;
}
@DrawableRes
private final int getArrowDrawable ( ChannelListItemCategory channelListItemCategory ) {
if ( channelListItemCategory . isCollapsed ( ) ) {
2021-08-09 22:51:56 +00:00
return R . drawable . ic_chevron_right_grey_12dp ;
2021-08-03 07:33:18 +00:00
}
2021-08-09 22:51:56 +00:00
if ( ! channelListItemCategory . isCollapsed ( ) ) {
return R . drawable . ic_chevron_down_grey_12dp ;
}
return 0 ;
2021-08-03 07:33:18 +00:00
}
@ColorInt
private final int getChannelColor ( ChannelListItemCategory channelListItemCategory , Context context ) {
2021-08-09 22:51:56 +00:00
return channelListItemCategory . isMuted ( ) ? ColorCompat . getThemedColor ( context , ( int ) R . attr . colorInteractiveMuted ) : ColorCompat . getThemedColor ( context , ( int ) R . attr . colorChannelDefault ) ;
2021-08-03 07:33:18 +00:00
}
}
static {
Companion companion = new Companion ( null ) ;
Companion = companion ;
ARROW_ANIM_EXPAND = Companion . access$getAnimation ( companion , true ) ;
ARROW_ANIM_COLLAPSE = Companion . access$getAnimation ( companion , false ) ;
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ItemChannelCategory ( int i , WidgetChannelsListAdapter widgetChannelsListAdapter ) {
super ( i , widgetChannelsListAdapter ) ;
m . checkNotNullParameter ( widgetChannelsListAdapter , " adapter " ) ;
View view = this . itemView ;
2021-08-09 22:51:56 +00:00
int i2 = R . id . channels_item_category_add ;
ImageView imageView = ( ImageView ) view . findViewById ( R . id . channels_item_category_add ) ;
2021-08-03 07:33:18 +00:00
if ( imageView ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . channels_item_category_arrow ;
ImageView imageView2 = ( ImageView ) view . findViewById ( R . id . channels_item_category_arrow ) ;
2021-08-03 07:33:18 +00:00
if ( imageView2 ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . channels_item_category_name ;
TextView textView = ( TextView ) view . findViewById ( R . id . channels_item_category_name ) ;
2021-08-03 07:33:18 +00:00
if ( textView ! = null ) {
WidgetChannelsListItemCategoryBinding widgetChannelsListItemCategoryBinding = new WidgetChannelsListItemCategoryBinding ( ( LinearLayout ) view , imageView , imageView2 , textView ) ;
m . checkNotNullExpressionValue ( widgetChannelsListItemCategoryBinding , " WidgetChannelsListItemCa…oryBinding.bind(itemView) " ) ;
this . binding = widgetChannelsListItemCategoryBinding ;
return ;
}
}
}
throw new NullPointerException ( " Missing required view with ID: " . concat ( view . getResources ( ) . getResourceName ( i2 ) ) ) ;
}
public static final /* synthetic */ WidgetChannelsListAdapter access$getAdapter$p ( ItemChannelCategory itemChannelCategory ) {
return ( WidgetChannelsListAdapter ) itemChannelCategory . adapter ;
}
/ * JADX DEBUG : Can ' t convert new array creation : APUT found in different block : 0x0078 : APUT
( r3v1 java . lang . Object [ ] )
( 1 ? ? [ boolean , int , float , short , byte , char ] )
( wrap : java . lang . CharSequence : 0x0074 : INVOKE ( r6v2 java . lang . CharSequence ) =
( r6v1 android . widget . TextView )
( r7v1 int )
( wrap : java . lang . Object [ ] : 0x0070 : NEW_ARRAY ( r8v0 java . lang . Object [ ] ) = ( 0 int ) type : java . lang . Object [ ] )
( null kotlin . jvm . functions . Function1 )
( 4 int )
2021-08-11 06:37:47 +00:00
type : STATIC call : c . a . k . b . j ( android . view . View , int , java . lang . Object [ ] , kotlin . jvm . functions . Function1 , int ) : java . lang . CharSequence )
2021-08-03 07:33:18 +00:00
* /
public void onConfigure ( int i , ChannelListItem channelListItem ) {
m . checkNotNullParameter ( channelListItem , " data " ) ;
super . onConfigure ( i , ( int ) channelListItem ) ;
ChannelListItemCategory channelListItemCategory = ( ChannelListItemCategory ) channelListItem ;
LinearLayout linearLayout = this . binding . a ;
m . checkNotNullExpressionValue ( linearLayout , " binding.root " ) ;
ViewExtensions . setOnLongClickListenerConsumeClick ( linearLayout , new WidgetChannelsListAdapter$ItemChannelCategory$onConfigure$1 ( this , channelListItem ) ) ;
this . binding . a . setOnClickListener ( new WidgetChannelsListAdapter$ItemChannelCategory$onConfigure$2 ( this , channelListItem ) ) ;
TextView textView = this . binding . d ;
m . checkNotNullExpressionValue ( textView , " binding.channelsItemCategoryName " ) ;
2021-10-08 22:11:56 +00:00
textView . setText ( ChannelUtils . c ( channelListItemCategory . getChannel ( ) ) ) ;
2021-08-03 07:33:18 +00:00
TextView textView2 = this . binding . d ;
m . checkNotNullExpressionValue ( textView2 , " binding.channelsItemCategoryName " ) ;
TextView textView3 = this . binding . d ;
m . checkNotNullExpressionValue ( textView3 , " binding.channelsItemCategoryName " ) ;
Object [ ] objArr = new Object [ 2 ] ;
int i2 = 0 ;
2021-10-08 22:11:56 +00:00
objArr [ 0 ] = ChannelUtils . c ( channelListItemCategory . getChannel ( ) ) ;
2021-08-03 07:33:18 +00:00
TextView textView4 = this . binding . d ;
m . checkNotNullExpressionValue ( textView4 , " binding.channelsItemCategoryName " ) ;
2021-08-09 22:51:56 +00:00
objArr [ 1 ] = b . j ( textView4 , channelListItemCategory . isCollapsed ( ) ? R . string . collapsed : R . string . expanded , new Object [ 0 ] , null , 4 ) ;
textView2 . setContentDescription ( b . j ( textView3 , R . string . category_a11y_label_with_expanded_state , objArr , null , 4 ) ) ;
2021-08-03 07:33:18 +00:00
Companion companion = Companion ;
TextView textView5 = this . binding . d ;
m . checkNotNullExpressionValue ( textView5 , " binding.channelsItemCategoryName " ) ;
Context context = textView5 . getContext ( ) ;
m . checkNotNullExpressionValue ( context , " binding.channelsItemCategoryName.context " ) ;
int access$getChannelColor = Companion . access$getChannelColor ( companion , channelListItemCategory , context ) ;
this . binding . d . setTextColor ( access$getChannelColor ) ;
ViewCompat . setAccessibilityDelegate ( this . binding . d , new WidgetChannelsListAdapter$ItemChannelCategory$onConfigure$3 ( ) ) ;
2021-11-20 07:11:29 +00:00
this . binding . f1791c . setImageResource ( Companion . access$getArrowDrawable ( companion , channelListItemCategory ) ) ;
ImageView imageView = this . binding . f1791c ;
2021-08-03 07:33:18 +00:00
m . checkNotNullExpressionValue ( imageView , " binding.channelsItemCategoryArrow " ) ;
imageView . setImageTintList ( ColorStateList . valueOf ( access$getChannelColor ) ) ;
if ( this . isCollapsed ! = channelListItemCategory . isCollapsed ( ) ) {
this . isCollapsed = channelListItemCategory . isCollapsed ( ) ;
2021-11-20 07:11:29 +00:00
this . binding . f1791c . startAnimation ( channelListItemCategory . isCollapsed ( ) ? ARROW_ANIM_COLLAPSE : ARROW_ANIM_EXPAND ) ;
2021-08-03 07:33:18 +00:00
}
ImageView imageView2 = this . binding . b ;
m . checkNotNullExpressionValue ( imageView2 , " binding.channelsItemCategoryAdd " ) ;
if ( ! channelListItemCategory . getCanManageChannels ( ) ) {
i2 = 8 ;
}
imageView2 . setVisibility ( i2 ) ;
ImageView imageView3 = this . binding . b ;
m . checkNotNullExpressionValue ( imageView3 , " binding.channelsItemCategoryAdd " ) ;
imageView3 . setImageTintList ( ColorStateList . valueOf ( access$getChannelColor ) ) ;
this . binding . b . setOnClickListener ( new WidgetChannelsListAdapter$ItemChannelCategory$onConfigure$4 ( this , channelListItemCategory ) ) ;
}
}
/* compiled from: WidgetChannelsListAdapter.kt */
public static final class ItemChannelDirectory extends Item {
private final WidgetChannelsListItemDirectoryBinding binding ;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ItemChannelDirectory ( int i , WidgetChannelsListAdapter widgetChannelsListAdapter ) {
super ( i , widgetChannelsListAdapter ) ;
m . checkNotNullParameter ( widgetChannelsListAdapter , " adapter " ) ;
WidgetChannelsListItemDirectoryBinding a = WidgetChannelsListItemDirectoryBinding . a ( this . itemView ) ;
m . checkNotNullExpressionValue ( a , " WidgetChannelsListItemDi…oryBinding.bind(itemView) " ) ;
this . binding = a ;
}
public static final /* synthetic */ WidgetChannelsListAdapter access$getAdapter$p ( ItemChannelDirectory itemChannelDirectory ) {
return ( WidgetChannelsListAdapter ) itemChannelDirectory . adapter ;
}
public void onConfigure ( int i , ChannelListItem channelListItem ) {
m . checkNotNullParameter ( channelListItem , " data " ) ;
super . onConfigure ( i , ( int ) channelListItem ) ;
ChannelListItemDirectory channelListItemDirectory = ( ChannelListItemDirectory ) channelListItem ;
2021-11-10 07:31:25 +00:00
boolean u = ChannelUtils . u ( channelListItemDirectory . getChannel ( ) ) ;
if ( u ) {
2021-11-20 07:11:29 +00:00
TextView textView = this . binding . f1796c ;
2021-10-08 22:11:56 +00:00
m . checkNotNullExpressionValue ( textView , " binding.directoryChannelName " ) ;
String m = channelListItemDirectory . getChannel ( ) . m ( ) ;
if ( m = = null ) {
m = " " ;
}
textView . setText ( m ) ;
} else {
2021-11-20 07:11:29 +00:00
this . binding . f1796c . setText ( R . string . hub_sidebar_join_servers ) ;
2021-10-08 22:11:56 +00:00
}
2021-11-10 07:31:25 +00:00
this . binding . b . setImageResource ( u ? R . drawable . ic_hub_24dp : R . drawable . ic_compass ) ;
2021-08-03 07:33:18 +00:00
LinearLayout linearLayout = this . binding . a ;
linearLayout . setOnClickListener ( new WidgetChannelsListAdapter$ItemChannelDirectory$onConfigure$$inlined$apply$lambda$1 ( this , channelListItemDirectory ) ) ;
linearLayout . setSelected ( channelListItemDirectory . getSelected ( ) ) ;
}
}
/* compiled from: WidgetChannelsListAdapter.kt */
public static final class ItemChannelPrivate extends Item {
private final WidgetChannelsListItemChannelPrivateBinding binding ;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ItemChannelPrivate ( int i , WidgetChannelsListAdapter widgetChannelsListAdapter ) {
super ( i , widgetChannelsListAdapter ) ;
m . checkNotNullParameter ( widgetChannelsListAdapter , " adapter " ) ;
View view = this . itemView ;
2021-08-09 22:51:56 +00:00
int i2 = R . id . channel_list_item_private_status ;
StatusView statusView = ( StatusView ) view . findViewById ( R . id . channel_list_item_private_status ) ;
2021-08-03 07:33:18 +00:00
if ( statusView ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . channels_list_item_private_avatar ;
SimpleDraweeView simpleDraweeView = ( SimpleDraweeView ) view . findViewById ( R . id . channels_list_item_private_avatar ) ;
2021-08-03 07:33:18 +00:00
if ( simpleDraweeView ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . channels_list_item_private_desc ;
SimpleDraweeSpanTextView simpleDraweeSpanTextView = ( SimpleDraweeSpanTextView ) view . findViewById ( R . id . channels_list_item_private_desc ) ;
2021-08-03 07:33:18 +00:00
if ( simpleDraweeSpanTextView ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . channels_list_item_private_mentions ;
TextView textView = ( TextView ) view . findViewById ( R . id . channels_list_item_private_mentions ) ;
2021-08-03 07:33:18 +00:00
if ( textView ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . channels_list_item_private_name ;
TextView textView2 = ( TextView ) view . findViewById ( R . id . channels_list_item_private_name ) ;
2021-08-03 07:33:18 +00:00
if ( textView2 ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . channels_list_item_private_tag ;
TextView textView3 = ( TextView ) view . findViewById ( R . id . channels_list_item_private_tag ) ;
2021-08-03 07:33:18 +00:00
if ( textView3 ! = null ) {
WidgetChannelsListItemChannelPrivateBinding widgetChannelsListItemChannelPrivateBinding = new WidgetChannelsListItemChannelPrivateBinding ( ( RelativeLayout ) view , statusView , simpleDraweeView , simpleDraweeSpanTextView , textView , textView2 , textView3 ) ;
m . checkNotNullExpressionValue ( widgetChannelsListItemChannelPrivateBinding , " WidgetChannelsListItemCh…ateBinding.bind(itemView) " ) ;
this . binding = widgetChannelsListItemChannelPrivateBinding ;
return ;
}
}
}
}
}
}
throw new NullPointerException ( " Missing required view with ID: " . concat ( view . getResources ( ) . getResourceName ( i2 ) ) ) ;
}
public static final /* synthetic */ WidgetChannelsListAdapter access$getAdapter$p ( ItemChannelPrivate itemChannelPrivate ) {
return ( WidgetChannelsListAdapter ) itemChannelPrivate . adapter ;
}
private final CharSequence getContentDescription ( ChannelListItemPrivate channelListItemPrivate , CharSequence charSequence ) {
2021-10-08 22:11:56 +00:00
if ( ChannelUtils . p ( channelListItemPrivate . getChannel ( ) ) & & channelListItemPrivate . getMentionCount ( ) > 0 ) {
2021-08-03 07:33:18 +00:00
View view = this . itemView ;
m . checkNotNullExpressionValue ( view , " itemView " ) ;
2021-08-09 22:51:56 +00:00
return b . j ( view , R . string . group_message_a11y_label_with_unreads , new Object [ ] { charSequence } , null , 4 ) ;
2021-10-08 22:11:56 +00:00
} else if ( ChannelUtils . p ( channelListItemPrivate . getChannel ( ) ) ) {
2021-08-03 07:33:18 +00:00
View view2 = this . itemView ;
m . checkNotNullExpressionValue ( view2 , " itemView " ) ;
2021-08-09 22:51:56 +00:00
return b . j ( view2 , R . string . group_message_a11y_label , new Object [ ] { charSequence } , null , 4 ) ;
2021-08-03 07:33:18 +00:00
} else if ( channelListItemPrivate . getMentionCount ( ) > 0 ) {
View view3 = this . itemView ;
m . checkNotNullExpressionValue ( view3 , " itemView " ) ;
2021-08-09 22:51:56 +00:00
return b . j ( view3 , R . string . direct_message_a11y_label_with_unreads , new Object [ ] { charSequence } , null , 4 ) ;
2021-08-03 07:33:18 +00:00
} else {
View view4 = this . itemView ;
m . checkNotNullExpressionValue ( view4 , " itemView " ) ;
2021-08-09 22:51:56 +00:00
return b . j ( view4 , R . string . direct_message_a11y_label , new Object [ ] { charSequence } , null , 4 ) ;
2021-08-03 07:33:18 +00:00
}
}
/* JADX DEBUG: TODO: convert one arg to string using `String.valueOf()`, args: [(wrap: int : 0x000d: ARITH (r5v3 int) = (r5v2 int) + (1 int)), (' ' char), (r6v1 java.lang.CharSequence)] */
@SuppressLint ( { " SetTextI18n " } )
private final String getMemberCount ( Channel channel , Context context ) {
2021-11-02 06:38:17 +00:00
List < com . discord . api . user . User > w = channel . w ( ) ;
int size = w ! = null ? w . size ( ) : 0 ;
2021-08-09 22:51:56 +00:00
CharSequence h = b . h ( context , R . string . members , new Object [ 0 ] , null , 4 ) ;
2021-08-03 07:33:18 +00:00
StringBuilder sb = new StringBuilder ( ) ;
sb . append ( size + 1 ) ;
sb . append ( ' ' ) ;
sb . append ( h ) ;
return sb . toString ( ) ;
}
private final int getPresenceBg ( boolean z2 ) {
if ( z2 ) {
View view = this . itemView ;
m . checkNotNullExpressionValue ( view , " itemView " ) ;
2021-08-09 22:51:56 +00:00
return ColorCompat . getThemedColor ( view , ( int ) R . attr . color_bg_private_channel_presence_selected ) ;
2021-08-03 07:33:18 +00:00
}
View view2 = this . itemView ;
m . checkNotNullExpressionValue ( view2 , " itemView " ) ;
2021-08-09 22:51:56 +00:00
return ColorCompat . getThemedColor ( view2 , ( int ) R . attr . colorBackgroundSecondary ) ;
2021-08-03 07:33:18 +00:00
}
@ColorInt
private final int getTextColor ( ChannelListItemPrivate channelListItemPrivate ) {
if ( channelListItemPrivate . getSelected ( ) ) {
View view = this . itemView ;
m . checkNotNullExpressionValue ( view , " itemView " ) ;
2021-08-09 22:51:56 +00:00
return ColorCompat . getThemedColor ( view , ( int ) R . attr . colorInteractiveActive ) ;
2021-08-03 07:33:18 +00:00
} else if ( channelListItemPrivate . getMuted ( ) ) {
View view2 = this . itemView ;
m . checkNotNullExpressionValue ( view2 , " itemView " ) ;
2021-08-09 22:51:56 +00:00
return ColorCompat . getThemedColor ( view2 , ( int ) R . attr . colorInteractiveMuted ) ;
2021-08-03 07:33:18 +00:00
} else {
View view3 = this . itemView ;
m . checkNotNullExpressionValue ( view3 , " itemView " ) ;
2021-08-09 22:51:56 +00:00
return ColorCompat . getThemedColor ( view3 , ( int ) R . attr . colorChannelDefault ) ;
2021-08-03 07:33:18 +00:00
}
}
2021-10-02 06:32:57 +00:00
/* JADX WARNING: Removed duplicated region for block: B:22:0x015f */
/* JADX WARNING: Removed duplicated region for block: B:23:0x0161 */
/* JADX WARNING: Removed duplicated region for block: B:25:0x0164 */
/* JADX WARNING: Removed duplicated region for block: B:26:0x0166 */
2021-08-03 07:33:18 +00:00
public void onConfigure ( int i , ChannelListItem channelListItem ) {
String str ;
String str2 ;
boolean z2 ;
int i2 ;
m . checkNotNullParameter ( channelListItem , " data " ) ;
super . onConfigure ( i , ( int ) channelListItem ) ;
ChannelListItemPrivate channelListItemPrivate = ( ChannelListItemPrivate ) channelListItem ;
Channel component1 = channelListItemPrivate . component1 ( ) ;
Presence component2 = channelListItemPrivate . component2 ( ) ;
boolean component3 = channelListItemPrivate . component3 ( ) ;
int component4 = channelListItemPrivate . component4 ( ) ;
boolean component5 = channelListItemPrivate . component5 ( ) ;
2021-10-08 22:11:56 +00:00
if ( ChannelUtils . m ( component1 ) ) {
str = ChannelUtils . c ( component1 ) ;
2021-08-03 07:33:18 +00:00
} else {
TextView textView = this . binding . f ;
m . checkNotNullExpressionValue ( textView , " binding.channelsListItemPrivateName " ) ;
Context context = textView . getContext ( ) ;
m . checkNotNullExpressionValue ( context , " binding.channelsListItemPrivateName.context " ) ;
2021-10-08 22:11:56 +00:00
str = ChannelUtils . e ( component1 , context , false , 2 ) ;
2021-08-03 07:33:18 +00:00
}
RelativeLayout relativeLayout = this . binding . a ;
m . checkNotNullExpressionValue ( relativeLayout , " binding.root " ) ;
ViewExtensions . setOnLongClickListenerConsumeClick ( relativeLayout , new WidgetChannelsListAdapter$ItemChannelPrivate$onConfigure$1 ( this , channelListItem ) ) ;
this . binding . a . setOnClickListener ( new WidgetChannelsListAdapter$ItemChannelPrivate$onConfigure$2 ( this , channelListItem ) ) ;
RelativeLayout relativeLayout2 = this . binding . a ;
m . checkNotNullExpressionValue ( relativeLayout2 , " binding.root " ) ;
relativeLayout2 . setContentDescription ( getContentDescription ( channelListItemPrivate , str ) ) ;
TextView textView2 = this . binding . f ;
m . checkNotNullExpressionValue ( textView2 , " binding.channelsListItemPrivateName " ) ;
textView2 . setText ( str ) ;
this . binding . f . setTextColor ( getTextColor ( channelListItemPrivate ) ) ;
TextView textView3 = this . binding . g ;
m . checkNotNullExpressionValue ( textView3 , " binding.channelsListItemPrivateTag " ) ;
2021-10-20 06:51:20 +00:00
textView3 . setVisibility ( ChannelUtils . A ( component1 ) ? 0 : 8 ) ;
2021-11-20 07:11:29 +00:00
SimpleDraweeView simpleDraweeView = this . binding . f1793c ;
2021-08-03 07:33:18 +00:00
m . checkNotNullExpressionValue ( simpleDraweeView , " it " ) ;
2021-08-19 06:48:32 +00:00
IconUtils . setIcon$default ( simpleDraweeView , component1 , ( int ) R . dimen . avatar_size_standard , ( MGImages . ChangeDetector ) null , 8 , ( Object ) null ) ;
2021-08-03 07:33:18 +00:00
StatusView statusView = this . binding . b ;
m . checkNotNullExpressionValue ( statusView , " binding.channelListItemPrivateStatus " ) ;
2021-10-08 22:11:56 +00:00
statusView . setVisibility ( ChannelUtils . n ( component1 , component2 ) ? 0 : 8 ) ;
2021-08-03 07:33:18 +00:00
this . binding . b . setPresence ( component2 ) ;
this . binding . b . setBackgroundColor ( getPresenceBg ( component3 ) ) ;
2021-10-20 06:51:20 +00:00
if ( ChannelUtils . A ( component1 ) ) {
2021-08-03 07:33:18 +00:00
SimpleDraweeSpanTextView simpleDraweeSpanTextView = this . binding . d ;
m . checkNotNullExpressionValue ( simpleDraweeSpanTextView , " binding.channelsListItemPrivateDesc " ) ;
SimpleDraweeSpanTextView simpleDraweeSpanTextView2 = this . binding . d ;
m . checkNotNullExpressionValue ( simpleDraweeSpanTextView2 , " binding.channelsListItemPrivateDesc " ) ;
2021-08-09 22:51:56 +00:00
ViewExtensions . setTextAndVisibilityBy ( simpleDraweeSpanTextView , b . j ( simpleDraweeSpanTextView2 , R . string . system_dm_activity_text , new Object [ 0 ] , null , 4 ) ) ;
2021-11-10 07:31:25 +00:00
} else if ( ChannelUtils . w ( component1 ) ) {
2021-08-03 07:33:18 +00:00
SimpleDraweeSpanTextView simpleDraweeSpanTextView3 = this . binding . d ;
m . checkNotNullExpressionValue ( simpleDraweeSpanTextView3 , " binding.channelsListItemPrivateDesc " ) ;
SimpleDraweeSpanTextView simpleDraweeSpanTextView4 = this . binding . d ;
m . checkNotNullExpressionValue ( simpleDraweeSpanTextView4 , " binding.channelsListItemPrivateDesc " ) ;
Context context2 = simpleDraweeSpanTextView4 . getContext ( ) ;
m . checkNotNullExpressionValue ( context2 , " binding.channelsListItemPrivateDesc.context " ) ;
ViewExtensions . setTextAndVisibilityBy ( simpleDraweeSpanTextView3 , getMemberCount ( component1 , context2 ) ) ;
} else {
SimpleDraweeSpanTextView simpleDraweeSpanTextView5 = this . binding . d ;
m . checkNotNullExpressionValue ( simpleDraweeSpanTextView5 , " binding.channelsListItemPrivateDesc " ) ;
str2 = " binding.root " ;
i2 = component4 ;
z2 = component3 ;
PresenceUtils . setPresenceText$default ( component2 , component5 , simpleDraweeSpanTextView5 , false , false , 24 , null ) ;
TextView textView4 = this . binding . e ;
m . checkNotNullExpressionValue ( textView4 , " binding.channelsListItemPrivateMentions " ) ;
textView4 . setText ( String . valueOf ( Math . min ( 99 , i2 ) ) ) ;
TextView textView5 = this . binding . e ;
m . checkNotNullExpressionValue ( textView5 , " binding.channelsListItemPrivateMentions " ) ;
textView5 . setVisibility ( ! ( i2 < = 0 ) ? 0 : 8 ) ;
RelativeLayout relativeLayout3 = this . binding . a ;
m . checkNotNullExpressionValue ( relativeLayout3 , str2 ) ;
relativeLayout3 . setSelected ( z2 ) ;
RelativeLayout relativeLayout4 = this . binding . a ;
m . checkNotNullExpressionValue ( relativeLayout4 , str2 ) ;
setBackground ( relativeLayout4 , z2 , component1 ) ;
}
str2 = " binding.root " ;
i2 = component4 ;
z2 = component3 ;
TextView textView4 = this . binding . e ;
m . checkNotNullExpressionValue ( textView4 , " binding.channelsListItemPrivateMentions " ) ;
textView4 . setText ( String . valueOf ( Math . min ( 99 , i2 ) ) ) ;
TextView textView5 = this . binding . e ;
m . checkNotNullExpressionValue ( textView5 , " binding.channelsListItemPrivateMentions " ) ;
textView5 . setVisibility ( ! ( i2 < = 0 ) ? 0 : 8 ) ;
RelativeLayout relativeLayout3 = this . binding . a ;
m . checkNotNullExpressionValue ( relativeLayout3 , str2 ) ;
relativeLayout3 . setSelected ( z2 ) ;
RelativeLayout relativeLayout4 = this . binding . a ;
m . checkNotNullExpressionValue ( relativeLayout4 , str2 ) ;
setBackground ( relativeLayout4 , z2 , component1 ) ;
}
}
/* compiled from: WidgetChannelsListAdapter.kt */
public static final class ItemChannelStageVoice extends Item {
public static final Companion Companion = new Companion ( null ) ;
private final WidgetChannelsListItemChannelStageVoiceBinding binding ;
/* compiled from: WidgetChannelsListAdapter.kt */
public static final class Companion {
private Companion ( ) {
}
public /* synthetic */ Companion ( DefaultConstructorMarker defaultConstructorMarker ) {
this ( ) ;
}
public static final /* synthetic */ int access$getVoiceChannelColor ( Companion companion , boolean z2 , Context context ) {
return companion . getVoiceChannelColor ( z2 , context ) ;
}
@ColorInt
private final int getVoiceChannelColor ( boolean z2 , Context context ) {
2021-08-09 22:51:56 +00:00
return z2 ? ColorCompat . getThemedColor ( context , ( int ) R . attr . colorInteractiveActive ) : ColorCompat . getThemedColor ( context , ( int ) R . attr . colorChannelDefault ) ;
2021-08-03 07:33:18 +00:00
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ItemChannelStageVoice ( int i , WidgetChannelsListAdapter widgetChannelsListAdapter ) {
super ( i , widgetChannelsListAdapter ) ;
m . checkNotNullParameter ( widgetChannelsListAdapter , " adapter " ) ;
View view = this . itemView ;
2021-11-02 06:38:17 +00:00
int i2 = R . id . channels_item_stage_voice_channel_guild_role_subscription_icon ;
ImageView imageView = ( ImageView ) view . findViewById ( R . id . channels_item_stage_voice_channel_guild_role_subscription_icon ) ;
2021-08-03 07:33:18 +00:00
if ( imageView ! = null ) {
2021-11-02 06:38:17 +00:00
i2 = R . id . stage_channel_item_stage_channel_icon ;
ImageView imageView2 = ( ImageView ) view . findViewById ( R . id . stage_channel_item_stage_channel_icon ) ;
if ( imageView2 ! = null ) {
i2 = R . id . stage_channel_item_voice_channel_name ;
TextView textView = ( TextView ) view . findViewById ( R . id . stage_channel_item_voice_channel_name ) ;
if ( textView ! = null ) {
i2 = R . id . stage_channel_item_voice_channel_topic ;
TextView textView2 = ( TextView ) view . findViewById ( R . id . stage_channel_item_voice_channel_topic ) ;
if ( textView2 ! = null ) {
WidgetChannelsListItemChannelStageVoiceBinding widgetChannelsListItemChannelStageVoiceBinding = new WidgetChannelsListItemChannelStageVoiceBinding ( ( RelativeLayout ) view , imageView , imageView2 , textView , textView2 ) ;
m . checkNotNullExpressionValue ( widgetChannelsListItemChannelStageVoiceBinding , " WidgetChannelsListItemCh…iceBinding.bind(itemView) " ) ;
this . binding = widgetChannelsListItemChannelStageVoiceBinding ;
return ;
}
2021-08-03 07:33:18 +00:00
}
}
}
throw new NullPointerException ( " Missing required view with ID: " . concat ( view . getResources ( ) . getResourceName ( i2 ) ) ) ;
}
public static final /* synthetic */ WidgetChannelsListAdapter access$getAdapter$p ( ItemChannelStageVoice itemChannelStageVoice ) {
return ( WidgetChannelsListAdapter ) itemChannelStageVoice . adapter ;
}
private final CharSequence getContentDescription ( ChannelListVocalItem channelListVocalItem , int i ) {
if ( i > 0 ) {
RelativeLayout relativeLayout = this . binding . a ;
m . checkNotNullExpressionValue ( relativeLayout , " binding.root " ) ;
2021-10-08 22:11:56 +00:00
return b . j ( relativeLayout , R . string . guild_sidebar_voice_channel_a11y_label_with_limit , new Object [ ] { ChannelUtils . c ( channelListVocalItem . getChannel ( ) ) , Integer . valueOf ( channelListVocalItem . getNumUsersConnected ( ) ) , Integer . valueOf ( i ) } , null , 4 ) ;
2021-08-03 07:33:18 +00:00
} else if ( channelListVocalItem . getNumUsersConnected ( ) > 0 ) {
RelativeLayout relativeLayout2 = this . binding . a ;
m . checkNotNullExpressionValue ( relativeLayout2 , " binding.root " ) ;
RelativeLayout relativeLayout3 = this . binding . a ;
m . checkNotNullExpressionValue ( relativeLayout3 , " binding.root " ) ;
Context context = relativeLayout3 . getContext ( ) ;
m . checkNotNullExpressionValue ( context , " binding.root.context " ) ;
2021-10-08 22:11:56 +00:00
return b . j ( relativeLayout2 , R . string . guild_sidebar_voice_channel_a11y_label_with_users , new Object [ ] { ChannelUtils . c ( channelListVocalItem . getChannel ( ) ) , StringResourceUtilsKt . getI18nPluralString ( context , R . plurals . guild_sidebar_voice_channel_a11y_label_with_users_userCount , channelListVocalItem . getNumUsersConnected ( ) , Integer . valueOf ( channelListVocalItem . getNumUsersConnected ( ) ) ) } , null , 4 ) ;
2021-08-03 07:33:18 +00:00
} else {
RelativeLayout relativeLayout4 = this . binding . a ;
m . checkNotNullExpressionValue ( relativeLayout4 , " binding.root " ) ;
2021-10-08 22:11:56 +00:00
return b . j ( relativeLayout4 , R . string . guild_sidebar_voice_channel_a11y_label , new Object [ ] { ChannelUtils . c ( channelListVocalItem . getChannel ( ) ) } , null , 4 ) ;
2021-08-03 07:33:18 +00:00
}
}
@SuppressLint ( { " SetTextI18n " } )
public void onConfigure ( int i , ChannelListItem channelListItem ) {
ColorStateList colorStateList ;
m . checkNotNullParameter ( channelListItem , " data " ) ;
super . onConfigure ( i , ( int ) channelListItem ) ;
ChannelListItemStageVoiceChannel channelListItemStageVoiceChannel = ( ChannelListItemStageVoiceChannel ) channelListItem ;
Channel component1 = channelListItemStageVoiceChannel . component1 ( ) ;
boolean component2 = channelListItemStageVoiceChannel . component2 ( ) ;
Long component3 = channelListItemStageVoiceChannel . component3 ( ) ;
boolean component4 = channelListItemStageVoiceChannel . component4 ( ) ;
StageInstance component6 = channelListItemStageVoiceChannel . component6 ( ) ;
2021-10-20 06:51:20 +00:00
boolean component8 = channelListItemStageVoiceChannel . component8 ( ) ;
2021-11-02 06:38:17 +00:00
boolean component9 = channelListItemStageVoiceChannel . component9 ( ) ;
int i2 = 0 ;
2021-09-15 06:33:54 +00:00
boolean z2 = component6 ! = null ;
2021-08-09 22:51:56 +00:00
boolean can = PermissionUtils . can ( Permission . CONNECT , component3 ) ;
2021-08-03 07:33:18 +00:00
Companion companion = Companion ;
View view = this . itemView ;
m . checkNotNullExpressionValue ( view , " itemView " ) ;
Context context = view . getContext ( ) ;
m . checkNotNullExpressionValue ( context , " itemView.context " ) ;
int access$getVoiceChannelColor = Companion . access$getVoiceChannelColor ( companion , component2 , context ) ;
2021-10-20 06:51:20 +00:00
this . binding . a . setOnClickListener ( new WidgetChannelsListAdapter$ItemChannelStageVoice$onConfigure$1 ( this , component8 , channelListItem ) ) ;
2021-08-03 07:33:18 +00:00
RelativeLayout relativeLayout = this . binding . a ;
m . checkNotNullExpressionValue ( relativeLayout , " binding.root " ) ;
relativeLayout . setSelected ( component2 ) ;
RelativeLayout relativeLayout2 = this . binding . a ;
m . checkNotNullExpressionValue ( relativeLayout2 , " binding.root " ) ;
setBackground ( relativeLayout2 , component2 , component1 ) ;
2021-11-02 06:38:17 +00:00
TextView textView = this . binding . d ;
2021-10-08 22:11:56 +00:00
textView . setText ( ChannelUtils . c ( component1 ) ) ;
2021-08-03 07:33:18 +00:00
textView . setTextColor ( access$getVoiceChannelColor ) ;
2021-11-02 06:38:17 +00:00
TextView textView2 = this . binding . e ;
2021-09-15 06:33:54 +00:00
m . checkNotNullExpressionValue ( textView2 , " binding.stageChannelItemVoiceChannelTopic " ) ;
ViewExtensions . setTextAndVisibilityBy ( textView2 , component6 ! = null ? component6 . f ( ) : null ) ;
2021-08-03 07:33:18 +00:00
ImageView imageView = this . binding . b ;
2021-11-02 06:38:17 +00:00
m . checkNotNullExpressionValue ( imageView , " binding.channelsItemStag…GuildRoleSubscriptionIcon " ) ;
if ( ! component9 ) {
i2 = 8 ;
}
imageView . setVisibility ( i2 ) ;
if ( component8 ) {
this . binding . b . setImageResource ( R . drawable . ic_premium_channel_locked ) ;
} else if ( component9 ) {
this . binding . b . setImageResource ( R . drawable . ic_premium_channel_unlocked ) ;
}
int i3 = ! can ? R . drawable . ic_channel_lock_16dp : component4 ? R . drawable . ic_channel_stage_locked : R . drawable . ic_channel_stage_24dp ;
2021-11-20 07:11:29 +00:00
ImageView imageView2 = this . binding . f1794c ;
2021-11-02 06:38:17 +00:00
imageView2 . setImageResource ( i3 ) ;
2021-09-15 06:33:54 +00:00
if ( ! z2 | | ! can ) {
2021-08-03 07:33:18 +00:00
colorStateList = ColorStateList . valueOf ( access$getVoiceChannelColor ) ;
} else {
RelativeLayout relativeLayout3 = this . binding . a ;
m . checkNotNullExpressionValue ( relativeLayout3 , " binding.root " ) ;
2021-08-09 22:51:56 +00:00
colorStateList = ColorStateList . valueOf ( ColorCompat . getColor ( relativeLayout3 . getContext ( ) , ( int ) R . color . status_green_600 ) ) ;
2021-08-03 07:33:18 +00:00
}
2021-11-02 06:38:17 +00:00
imageView2 . setImageTintList ( colorStateList ) ;
2021-08-03 07:33:18 +00:00
RelativeLayout relativeLayout4 = this . binding . a ;
m . checkNotNullExpressionValue ( relativeLayout4 , " binding.root " ) ;
relativeLayout4 . setContentDescription ( getContentDescription ( ( ChannelListVocalItem ) channelListItem , component1 . B ( ) ) ) ;
RelativeLayout relativeLayout5 = this . binding . a ;
m . checkNotNullExpressionValue ( relativeLayout5 , " binding.root " ) ;
2021-09-15 06:33:54 +00:00
ViewExtensions . setOnLongClickListenerConsumeClick ( relativeLayout5 , new WidgetChannelsListAdapter$ItemChannelStageVoice$onConfigure$4 ( this , component1 ) ) ;
2021-08-03 07:33:18 +00:00
}
}
/* compiled from: WidgetChannelsListAdapter.kt */
public static final class ItemChannelText extends Item {
private final WidgetChannelsListItemChannelBinding binding ;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ItemChannelText ( int i , WidgetChannelsListAdapter widgetChannelsListAdapter ) {
super ( i , widgetChannelsListAdapter ) ;
m . checkNotNullParameter ( widgetChannelsListAdapter , " adapter " ) ;
View view = this . itemView ;
2021-11-02 06:38:17 +00:00
int i2 = R . id . channels_item_channel_guild_role_subscription_icon ;
ImageView imageView = ( ImageView ) view . findViewById ( R . id . channels_item_channel_guild_role_subscription_icon ) ;
2021-08-03 07:33:18 +00:00
if ( imageView ! = null ) {
2021-11-02 06:38:17 +00:00
i2 = R . id . channels_item_channel_hash ;
ImageView imageView2 = ( ImageView ) view . findViewById ( R . id . channels_item_channel_hash ) ;
if ( imageView2 ! = null ) {
i2 = R . id . channels_item_channel_mentions ;
TextView textView = ( TextView ) view . findViewById ( R . id . channels_item_channel_mentions ) ;
if ( textView ! = null ) {
i2 = R . id . channels_item_channel_name ;
TextView textView2 = ( TextView ) view . findViewById ( R . id . channels_item_channel_name ) ;
if ( textView2 ! = null ) {
i2 = R . id . channels_item_channel_unread ;
ImageView imageView3 = ( ImageView ) view . findViewById ( R . id . channels_item_channel_unread ) ;
if ( imageView3 ! = null ) {
WidgetChannelsListItemChannelBinding widgetChannelsListItemChannelBinding = new WidgetChannelsListItemChannelBinding ( ( RelativeLayout ) view , imageView , imageView2 , textView , textView2 , imageView3 ) ;
m . checkNotNullExpressionValue ( widgetChannelsListItemChannelBinding , " WidgetChannelsListItemCh…nelBinding.bind(itemView) " ) ;
this . binding = widgetChannelsListItemChannelBinding ;
return ;
}
2021-08-03 07:33:18 +00:00
}
}
}
}
throw new NullPointerException ( " Missing required view with ID: " . concat ( view . getResources ( ) . getResourceName ( i2 ) ) ) ;
}
public static final /* synthetic */ WidgetChannelsListAdapter access$getAdapter$p ( ItemChannelText itemChannelText ) {
return ( WidgetChannelsListAdapter ) itemChannelText . adapter ;
}
@DrawableRes
private final int getAnnouncementsIcon ( ChannelListItemTextChannel channelListItemTextChannel ) {
2021-08-09 22:51:56 +00:00
return channelListItemTextChannel . getChannel ( ) . o ( ) ? channelListItemTextChannel . getHasActiveThreads ( ) ? R . drawable . ic_channel_announcements_thread_nsfw : R . drawable . ic_channel_announcements_nsfw : channelListItemTextChannel . isLocked ( ) ? channelListItemTextChannel . getHasActiveThreads ( ) ? R . drawable . ic_channel_announcements_thread_locked : R . drawable . ic_channel_announcements_locked : channelListItemTextChannel . getHasActiveThreads ( ) ? R . drawable . ic_channel_announcements_thread : R . drawable . ic_channel_announcements ;
2021-08-03 07:33:18 +00:00
}
private final CharSequence getContentDescription ( ChannelListItemTextChannel channelListItemTextChannel , boolean z2 ) {
if ( z2 & & channelListItemTextChannel . getMentionCount ( ) > 0 ) {
View view = this . itemView ;
m . checkNotNullExpressionValue ( view , " itemView " ) ;
2021-10-08 22:11:56 +00:00
return b . j ( view , R . string . guild_sidebar_announcement_channel_a11y_label_with_mentions , new Object [ ] { StringResourceUtilsKt . getI18nPluralString ( a . x ( this . itemView , " itemView " , " itemView.context " ) , R . plurals . guild_sidebar_announcement_channel_a11y_label_with_mentions_mentionCount , channelListItemTextChannel . getMentionCount ( ) , Integer . valueOf ( channelListItemTextChannel . getMentionCount ( ) ) ) , ChannelUtils . c ( channelListItemTextChannel . getChannel ( ) ) } , null , 4 ) ;
2021-08-03 07:33:18 +00:00
} else if ( z2 & & channelListItemTextChannel . isUnread ( ) ) {
View view2 = this . itemView ;
m . checkNotNullExpressionValue ( view2 , " itemView " ) ;
2021-10-08 22:11:56 +00:00
return b . j ( view2 , R . string . guild_sidebar_announcement_channel_a11y_label_with_unreads , new Object [ ] { ChannelUtils . c ( channelListItemTextChannel . getChannel ( ) ) } , null , 4 ) ;
2021-08-03 07:33:18 +00:00
} else if ( z2 ) {
View view3 = this . itemView ;
m . checkNotNullExpressionValue ( view3 , " itemView " ) ;
2021-10-08 22:11:56 +00:00
return b . j ( view3 , R . string . guild_sidebar_announcement_channel_a11y_label , new Object [ ] { ChannelUtils . c ( channelListItemTextChannel . getChannel ( ) ) } , null , 4 ) ;
2021-08-03 07:33:18 +00:00
} else if ( channelListItemTextChannel . getMentionCount ( ) > 0 ) {
View view4 = this . itemView ;
m . checkNotNullExpressionValue ( view4 , " itemView " ) ;
2021-10-08 22:11:56 +00:00
return b . j ( view4 , R . string . guild_sidebar_default_channel_a11y_label_with_mentions , new Object [ ] { StringResourceUtilsKt . getI18nPluralString ( a . x ( this . itemView , " itemView " , " itemView.context " ) , R . plurals . guild_sidebar_default_channel_a11y_label_with_mentions_mentionCount , channelListItemTextChannel . getMentionCount ( ) , Integer . valueOf ( channelListItemTextChannel . getMentionCount ( ) ) ) , ChannelUtils . c ( channelListItemTextChannel . getChannel ( ) ) } , null , 4 ) ;
2021-08-03 07:33:18 +00:00
} else if ( channelListItemTextChannel . isUnread ( ) ) {
View view5 = this . itemView ;
m . checkNotNullExpressionValue ( view5 , " itemView " ) ;
2021-10-08 22:11:56 +00:00
return b . j ( view5 , R . string . guild_sidebar_default_channel_a11y_label_with_unreads , new Object [ ] { ChannelUtils . c ( channelListItemTextChannel . getChannel ( ) ) } , null , 4 ) ;
2021-08-03 07:33:18 +00:00
} else {
View view6 = this . itemView ;
m . checkNotNullExpressionValue ( view6 , " itemView " ) ;
2021-10-08 22:11:56 +00:00
return b . j ( view6 , R . string . guild_sidebar_default_channel_a11y_label , new Object [ ] { ChannelUtils . c ( channelListItemTextChannel . getChannel ( ) ) } , null , 4 ) ;
2021-08-03 07:33:18 +00:00
}
}
@ColorInt
private final int getHashColor ( ChannelListItemTextChannel channelListItemTextChannel ) {
if ( channelListItemTextChannel . getMuted ( ) ) {
View view = this . itemView ;
m . checkNotNullExpressionValue ( view , " itemView " ) ;
2021-08-09 22:51:56 +00:00
return ColorCompat . getThemedColor ( view , ( int ) R . attr . colorInteractiveMuted ) ;
2021-08-03 07:33:18 +00:00
} else if ( channelListItemTextChannel . isUnread ( ) ) {
View view2 = this . itemView ;
m . checkNotNullExpressionValue ( view2 , " itemView " ) ;
2021-08-09 22:51:56 +00:00
return ColorCompat . getThemedColor ( view2 , ( int ) R . attr . colorInteractiveActive ) ;
2021-08-03 07:33:18 +00:00
} else {
View view3 = this . itemView ;
m . checkNotNullExpressionValue ( view3 , " itemView " ) ;
2021-08-09 22:51:56 +00:00
return ColorCompat . getThemedColor ( view3 , ( int ) R . attr . colorChannelDefault ) ;
2021-08-03 07:33:18 +00:00
}
}
@DrawableRes
private final int getHashIcon ( ChannelListItemTextChannel channelListItemTextChannel ) {
2021-11-02 06:38:17 +00:00
return channelListItemTextChannel . getChannel ( ) . o ( ) ? channelListItemTextChannel . getHasActiveThreads ( ) ? R . drawable . ic_thread_nsfw : R . drawable . ic_channel_text_nsfw : channelListItemTextChannel . isLocked ( ) ? channelListItemTextChannel . getHasActiveThreads ( ) ? R . drawable . ic_thread_locked : R . drawable . ic_channel_text_locked : channelListItemTextChannel . getHasActiveThreads ( ) ? R . drawable . ic_thread : R . drawable . ic_channel_text ;
2021-08-03 07:33:18 +00:00
}
@ColorInt
private final int getTextColor ( ChannelListItemTextChannel channelListItemTextChannel , boolean z2 ) {
if ( z2 ) {
View view = this . itemView ;
m . checkNotNullExpressionValue ( view , " itemView " ) ;
2021-08-09 22:51:56 +00:00
return ColorCompat . getThemedColor ( view , ( int ) R . attr . colorInteractiveActive ) ;
2021-08-03 07:33:18 +00:00
} else if ( channelListItemTextChannel . getMuted ( ) ) {
View view2 = this . itemView ;
m . checkNotNullExpressionValue ( view2 , " itemView " ) ;
2021-08-09 22:51:56 +00:00
return ColorCompat . getThemedColor ( view2 , ( int ) R . attr . colorInteractiveMuted ) ;
2021-08-03 07:33:18 +00:00
} else if ( channelListItemTextChannel . isUnread ( ) ) {
View view3 = this . itemView ;
m . checkNotNullExpressionValue ( view3 , " itemView " ) ;
2021-08-09 22:51:56 +00:00
return ColorCompat . getThemedColor ( view3 , ( int ) R . attr . colorInteractiveActive ) ;
2021-08-03 07:33:18 +00:00
} else {
View view4 = this . itemView ;
m . checkNotNullExpressionValue ( view4 , " itemView " ) ;
2021-08-09 22:51:56 +00:00
return ColorCompat . getThemedColor ( view4 , ( int ) R . attr . colorChannelDefault ) ;
2021-08-03 07:33:18 +00:00
}
}
public void onConfigure ( int i , ChannelListItem channelListItem ) {
m . checkNotNullParameter ( channelListItem , " data " ) ;
super . onConfigure ( i , ( int ) channelListItem ) ;
ChannelListItemTextChannel channelListItemTextChannel = ( ChannelListItemTextChannel ) channelListItem ;
boolean z2 = true ;
int i2 = 0 ;
boolean z3 = channelListItemTextChannel . getChannel ( ) . A ( ) = = 5 ;
RelativeLayout relativeLayout = this . binding . a ;
m . checkNotNullExpressionValue ( relativeLayout , " binding.root " ) ;
ViewExtensions . setOnLongClickListenerConsumeClick ( relativeLayout , new WidgetChannelsListAdapter$ItemChannelText$onConfigure$1 ( this , channelListItem ) ) ;
2021-10-20 06:51:20 +00:00
this . binding . a . setOnClickListener ( new WidgetChannelsListAdapter$ItemChannelText$onConfigure$2 ( this , channelListItemTextChannel , channelListItem ) ) ;
2021-08-03 07:33:18 +00:00
RelativeLayout relativeLayout2 = this . binding . a ;
m . checkNotNullExpressionValue ( relativeLayout2 , " binding.root " ) ;
setBackground ( relativeLayout2 , channelListItemTextChannel . getSelected ( ) , channelListItemTextChannel . getChannel ( ) ) ;
RelativeLayout relativeLayout3 = this . binding . a ;
m . checkNotNullExpressionValue ( relativeLayout3 , " binding.root " ) ;
relativeLayout3 . setContentDescription ( getContentDescription ( channelListItemTextChannel , z3 ) ) ;
2021-11-02 06:38:17 +00:00
TextView textView = this . binding . e ;
2021-08-03 07:33:18 +00:00
m . checkNotNullExpressionValue ( textView , " binding.channelsItemChannelName " ) ;
2021-10-08 22:11:56 +00:00
textView . setText ( ChannelUtils . c ( channelListItemTextChannel . getChannel ( ) ) ) ;
2021-11-02 06:38:17 +00:00
this . binding . e . setTextColor ( getTextColor ( channelListItemTextChannel , channelListItemTextChannel . getSelected ( ) ) ) ;
2021-11-20 07:11:29 +00:00
this . binding . f1792c . setImageResource ( z3 ? getAnnouncementsIcon ( channelListItemTextChannel ) : getHashIcon ( channelListItemTextChannel ) ) ;
ImageView imageView = this . binding . f1792c ;
2021-08-03 07:33:18 +00:00
m . checkNotNullExpressionValue ( imageView , " binding.channelsItemChannelHash " ) ;
imageView . setImageTintList ( ColorStateList . valueOf ( getHashColor ( channelListItemTextChannel ) ) ) ;
2021-11-02 06:38:17 +00:00
TextView textView2 = this . binding . d ;
2021-08-03 07:33:18 +00:00
m . checkNotNullExpressionValue ( textView2 , " binding.channelsItemChannelMentions " ) ;
textView2 . setVisibility ( channelListItemTextChannel . getMentionCount ( ) > 0 ? 0 : 8 ) ;
2021-11-02 06:38:17 +00:00
TextView textView3 = this . binding . d ;
2021-08-03 07:33:18 +00:00
m . checkNotNullExpressionValue ( textView3 , " binding.channelsItemChannelMentions " ) ;
textView3 . setText ( String . valueOf ( Math . min ( 99 , channelListItemTextChannel . getMentionCount ( ) ) ) ) ;
2021-11-02 06:38:17 +00:00
ImageView imageView2 = this . binding . f ;
2021-08-03 07:33:18 +00:00
m . checkNotNullExpressionValue ( imageView2 , " binding.channelsItemChannelUnread " ) ;
if ( ! channelListItemTextChannel . isUnread ( ) | | channelListItemTextChannel . getSelected ( ) | | channelListItemTextChannel . getMuted ( ) ) {
z2 = false ;
}
2021-11-02 06:38:17 +00:00
imageView2 . setVisibility ( z2 ? 0 : 8 ) ;
TextView textView4 = this . binding . e ;
2021-08-03 07:33:18 +00:00
m . checkNotNullExpressionValue ( textView4 , " binding.channelsItemChannelName " ) ;
FontUtils fontUtils = FontUtils . INSTANCE ;
RelativeLayout relativeLayout4 = this . binding . a ;
m . checkNotNullExpressionValue ( relativeLayout4 , " binding.root " ) ;
Context context = relativeLayout4 . getContext ( ) ;
m . checkNotNullExpressionValue ( context , " binding.root.context " ) ;
2021-08-09 22:51:56 +00:00
textView4 . setTypeface ( fontUtils . getThemedFont ( context , ( channelListItemTextChannel . isUnread ( ) | | channelListItemTextChannel . getSelected ( ) ) ? R . attr . font_primary_semibold : R . attr . font_primary_normal ) ) ;
2021-11-02 06:38:17 +00:00
ImageView imageView3 = this . binding . b ;
m . checkNotNullExpressionValue ( imageView3 , " binding.channelsItemChan…GuildRoleSubscriptionIcon " ) ;
if ( ! channelListItemTextChannel . isGuildRoleSubscriptionChannel ( ) ) {
i2 = 8 ;
}
imageView3 . setVisibility ( i2 ) ;
if ( channelListItemTextChannel . isGuildRoleSubscriptionLockedChannel ( ) ) {
this . binding . b . setImageResource ( R . drawable . ic_premium_channel_locked ) ;
} else if ( channelListItemTextChannel . isGuildRoleSubscriptionChannel ( ) ) {
this . binding . b . setImageResource ( R . drawable . ic_premium_channel_unlocked ) ;
}
2021-08-03 07:33:18 +00:00
}
}
/* compiled from: WidgetChannelsListAdapter.kt */
public static final class ItemChannelThread extends Item {
private final WidgetChannelsListItemThreadBinding binding ;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ItemChannelThread ( int i , WidgetChannelsListAdapter widgetChannelsListAdapter ) {
super ( i , widgetChannelsListAdapter ) ;
m . checkNotNullParameter ( widgetChannelsListAdapter , " adapter " ) ;
View view = this . itemView ;
2021-08-09 22:51:56 +00:00
int i2 = R . id . channels_item_thread_content ;
ConstraintLayout constraintLayout = ( ConstraintLayout ) view . findViewById ( R . id . channels_item_thread_content ) ;
2021-08-03 07:33:18 +00:00
if ( constraintLayout ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . channels_item_thread_mentions ;
TextView textView = ( TextView ) view . findViewById ( R . id . channels_item_thread_mentions ) ;
2021-08-03 07:33:18 +00:00
if ( textView ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . channels_item_thread_name ;
TextView textView2 = ( TextView ) view . findViewById ( R . id . channels_item_thread_name ) ;
2021-08-03 07:33:18 +00:00
if ( textView2 ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . channels_item_thread_spine ;
ImageView imageView = ( ImageView ) view . findViewById ( R . id . channels_item_thread_spine ) ;
2021-08-03 07:33:18 +00:00
if ( imageView ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . channels_item_thread_unread ;
ImageView imageView2 = ( ImageView ) view . findViewById ( R . id . channels_item_thread_unread ) ;
2021-08-03 07:33:18 +00:00
if ( imageView2 ! = null ) {
WidgetChannelsListItemThreadBinding widgetChannelsListItemThreadBinding = new WidgetChannelsListItemThreadBinding ( ( ConstraintLayout ) view , constraintLayout , textView , textView2 , imageView , imageView2 ) ;
m . checkNotNullExpressionValue ( widgetChannelsListItemThreadBinding , " WidgetChannelsListItemThreadBinding.bind(itemView) " ) ;
this . binding = widgetChannelsListItemThreadBinding ;
return ;
}
}
}
}
}
throw new NullPointerException ( " Missing required view with ID: " . concat ( view . getResources ( ) . getResourceName ( i2 ) ) ) ;
}
public static final /* synthetic */ WidgetChannelsListAdapter access$getAdapter$p ( ItemChannelThread itemChannelThread ) {
return ( WidgetChannelsListAdapter ) itemChannelThread . adapter ;
}
private final CharSequence getContentDescription ( ChannelListItemThread channelListItemThread ) {
if ( channelListItemThread . getMentionCount ( ) > 0 ) {
View view = this . itemView ;
m . checkNotNullExpressionValue ( view , " itemView " ) ;
2021-08-09 22:51:56 +00:00
return b . j ( view , R . string . guild_sidebar_default_channel_a11y_label_with_mentions , new Object [ ] { StringResourceUtilsKt . getI18nPluralString ( a . x ( this . itemView , " itemView " , " itemView.context " ) , R . plurals . guild_sidebar_default_channel_a11y_label_with_mentions_mentionCount , channelListItemThread . getMentionCount ( ) , Integer . valueOf ( channelListItemThread . getMentionCount ( ) ) ) , channelListItemThread . getChannel ( ) . m ( ) } , null , 4 ) ;
2021-08-03 07:33:18 +00:00
} else if ( channelListItemThread . isUnread ( ) ) {
View view2 = this . itemView ;
m . checkNotNullExpressionValue ( view2 , " itemView " ) ;
2021-08-09 22:51:56 +00:00
return b . j ( view2 , R . string . guild_sidebar_default_channel_a11y_label_with_unreads , new Object [ ] { channelListItemThread . getChannel ( ) . m ( ) } , null , 4 ) ;
2021-08-03 07:33:18 +00:00
} else {
View view3 = this . itemView ;
m . checkNotNullExpressionValue ( view3 , " itemView " ) ;
2021-08-09 22:51:56 +00:00
return b . j ( view3 , R . string . guild_sidebar_default_channel_a11y_label , new Object [ ] { channelListItemThread . getChannel ( ) . m ( ) } , null , 4 ) ;
2021-08-03 07:33:18 +00:00
}
}
private final int getSpineResourceId ( WidgetChannelListModel . ThreadSpineType threadSpineType ) {
2021-08-09 22:51:56 +00:00
return m . areEqual ( threadSpineType , WidgetChannelListModel . ThreadSpineType . Single . INSTANCE ) ? R . drawable . ic_spine_short_cap : m . areEqual ( threadSpineType , WidgetChannelListModel . ThreadSpineType . Start . INSTANCE ) ? R . drawable . ic_spine_long_cap : m . areEqual ( threadSpineType , WidgetChannelListModel . ThreadSpineType . End . INSTANCE ) ? R . drawable . ic_spine_short_no_cap : R . drawable . ic_spine_long_no_cap ;
2021-08-03 07:33:18 +00:00
}
@ColorInt
private final int getTextColor ( ChannelListItemThread channelListItemThread , boolean z2 ) {
if ( z2 ) {
View view = this . itemView ;
m . checkNotNullExpressionValue ( view , " itemView " ) ;
2021-08-09 22:51:56 +00:00
return ColorCompat . getThemedColor ( view , ( int ) R . attr . colorInteractiveActive ) ;
2021-10-09 06:29:02 +00:00
} else if ( channelListItemThread . getMuted ( ) ) {
2021-08-03 07:33:18 +00:00
View view2 = this . itemView ;
m . checkNotNullExpressionValue ( view2 , " itemView " ) ;
2021-10-09 06:29:02 +00:00
return ColorCompat . getThemedColor ( view2 , ( int ) R . attr . colorInteractiveMuted ) ;
} else if ( channelListItemThread . isUnread ( ) ) {
2021-08-03 07:33:18 +00:00
View view3 = this . itemView ;
m . checkNotNullExpressionValue ( view3 , " itemView " ) ;
2021-10-09 06:29:02 +00:00
return ColorCompat . getThemedColor ( view3 , ( int ) R . attr . colorInteractiveActive ) ;
} else {
View view4 = this . itemView ;
m . checkNotNullExpressionValue ( view4 , " itemView " ) ;
return ColorCompat . getThemedColor ( view4 , ( int ) R . attr . colorChannelDefault ) ;
2021-08-03 07:33:18 +00:00
}
}
public void onConfigure ( int i , ChannelListItem channelListItem ) {
m . checkNotNullParameter ( channelListItem , " data " ) ;
super . onConfigure ( i , ( int ) channelListItem ) ;
ChannelListItemThread channelListItemThread = ( ChannelListItemThread ) channelListItem ;
ConstraintLayout constraintLayout = this . binding . a ;
m . checkNotNullExpressionValue ( constraintLayout , " binding.root " ) ;
ViewExtensions . setOnLongClickListenerConsumeClick ( constraintLayout , new WidgetChannelsListAdapter$ItemChannelThread$onConfigure$1 ( this , channelListItem ) ) ;
this . binding . a . setOnClickListener ( new WidgetChannelsListAdapter$ItemChannelThread$onConfigure$2 ( this , channelListItem ) ) ;
ConstraintLayout constraintLayout2 = this . binding . b ;
m . checkNotNullExpressionValue ( constraintLayout2 , " binding.channelsItemThreadContent " ) ;
setBackground ( constraintLayout2 , channelListItemThread . getSelected ( ) , channelListItemThread . getChannel ( ) ) ;
ConstraintLayout constraintLayout3 = this . binding . b ;
m . checkNotNullExpressionValue ( constraintLayout3 , " binding.channelsItemThreadContent " ) ;
constraintLayout3 . setContentDescription ( getContentDescription ( channelListItemThread ) ) ;
TextView textView = this . binding . d ;
m . checkNotNullExpressionValue ( textView , " binding.channelsItemThreadName " ) ;
textView . setText ( channelListItemThread . getChannel ( ) . m ( ) ) ;
this . binding . d . setTextColor ( getTextColor ( channelListItemThread , channelListItemThread . getSelected ( ) ) ) ;
2021-11-20 07:11:29 +00:00
TextView textView2 = this . binding . f1799c ;
2021-08-03 07:33:18 +00:00
m . checkNotNullExpressionValue ( textView2 , " binding.channelsItemThreadMentions " ) ;
boolean z2 = true ;
int i2 = 0 ;
textView2 . setVisibility ( channelListItemThread . getMentionCount ( ) > 0 ? 0 : 8 ) ;
2021-11-20 07:11:29 +00:00
TextView textView3 = this . binding . f1799c ;
2021-08-03 07:33:18 +00:00
m . checkNotNullExpressionValue ( textView3 , " binding.channelsItemThreadMentions " ) ;
textView3 . setText ( String . valueOf ( Math . min ( 99 , channelListItemThread . getMentionCount ( ) ) ) ) ;
ImageView imageView = this . binding . f ;
m . checkNotNullExpressionValue ( imageView , " binding.channelsItemThreadUnread " ) ;
2021-10-09 06:29:02 +00:00
if ( ! channelListItemThread . isUnread ( ) | | channelListItemThread . getSelected ( ) | | channelListItemThread . getMuted ( ) ) {
2021-08-03 07:33:18 +00:00
z2 = false ;
}
if ( ! z2 ) {
i2 = 8 ;
}
imageView . setVisibility ( i2 ) ;
TextView textView4 = this . binding . d ;
m . checkNotNullExpressionValue ( textView4 , " binding.channelsItemThreadName " ) ;
FontUtils fontUtils = FontUtils . INSTANCE ;
ConstraintLayout constraintLayout4 = this . binding . a ;
m . checkNotNullExpressionValue ( constraintLayout4 , " binding.root " ) ;
Context context = constraintLayout4 . getContext ( ) ;
m . checkNotNullExpressionValue ( context , " binding.root.context " ) ;
2021-08-09 22:51:56 +00:00
textView4 . setTypeface ( fontUtils . getThemedFont ( context , ( channelListItemThread . isUnread ( ) | | channelListItemThread . getSelected ( ) ) ? R . attr . font_primary_semibold : R . attr . font_primary_normal ) ) ;
2021-08-03 07:33:18 +00:00
this . binding . e . setImageResource ( getSpineResourceId ( channelListItemThread . getSpineType ( ) ) ) ;
}
}
/* compiled from: WidgetChannelsListAdapter.kt */
public static final class ItemChannelVoice extends Item {
public static final Companion Companion = new Companion ( null ) ;
private final WidgetChannelsListItemChannelVoiceBinding binding ;
/* compiled from: WidgetChannelsListAdapter.kt */
public static final class Companion {
private Companion ( ) {
}
public /* synthetic */ Companion ( DefaultConstructorMarker defaultConstructorMarker ) {
this ( ) ;
}
public static final /* synthetic */ int access$getVoiceChannelColor ( Companion companion , boolean z2 , Context context ) {
return companion . getVoiceChannelColor ( z2 , context ) ;
}
@ColorInt
private final int getVoiceChannelColor ( boolean z2 , Context context ) {
2021-08-09 22:51:56 +00:00
return z2 ? ColorCompat . getThemedColor ( context , ( int ) R . attr . colorInteractiveActive ) : ColorCompat . getThemedColor ( context , ( int ) R . attr . colorChannelDefault ) ;
2021-08-03 07:33:18 +00:00
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ItemChannelVoice ( int i , WidgetChannelsListAdapter widgetChannelsListAdapter ) {
super ( i , widgetChannelsListAdapter ) ;
m . checkNotNullParameter ( widgetChannelsListAdapter , " adapter " ) ;
View view = this . itemView ;
2021-11-02 06:38:17 +00:00
int i2 = R . id . channels_item_channel_mentions ;
TextView textView = ( TextView ) view . findViewById ( R . id . channels_item_channel_mentions ) ;
2021-08-03 07:33:18 +00:00
if ( textView ! = null ) {
2021-11-02 06:38:17 +00:00
i2 = R . id . channels_item_channel_unread ;
ImageView imageView = ( ImageView ) view . findViewById ( R . id . channels_item_channel_unread ) ;
if ( imageView ! = null ) {
i2 = R . id . channels_item_voice_channel_event_topic ;
TextView textView2 = ( TextView ) view . findViewById ( R . id . channels_item_voice_channel_event_topic ) ;
if ( textView2 ! = null ) {
i2 = R . id . channels_item_voice_channel_guild_role_subscription_icon ;
ImageView imageView2 = ( ImageView ) view . findViewById ( R . id . channels_item_voice_channel_guild_role_subscription_icon ) ;
if ( imageView2 ! = null ) {
i2 = R . id . channels_item_voice_channel_name ;
TextView textView3 = ( TextView ) view . findViewById ( R . id . channels_item_voice_channel_name ) ;
if ( textView3 ! = null ) {
i2 = R . id . channels_item_voice_channel_speaker ;
ImageView imageView3 = ( ImageView ) view . findViewById ( R . id . channels_item_voice_channel_speaker ) ;
if ( imageView3 ! = null ) {
i2 = R . id . channels_item_voice_channel_user_limit ;
VoiceUserLimitView voiceUserLimitView = ( VoiceUserLimitView ) view . findViewById ( R . id . channels_item_voice_channel_user_limit ) ;
if ( voiceUserLimitView ! = null ) {
i2 = R . id . channels_item_voice_channel_wrapper ;
LinearLayout linearLayout = ( LinearLayout ) view . findViewById ( R . id . channels_item_voice_channel_wrapper ) ;
if ( linearLayout ! = null ) {
WidgetChannelsListItemChannelVoiceBinding widgetChannelsListItemChannelVoiceBinding = new WidgetChannelsListItemChannelVoiceBinding ( ( ConstraintLayout ) view , textView , imageView , textView2 , imageView2 , textView3 , imageView3 , voiceUserLimitView , linearLayout ) ;
m . checkNotNullExpressionValue ( widgetChannelsListItemChannelVoiceBinding , " WidgetChannelsListItemCh…iceBinding.bind(itemView) " ) ;
this . binding = widgetChannelsListItemChannelVoiceBinding ;
return ;
}
}
}
}
2021-09-15 06:33:54 +00:00
}
2021-08-03 07:33:18 +00:00
}
}
}
throw new NullPointerException ( " Missing required view with ID: " . concat ( view . getResources ( ) . getResourceName ( i2 ) ) ) ;
}
public static final /* synthetic */ WidgetChannelsListAdapter access$getAdapter$p ( ItemChannelVoice itemChannelVoice ) {
return ( WidgetChannelsListAdapter ) itemChannelVoice . adapter ;
}
private final CharSequence getContentDescription ( ChannelListItemVoiceChannel channelListItemVoiceChannel , int i ) {
if ( i > 0 ) {
2021-11-02 06:38:17 +00:00
ConstraintLayout constraintLayout = this . binding . a ;
m . checkNotNullExpressionValue ( constraintLayout , " binding.root " ) ;
return b . j ( constraintLayout , R . string . guild_sidebar_voice_channel_a11y_label_with_limit , new Object [ ] { ChannelUtils . c ( channelListItemVoiceChannel . getChannel ( ) ) , Integer . valueOf ( channelListItemVoiceChannel . getNumUsersConnected ( ) ) , Integer . valueOf ( i ) } , null , 4 ) ;
2021-08-03 07:33:18 +00:00
} else if ( channelListItemVoiceChannel . getNumUsersConnected ( ) > 0 ) {
2021-11-02 06:38:17 +00:00
ConstraintLayout constraintLayout2 = this . binding . a ;
m . checkNotNullExpressionValue ( constraintLayout2 , " binding.root " ) ;
ConstraintLayout constraintLayout3 = this . binding . a ;
m . checkNotNullExpressionValue ( constraintLayout3 , " binding.root " ) ;
Context context = constraintLayout3 . getContext ( ) ;
2021-08-03 07:33:18 +00:00
m . checkNotNullExpressionValue ( context , " binding.root.context " ) ;
2021-11-02 06:38:17 +00:00
return b . j ( constraintLayout2 , R . string . guild_sidebar_voice_channel_a11y_label_with_users , new Object [ ] { ChannelUtils . c ( channelListItemVoiceChannel . getChannel ( ) ) , StringResourceUtilsKt . getI18nPluralString ( context , R . plurals . guild_sidebar_voice_channel_a11y_label_with_users_userCount , channelListItemVoiceChannel . getNumUsersConnected ( ) , Integer . valueOf ( channelListItemVoiceChannel . getNumUsersConnected ( ) ) ) } , null , 4 ) ;
2021-08-03 07:33:18 +00:00
} else {
2021-11-02 06:38:17 +00:00
ConstraintLayout constraintLayout4 = this . binding . a ;
m . checkNotNullExpressionValue ( constraintLayout4 , " binding.root " ) ;
return b . j ( constraintLayout4 , R . string . guild_sidebar_voice_channel_a11y_label , new Object [ ] { ChannelUtils . c ( channelListItemVoiceChannel . getChannel ( ) ) } , null , 4 ) ;
2021-08-03 07:33:18 +00:00
}
}
@SuppressLint ( { " SetTextI18n " } )
public void onConfigure ( int i , ChannelListItem channelListItem ) {
2021-11-02 06:38:17 +00:00
int i2 ;
2021-08-03 07:33:18 +00:00
m . checkNotNullParameter ( channelListItem , " data " ) ;
super . onConfigure ( i , ( int ) channelListItem ) ;
ChannelListItemVoiceChannel channelListItemVoiceChannel = ( ChannelListItemVoiceChannel ) channelListItem ;
Channel component1 = channelListItemVoiceChannel . component1 ( ) ;
boolean component2 = channelListItemVoiceChannel . component2 ( ) ;
2021-11-02 06:38:17 +00:00
boolean component3 = channelListItemVoiceChannel . component3 ( ) ;
Long component4 = channelListItemVoiceChannel . component4 ( ) ;
int component5 = channelListItemVoiceChannel . component5 ( ) ;
2021-08-03 07:33:18 +00:00
boolean component6 = channelListItemVoiceChannel . component6 ( ) ;
2021-11-02 06:38:17 +00:00
int component7 = channelListItemVoiceChannel . component7 ( ) ;
2021-10-20 06:51:20 +00:00
boolean component8 = channelListItemVoiceChannel . component8 ( ) ;
2021-11-02 06:38:17 +00:00
boolean component9 = channelListItemVoiceChannel . component9 ( ) ;
GuildMaxVideoChannelUsers component10 = channelListItemVoiceChannel . component10 ( ) ;
boolean component11 = channelListItemVoiceChannel . component11 ( ) ;
boolean component12 = channelListItemVoiceChannel . component12 ( ) ;
GuildScheduledEvent component13 = channelListItemVoiceChannel . component13 ( ) ;
boolean can = PermissionUtils . can ( Permission . CONNECT , component4 ) ;
2021-08-03 07:33:18 +00:00
Companion companion = Companion ;
View view = this . itemView ;
m . checkNotNullExpressionValue ( view , " itemView " ) ;
Context context = view . getContext ( ) ;
m . checkNotNullExpressionValue ( context , " itemView.context " ) ;
2021-11-02 06:38:17 +00:00
int access$getVoiceChannelColor = Companion . access$getVoiceChannelColor ( companion , component3 , context ) ;
this . binding . a . setOnClickListener ( new WidgetChannelsListAdapter$ItemChannelVoice$onConfigure$1 ( this , component11 , channelListItem ) ) ;
ConstraintLayout constraintLayout = this . binding . a ;
m . checkNotNullExpressionValue ( constraintLayout , " binding.root " ) ;
constraintLayout . setSelected ( component3 ) ;
ConstraintLayout constraintLayout2 = this . binding . a ;
m . checkNotNullExpressionValue ( constraintLayout2 , " binding.root " ) ;
setBackground ( constraintLayout2 , component3 , component1 ) ;
TextView textView = this . binding . f ;
2021-08-03 07:33:18 +00:00
m . checkNotNullExpressionValue ( textView , " binding.channelsItemVoiceChannelName " ) ;
2021-10-08 22:11:56 +00:00
textView . setText ( ChannelUtils . c ( component1 ) ) ;
2021-11-02 06:38:17 +00:00
this . binding . f . setTextColor ( access$getVoiceChannelColor ) ;
TextView textView2 = this . binding . d ;
2021-09-15 06:33:54 +00:00
m . checkNotNullExpressionValue ( textView2 , " binding.channelsItemVoiceChannelEventTopic " ) ;
2021-11-05 06:48:17 +00:00
ViewExtensions . setTextAndVisibilityBy ( textView2 , component13 ! = null ? component13 . i ( ) : null ) ;
2021-11-02 06:38:17 +00:00
TextView textView3 = this . binding . b ;
m . checkNotNullExpressionValue ( textView3 , " binding.channelsItemChannelMentions " ) ;
textView3 . setVisibility ( component5 > 0 ? 0 : 8 ) ;
TextView textView4 = this . binding . b ;
m . checkNotNullExpressionValue ( textView4 , " binding.channelsItemChannelMentions " ) ;
textView4 . setText ( String . valueOf ( Math . min ( 99 , component5 ) ) ) ;
2021-11-20 07:11:29 +00:00
ImageView imageView = this . binding . f1795c ;
2021-11-02 06:38:17 +00:00
m . checkNotNullExpressionValue ( imageView , " binding.channelsItemChannelUnread " ) ;
boolean z2 = true ;
imageView . setVisibility ( component6 & & ! component2 & & component3 ? 0 : 8 ) ;
ImageView imageView2 = this . binding . e ;
m . checkNotNullExpressionValue ( imageView2 , " binding.channelsItemVoic…GuildRoleSubscriptionIcon " ) ;
imageView2 . setVisibility ( component12 ? 0 : 8 ) ;
if ( component11 ) {
this . binding . e . setImageResource ( R . drawable . ic_premium_channel_locked ) ;
} else if ( component12 ) {
this . binding . e . setImageResource ( R . drawable . ic_premium_channel_unlocked ) ;
}
int i3 = ! can ? R . drawable . ic_channel_lock_16dp : component8 ? R . drawable . ic_channel_voice_locked : R . drawable . ic_channel_voice ;
if ( component13 ! = null ) {
2021-09-15 06:33:54 +00:00
View view2 = this . itemView ;
m . checkNotNullExpressionValue ( view2 , " itemView " ) ;
2021-11-02 06:38:17 +00:00
i2 = ColorCompat . getColor ( view2 . getContext ( ) , ( int ) R . color . status_green_600 ) ;
} else {
i2 = access$getVoiceChannelColor ;
2021-08-03 07:33:18 +00:00
}
2021-11-02 06:38:17 +00:00
this . binding . g . setImageResource ( i3 ) ;
ImageView imageView3 = this . binding . g ;
m . checkNotNullExpressionValue ( imageView3 , " binding.channelsItemVoiceChannelSpeaker " ) ;
imageView3 . setImageTintList ( ColorStateList . valueOf ( i2 ) ) ;
GuildMaxVideoChannelUsers . Limited limited = ( GuildMaxVideoChannelUsers . Limited ) ( ! ( component10 instanceof GuildMaxVideoChannelUsers . Limited ) ? null : component10 ) ;
2021-08-03 07:33:18 +00:00
int a = limited ! = null ? limited . a ( ) : 0 ;
int min = Math . min ( component1 . B ( ) , a ) ;
if ( min > 0 ) {
2021-11-02 06:38:17 +00:00
boolean z3 = component9 & & min = = a ;
2021-08-03 07:33:18 +00:00
if ( ! z3 ) {
a = component1 . B ( ) ;
}
2021-11-02 06:38:17 +00:00
VoiceUserLimitView voiceUserLimitView = this . binding . h ;
2021-08-03 07:33:18 +00:00
m . checkNotNullExpressionValue ( voiceUserLimitView , " binding.channelsItemVoiceChannelUserLimit " ) ;
if ( a < = 0 | | ! can ) {
z2 = false ;
}
2021-11-02 06:38:17 +00:00
voiceUserLimitView . setVisibility ( z2 ? 0 : 8 ) ;
this . binding . h . a ( component7 , a , z3 ) ;
ConstraintLayout constraintLayout3 = this . binding . a ;
m . checkNotNullExpressionValue ( constraintLayout3 , " binding.root " ) ;
constraintLayout3 . setContentDescription ( getContentDescription ( channelListItemVoiceChannel , a ) ) ;
2021-08-03 07:33:18 +00:00
} else {
2021-11-02 06:38:17 +00:00
VoiceUserLimitView voiceUserLimitView2 = this . binding . h ;
2021-08-03 07:33:18 +00:00
m . checkNotNullExpressionValue ( voiceUserLimitView2 , " binding.channelsItemVoiceChannelUserLimit " ) ;
voiceUserLimitView2 . setVisibility ( 8 ) ;
2021-11-02 06:38:17 +00:00
ConstraintLayout constraintLayout4 = this . binding . a ;
m . checkNotNullExpressionValue ( constraintLayout4 , " binding.root " ) ;
constraintLayout4 . setContentDescription ( getContentDescription ( channelListItemVoiceChannel , min ) ) ;
}
if ( PermissionUtils . can ( 16 , component4 ) ) {
ConstraintLayout constraintLayout5 = this . binding . a ;
m . checkNotNullExpressionValue ( constraintLayout5 , " binding.root " ) ;
ViewExtensions . setOnLongClickListenerConsumeClick ( constraintLayout5 , new WidgetChannelsListAdapter$ItemChannelVoice$onConfigure$2 ( this , component1 ) ) ;
2021-08-03 07:33:18 +00:00
return ;
}
2021-11-02 06:38:17 +00:00
ConstraintLayout constraintLayout6 = this . binding . a ;
m . checkNotNullExpressionValue ( constraintLayout6 , " binding.root " ) ;
ViewExtensions . setOnLongClickListenerConsumeClick ( constraintLayout6 , WidgetChannelsListAdapter$ItemChannelVoice$onConfigure$3 . INSTANCE ) ;
2021-08-03 07:33:18 +00:00
}
}
2021-09-21 06:31:55 +00:00
/* compiled from: WidgetChannelsListAdapter.kt */
public static final class ItemGuildRoleSubscriptionsOverview extends Item {
private final WidgetChannelsListItemDirectoryBinding binding ;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ItemGuildRoleSubscriptionsOverview ( int i , WidgetChannelsListAdapter widgetChannelsListAdapter ) {
super ( i , widgetChannelsListAdapter ) ;
m . checkNotNullParameter ( widgetChannelsListAdapter , " adapter " ) ;
WidgetChannelsListItemDirectoryBinding a = WidgetChannelsListItemDirectoryBinding . a ( this . itemView ) ;
m . checkNotNullExpressionValue ( a , " WidgetChannelsListItemDi…oryBinding.bind(itemView) " ) ;
this . binding = a ;
}
public static final /* synthetic */ WidgetChannelsListAdapter access$getAdapter$p ( ItemGuildRoleSubscriptionsOverview itemGuildRoleSubscriptionsOverview ) {
return ( WidgetChannelsListAdapter ) itemGuildRoleSubscriptionsOverview . adapter ;
}
public void onConfigure ( int i , ChannelListItem channelListItem ) {
m . checkNotNullParameter ( channelListItem , " data " ) ;
super . onConfigure ( i , ( int ) channelListItem ) ;
LinearLayout linearLayout = this . binding . a ;
m . checkNotNullExpressionValue ( linearLayout , " binding.root " ) ;
Context context = linearLayout . getContext ( ) ;
m . checkNotNullExpressionValue ( context , " context " ) ;
int themedDrawableRes$default = DrawableCompat . getThemedDrawableRes$default ( context , ( int ) R . attr . drawable_overlay_channels , 0 , 2 , ( Object ) null ) ;
LinearLayout linearLayout2 = this . binding . a ;
m . checkNotNullExpressionValue ( linearLayout2 , " binding.root " ) ;
ViewExtensions . setBackgroundAndKeepPadding ( linearLayout2 , ContextCompat . getDrawable ( context , themedDrawableRes$default ) ) ;
2021-11-20 07:11:29 +00:00
this . binding . f1796c . setText ( R . string . guild_role_subscriptions_channel_label ) ;
2021-09-21 06:31:55 +00:00
this . binding . a . setOnClickListener ( new WidgetChannelsListAdapter$ItemGuildRoleSubscriptionsOverview$onConfigure$1 ( this ) ) ;
}
}
2021-08-03 07:33:18 +00:00
/* compiled from: WidgetChannelsListAdapter.kt */
public static final class ItemGuildScheduledEvents extends Item {
private final WidgetChannelsListItemGuildScheduledEventsBinding binding ;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ItemGuildScheduledEvents ( int i , WidgetChannelsListAdapter widgetChannelsListAdapter ) {
super ( i , widgetChannelsListAdapter ) ;
m . checkNotNullParameter ( widgetChannelsListAdapter , " adapter " ) ;
View view = this . itemView ;
2021-08-09 22:51:56 +00:00
int i2 = R . id . channels_list_item_guild_scheduled_event_count ;
TextView textView = ( TextView ) view . findViewById ( R . id . channels_list_item_guild_scheduled_event_count ) ;
2021-08-03 07:33:18 +00:00
if ( textView ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . channels_list_item_guild_scheduled_event_icon ;
ImageView imageView = ( ImageView ) view . findViewById ( R . id . channels_list_item_guild_scheduled_event_icon ) ;
2021-08-03 07:33:18 +00:00
if ( imageView ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . channels_list_item_guild_scheduled_event_label ;
TextView textView2 = ( TextView ) view . findViewById ( R . id . channels_list_item_guild_scheduled_event_label ) ;
2021-08-03 07:33:18 +00:00
if ( textView2 ! = null ) {
WidgetChannelsListItemGuildScheduledEventsBinding widgetChannelsListItemGuildScheduledEventsBinding = new WidgetChannelsListItemGuildScheduledEventsBinding ( ( ConstraintLayout ) view , textView , imageView , textView2 ) ;
m . checkNotNullExpressionValue ( widgetChannelsListItemGuildScheduledEventsBinding , " WidgetChannelsListItemGu…ntsBinding.bind(itemView) " ) ;
this . binding = widgetChannelsListItemGuildScheduledEventsBinding ;
return ;
}
}
}
throw new NullPointerException ( " Missing required view with ID: " . concat ( view . getResources ( ) . getResourceName ( i2 ) ) ) ;
}
public static final /* synthetic */ WidgetChannelsListAdapter access$getAdapter$p ( ItemGuildScheduledEvents itemGuildScheduledEvents ) {
return ( WidgetChannelsListAdapter ) itemGuildScheduledEvents . adapter ;
}
public void onConfigure ( int i , ChannelListItem channelListItem ) {
m . checkNotNullParameter ( channelListItem , " data " ) ;
super . onConfigure ( i , ( int ) channelListItem ) ;
ChannelListItemGuildScheduledEvents channelListItemGuildScheduledEvents = ( ChannelListItemGuildScheduledEvents ) channelListItem ;
2021-09-22 06:37:51 +00:00
View view = this . itemView ;
m . checkNotNullExpressionValue ( view , " itemView " ) ;
Context context = view . getContext ( ) ;
2021-08-03 07:33:18 +00:00
TextView textView = this . binding . b ;
m . checkNotNullExpressionValue ( textView , " binding.channelsListItemGuildScheduledEventCount " ) ;
2021-08-10 21:19:22 +00:00
textView . setVisibility ( channelListItemGuildScheduledEvents . getData ( ) . isEmpty ( ) ^ true ? 0 : 8 ) ;
TextView textView2 = this . binding . b ;
m . checkNotNullExpressionValue ( textView2 , " binding.channelsListItemGuildScheduledEventCount " ) ;
textView2 . setText ( String . valueOf ( channelListItemGuildScheduledEvents . getData ( ) . size ( ) ) ) ;
2021-09-18 07:43:22 +00:00
ConstraintLayout constraintLayout = this . binding . a ;
m . checkNotNullExpressionValue ( constraintLayout , " binding.root " ) ;
2021-09-22 06:37:51 +00:00
m . checkNotNullExpressionValue ( context , " context " ) ;
ViewExtensions . setBackgroundAndKeepPadding ( constraintLayout , ContextCompat . getDrawable ( context , DrawableCompat . getThemedDrawableRes$default ( context , ( int ) R . attr . drawable_overlay_channels , 0 , 2 , ( Object ) null ) ) ) ;
2021-08-03 07:33:18 +00:00
this . binding . a . setOnClickListener ( new WidgetChannelsListAdapter$ItemGuildScheduledEvents$onConfigure$1 ( this , channelListItemGuildScheduledEvents ) ) ;
}
}
/* compiled from: WidgetChannelsListAdapter.kt */
public static final class ItemHeader extends Item {
private final WidgetChannelsListItemHeaderBinding binding ;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ItemHeader ( int i , WidgetChannelsListAdapter widgetChannelsListAdapter ) {
super ( i , widgetChannelsListAdapter ) ;
m . checkNotNullParameter ( widgetChannelsListAdapter , " adapter " ) ;
View view = this . itemView ;
2021-08-09 22:51:56 +00:00
int i2 = R . id . channels_list_item_header ;
TextView textView = ( TextView ) view . findViewById ( R . id . channels_list_item_header ) ;
2021-08-03 07:33:18 +00:00
if ( textView ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . channels_list_new ;
ImageView imageView = ( ImageView ) view . findViewById ( R . id . channels_list_new ) ;
2021-08-03 07:33:18 +00:00
if ( imageView ! = null ) {
WidgetChannelsListItemHeaderBinding widgetChannelsListItemHeaderBinding = new WidgetChannelsListItemHeaderBinding ( ( RelativeLayout ) view , textView , imageView ) ;
m . checkNotNullExpressionValue ( widgetChannelsListItemHeaderBinding , " WidgetChannelsListItemHeaderBinding.bind(itemView) " ) ;
this . binding = widgetChannelsListItemHeaderBinding ;
return ;
}
}
throw new NullPointerException ( " Missing required view with ID: " . concat ( view . getResources ( ) . getResourceName ( i2 ) ) ) ;
}
public void onConfigure ( int i , ChannelListItem channelListItem ) {
m . checkNotNullParameter ( channelListItem , " data " ) ;
super . onConfigure ( i , ( int ) channelListItem ) ;
ChannelListItemHeader channelListItemHeader = ( ChannelListItemHeader ) channelListItem ;
int component2 = channelListItemHeader . component2 ( ) ;
boolean component3 = channelListItemHeader . component3 ( ) ;
long component4 = channelListItemHeader . component4 ( ) ;
if ( ! component3 ) {
2021-11-20 07:11:29 +00:00
ImageView imageView = this . binding . f1797c ;
2021-08-03 07:33:18 +00:00
m . checkNotNullExpressionValue ( imageView , " binding.channelsListNew " ) ;
imageView . setVisibility ( 4 ) ;
2021-11-20 07:11:29 +00:00
this . binding . f1797c . setOnClickListener ( null ) ;
2021-08-09 22:51:56 +00:00
} else if ( component2 = = R . string . others_online ) {
2021-11-20 07:11:29 +00:00
ImageView imageView2 = this . binding . f1797c ;
2021-08-03 07:33:18 +00:00
m . checkNotNullExpressionValue ( imageView2 , " binding.channelsListNew " ) ;
imageView2 . setVisibility ( 4 ) ;
2021-11-20 07:11:29 +00:00
this . binding . f1797c . setOnClickListener ( null ) ;
2021-08-09 22:51:56 +00:00
} else if ( component2 = = R . string . text_channels ) {
2021-11-20 07:11:29 +00:00
ImageView imageView3 = this . binding . f1797c ;
2021-08-03 07:33:18 +00:00
m . checkNotNullExpressionValue ( imageView3 , " binding.channelsListNew " ) ;
imageView3 . setVisibility ( 0 ) ;
2021-11-20 07:11:29 +00:00
this . binding . f1797c . setOnClickListener ( new WidgetChannelsListAdapter$ItemHeader$onConfigure$1 ( component4 ) ) ;
2021-08-09 22:51:56 +00:00
} else if ( component2 = = R . string . voice_channels ) {
2021-11-20 07:11:29 +00:00
ImageView imageView4 = this . binding . f1797c ;
2021-08-03 07:33:18 +00:00
m . checkNotNullExpressionValue ( imageView4 , " binding.channelsListNew " ) ;
imageView4 . setVisibility ( 0 ) ;
2021-11-20 07:11:29 +00:00
this . binding . f1797c . setOnClickListener ( new WidgetChannelsListAdapter$ItemHeader$onConfigure$2 ( component4 ) ) ;
2021-08-03 07:33:18 +00:00
}
this . binding . b . setText ( component2 ) ;
}
}
/* compiled from: WidgetChannelsListAdapter.kt */
public static final class ItemInvite extends Item {
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ItemInvite ( int i , WidgetChannelsListAdapter widgetChannelsListAdapter ) {
super ( i , widgetChannelsListAdapter ) ;
m . checkNotNullParameter ( widgetChannelsListAdapter , " adapter " ) ;
}
public static final /* synthetic */ WidgetChannelsListAdapter access$getAdapter$p ( ItemInvite itemInvite ) {
return ( WidgetChannelsListAdapter ) itemInvite . adapter ;
}
public void onConfigure ( int i , ChannelListItem channelListItem ) {
m . checkNotNullParameter ( channelListItem , " data " ) ;
super . onConfigure ( i , ( int ) channelListItem ) ;
if ( channelListItem instanceof ChannelListItemInvite ) {
this . itemView . setOnClickListener ( new WidgetChannelsListAdapter$ItemInvite$onConfigure$1 ( this , channelListItem ) ) ;
View view = this . itemView ;
m . checkNotNullExpressionValue ( view , " itemView " ) ;
ViewExtensions . setOnLongClickListenerConsumeClick ( view , new WidgetChannelsListAdapter$ItemInvite$onConfigure$2 ( this ) ) ;
if ( ( ( ChannelListItemInvite ) channelListItem ) . isHub ( ) ) {
WidgetChannelsListItemDirectoryBinding a = WidgetChannelsListItemDirectoryBinding . a ( this . itemView ) ;
m . checkNotNullExpressionValue ( a , " WidgetChannelsListItemDi…oryBinding.bind(itemView) " ) ;
2021-11-20 07:11:29 +00:00
a . f1796c . setText ( R . string . invite_a_friend ) ;
2021-08-09 22:51:56 +00:00
a . b . setImageResource ( R . drawable . ic_guild_invite_24dp ) ;
2021-08-03 07:33:18 +00:00
}
}
}
}
/* compiled from: WidgetChannelsListAdapter.kt */
public static final class ItemMFA extends MGRecyclerViewHolder < WidgetChannelsListAdapter , ChannelListItem > {
private final WidgetChannelsListItemMfaBinding binding ;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ItemMFA ( @LayoutRes int i , WidgetChannelsListAdapter widgetChannelsListAdapter ) {
super ( i , widgetChannelsListAdapter ) ;
m . checkNotNullParameter ( widgetChannelsListAdapter , " adapter " ) ;
View view = this . itemView ;
2021-08-09 22:51:56 +00:00
LinkifiedTextView linkifiedTextView = ( LinkifiedTextView ) view . findViewById ( R . id . channels_list_item_mfa_text ) ;
2021-08-03 07:33:18 +00:00
if ( linkifiedTextView ! = null ) {
WidgetChannelsListItemMfaBinding widgetChannelsListItemMfaBinding = new WidgetChannelsListItemMfaBinding ( ( LinearLayout ) view , linkifiedTextView ) ;
m . checkNotNullExpressionValue ( widgetChannelsListItemMfaBinding , " WidgetChannelsListItemMfaBinding.bind(itemView) " ) ;
this . binding = widgetChannelsListItemMfaBinding ;
return ;
}
2021-08-09 22:51:56 +00:00
throw new NullPointerException ( " Missing required view with ID: " . concat ( view . getResources ( ) . getResourceName ( R . id . channels_list_item_mfa_text ) ) ) ;
2021-08-03 07:33:18 +00:00
}
public void onConfigure ( int i , ChannelListItem channelListItem ) {
m . checkNotNullParameter ( channelListItem , " data " ) ;
super . onConfigure ( i , ( int ) channelListItem ) ;
LinkifiedTextView linkifiedTextView = this . binding . b ;
m . checkNotNullExpressionValue ( linkifiedTextView , " binding.channelsListItemMfaText " ) ;
2021-08-09 22:51:56 +00:00
b . m ( linkifiedTextView , R . string . two_fa_guild_mfa_warning , new Object [ 0 ] , WidgetChannelsListAdapter$ItemMFA$onConfigure$1 . INSTANCE ) ;
2021-08-03 07:33:18 +00:00
}
}
/* compiled from: WidgetChannelsListAdapter.kt */
public static final class ItemSpace extends MGRecyclerViewHolder < WidgetChannelsListAdapter , ChannelListItem > {
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ItemSpace ( @LayoutRes int i , WidgetChannelsListAdapter widgetChannelsListAdapter ) {
super ( i , widgetChannelsListAdapter ) ;
m . checkNotNullParameter ( widgetChannelsListAdapter , " adapter " ) ;
}
public void onConfigure ( int i , ChannelListItem channelListItem ) {
m . checkNotNullParameter ( channelListItem , " data " ) ;
super . onConfigure ( i , ( int ) channelListItem ) ;
View view = this . itemView ;
m . checkNotNullExpressionValue ( view , " itemView " ) ;
ViewGroup . LayoutParams layoutParams = view . getLayoutParams ( ) ;
layoutParams . height = WidgetChannelsListAdapter . access$getBottomNavHeight$p ( ( WidgetChannelsListAdapter ) this . adapter ) ;
View view2 = this . itemView ;
m . checkNotNullExpressionValue ( view2 , " itemView " ) ;
view2 . setLayoutParams ( layoutParams ) ;
}
}
/* compiled from: WidgetChannelsListAdapter.kt */
public static final class ItemStageActiveEvent extends Item {
2021-09-14 06:27:26 +00:00
private final WidgetChannelsListItemActiveEventBinding binding ;
2021-08-03 07:33:18 +00:00
/* compiled from: WidgetChannelsListAdapter.kt */
/* renamed from: com.discord.widgets.channels.list.WidgetChannelsListAdapter$ItemStageActiveEvent$1 reason: invalid class name */
public static final class AnonymousClass1 implements View . OnClickListener {
public final /* synthetic */ WidgetChannelsListAdapter $adapter ;
public final /* synthetic */ ItemStageActiveEvent this $0 ;
public AnonymousClass1 ( ItemStageActiveEvent itemStageActiveEvent , WidgetChannelsListAdapter widgetChannelsListAdapter ) {
this . this$0 = itemStageActiveEvent ;
this . $adapter = widgetChannelsListAdapter ;
}
@Override // android.view.View.OnClickListener
public final void onClick ( View view ) {
2021-09-24 06:27:57 +00:00
GuildScheduledEventLocationInfo . ChannelLocation channelLocation ;
2021-08-03 07:33:18 +00:00
Channel channel ;
if ( this . this$0 . getAdapterPosition ( ) ! = - 1 ) {
ChannelListItem item = this . $adapter . getItem ( this . this$0 . getAdapterPosition ( ) ) ;
2021-09-14 06:27:26 +00:00
if ( ! ( item instanceof ChannelListItemActiveEvent ) ) {
2021-08-03 07:33:18 +00:00
item = null ;
}
2021-09-14 06:27:26 +00:00
ChannelListItemActiveEvent channelListItemActiveEvent = ( ChannelListItemActiveEvent ) item ;
2021-09-24 06:27:57 +00:00
if ( channelListItemActiveEvent ! = null ) {
GuildScheduledEventLocationInfo locationInfo = channelListItemActiveEvent . getData ( ) . getLocationInfo ( ) ;
2021-11-10 07:31:25 +00:00
if ( ( locationInfo instanceof GuildScheduledEventLocationInfo . ChannelLocation ) & & ( channel = ( channelLocation = ( GuildScheduledEventLocationInfo . ChannelLocation ) locationInfo ) . getChannel ( ) ) ! = null & & ChannelUtils . t ( channel ) ) {
2021-09-24 06:27:57 +00:00
this . $adapter . getOnCallChannel ( ) . invoke ( channelLocation . getChannel ( ) ) ;
} else if ( ( locationInfo instanceof GuildScheduledEventLocationInfo . ExternalLocation ) & & channelListItemActiveEvent . getData ( ) . getEventId ( ) ! = null ) {
WidgetGuildScheduledEventDetailsBottomSheet . Companion . show ( WidgetChannelsListAdapter . access$getFragmentManager$p ( this . $adapter ) , channelListItemActiveEvent . getData ( ) . getEventId ( ) . longValue ( ) ) ;
}
2021-08-03 07:33:18 +00:00
}
}
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ItemStageActiveEvent ( int i , WidgetChannelsListAdapter widgetChannelsListAdapter ) {
super ( i , widgetChannelsListAdapter ) ;
m . checkNotNullParameter ( widgetChannelsListAdapter , " adapter " ) ;
View view = this . itemView ;
2021-08-09 22:51:56 +00:00
int i2 = R . id . channel_separator ;
ImageView imageView = ( ImageView ) view . findViewById ( R . id . channel_separator ) ;
2021-08-03 07:33:18 +00:00
if ( imageView ! = null ) {
2021-09-14 06:27:26 +00:00
i2 = R . id . event_channel ;
TextView textView = ( TextView ) view . findViewById ( R . id . event_channel ) ;
if ( textView ! = null ) {
i2 = R . id . event_connect_button ;
MaterialButton materialButton = ( MaterialButton ) view . findViewById ( R . id . event_connect_button ) ;
if ( materialButton ! = null ) {
i2 = R . id . event_topic ;
TextView textView2 = ( TextView ) view . findViewById ( R . id . event_topic ) ;
2021-08-03 07:33:18 +00:00
if ( textView2 ! = null ) {
2021-09-14 06:27:26 +00:00
i2 = R . id . live_now_dot ;
ImageView imageView2 = ( ImageView ) view . findViewById ( R . id . live_now_dot ) ;
if ( imageView2 ! = null ) {
i2 = R . id . live_now_label ;
TextView textView3 = ( TextView ) view . findViewById ( R . id . live_now_label ) ;
2021-08-03 07:33:18 +00:00
if ( textView3 ! = null ) {
2021-09-14 06:27:26 +00:00
i2 = R . id . stage_event_listeners ;
TextView textView4 = ( TextView ) view . findViewById ( R . id . stage_event_listeners ) ;
2021-08-03 07:33:18 +00:00
if ( textView4 ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . user_summary ;
UserSummaryView userSummaryView = ( UserSummaryView ) view . findViewById ( R . id . user_summary ) ;
2021-08-03 07:33:18 +00:00
if ( userSummaryView ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . user_summary_label ;
MaterialTextView materialTextView = ( MaterialTextView ) view . findViewById ( R . id . user_summary_label ) ;
2021-08-03 07:33:18 +00:00
if ( materialTextView ! = null ) {
2021-09-14 06:27:26 +00:00
WidgetChannelsListItemActiveEventBinding widgetChannelsListItemActiveEventBinding = new WidgetChannelsListItemActiveEventBinding ( ( ConstraintLayout ) view , imageView , textView , materialButton , textView2 , imageView2 , textView3 , textView4 , userSummaryView , materialTextView ) ;
m . checkNotNullExpressionValue ( widgetChannelsListItemActiveEventBinding , " WidgetChannelsListItemAc…entBinding.bind(itemView) " ) ;
this . binding = widgetChannelsListItemActiveEventBinding ;
2021-08-03 07:33:18 +00:00
materialButton . setOnClickListener ( new AnonymousClass1 ( this , widgetChannelsListAdapter ) ) ;
return ;
}
}
}
}
}
}
}
}
}
throw new NullPointerException ( " Missing required view with ID: " . concat ( view . getResources ( ) . getResourceName ( i2 ) ) ) ;
}
2021-09-24 06:27:57 +00:00
/ * JADX WARNING : Code restructure failed : missing block : B : 28 : 0x00a1 , code lost :
if ( r14 ! = null ) goto L_0x00ac ;
* /
2021-08-03 07:33:18 +00:00
public void onConfigure ( int i , ChannelListItem channelListItem ) {
2021-09-24 06:27:57 +00:00
String str ;
2021-08-03 07:33:18 +00:00
CharSequence charSequence ;
m . checkNotNullParameter ( channelListItem , " data " ) ;
super . onConfigure ( i , ( int ) channelListItem ) ;
2021-09-14 06:27:26 +00:00
ChannelListItemActiveEventData data = ( ( ChannelListItemActiveEvent ) channelListItem ) . getData ( ) ;
2021-09-24 06:27:57 +00:00
GuildScheduledEventLocationInfo locationInfo = data . getLocationInfo ( ) ;
if ( ! ( locationInfo instanceof GuildScheduledEventLocationInfo . ChannelLocation ) ) {
locationInfo = null ;
}
GuildScheduledEventLocationInfo . ChannelLocation channelLocation = ( GuildScheduledEventLocationInfo . ChannelLocation ) locationInfo ;
Channel channel = channelLocation ! = null ? channelLocation . getChannel ( ) : null ;
2021-08-03 07:33:18 +00:00
int audienceSize = data . getAudienceSize ( ) ;
2021-09-24 06:27:57 +00:00
boolean z2 = channel ! = null & & channel . A ( ) = = 13 ;
int i2 = z2 ? R . drawable . ic_channel_stage_16dp : ( channel = = null | | channel . A ( ) ! = 2 ) ? R . drawable . ic_location_16dp : R . drawable . ic_channel_voice_16dp ;
2021-08-03 07:33:18 +00:00
ConstraintLayout constraintLayout = this . binding . a ;
m . checkNotNullExpressionValue ( constraintLayout , " binding.root " ) ;
2021-09-14 06:27:26 +00:00
Drawable drawable = ContextCompat . getDrawable ( constraintLayout . getContext ( ) , i2 ) ;
2021-09-24 06:27:57 +00:00
this . binding . f . setText ( data . getLocationInfo ( ) instanceof GuildScheduledEventLocationInfo . ExternalLocation ? R . string . live_event : R . string . stage_channel_live_now ) ;
2021-09-14 06:27:26 +00:00
TextView textView = this . binding . e ;
m . checkNotNullExpressionValue ( textView , " binding.eventTopic " ) ;
textView . setText ( data . getTopic ( ) ) ;
2021-11-20 07:11:29 +00:00
TextView textView2 = this . binding . f1790c ;
2021-09-14 06:27:26 +00:00
m . checkNotNullExpressionValue ( textView2 , " binding.eventChannel " ) ;
2021-09-24 06:27:57 +00:00
if ( channel ! = null ) {
ConstraintLayout constraintLayout2 = this . binding . a ;
m . checkNotNullExpressionValue ( constraintLayout2 , " binding.root " ) ;
Context context = constraintLayout2 . getContext ( ) ;
m . checkNotNullExpressionValue ( context , " binding.root.context " ) ;
2021-10-08 22:11:56 +00:00
str = ChannelUtils . e ( channel , context , false , 2 ) ;
2021-09-24 06:27:57 +00:00
}
str = data . getLocationInfo ( ) . getLocationName ( ) ;
textView2 . setText ( str ) ;
2021-11-20 07:11:29 +00:00
this . binding . f1790c . setCompoundDrawablesWithIntrinsicBounds ( drawable , ( Drawable ) null , ( Drawable ) null , ( Drawable ) null ) ;
2021-09-24 06:27:57 +00:00
TextView textView3 = this . binding . g ;
2021-08-03 07:33:18 +00:00
m . checkNotNullExpressionValue ( textView3 , " binding.stageEventListeners " ) ;
int i3 = 8 ;
2021-09-14 06:27:26 +00:00
textView3 . setVisibility ( z2 ? 0 : 8 ) ;
2021-09-24 06:27:57 +00:00
TextView textView4 = this . binding . g ;
2021-09-14 06:27:26 +00:00
m . checkNotNullExpressionValue ( textView4 , " binding.stageEventListeners " ) ;
b . n ( textView4 , R . string . listening_count , new Object [ ] { Integer . valueOf ( audienceSize ) } , null , 4 ) ;
ImageView imageView = this . binding . b ;
m . checkNotNullExpressionValue ( imageView , " binding.channelSeparator " ) ;
imageView . setVisibility ( z2 ? 0 : 8 ) ;
2021-09-24 06:27:57 +00:00
UserSummaryView userSummaryView = this . binding . h ;
2021-08-03 07:33:18 +00:00
userSummaryView . setVisibility ( data . getSpeakers ( ) . isEmpty ( ) ^ true ? 0 : 8 ) ;
if ( ! data . getSpeakers ( ) . isEmpty ( ) ) {
userSummaryView . setMembers ( data . getSpeakers ( ) ) ;
}
2021-09-24 06:27:57 +00:00
MaterialTextView materialTextView = this . binding . i ;
2021-08-03 07:33:18 +00:00
if ( ! data . getSpeakers ( ) . isEmpty ( ) ) {
i3 = 0 ;
}
materialTextView . setVisibility ( i3 ) ;
if ( ! data . getSpeakers ( ) . isEmpty ( ) ) {
if ( data . getSpeakers ( ) . size ( ) ! = 1 ) {
Context context2 = materialTextView . getContext ( ) ;
m . checkNotNullExpressionValue ( context2 , " context " ) ;
2021-08-09 22:51:56 +00:00
charSequence = b . j ( materialTextView , R . string . user_summary_with_others , new Object [ ] { data . getSpeakers ( ) . get ( 0 ) . getUser ( ) . getUsername ( ) , StringResourceUtilsKt . getI18nPluralString ( context2 , R . plurals . user_summary_with_others_count , data . getSpeakers ( ) . size ( ) - 1 , Integer . valueOf ( data . getSpeakers ( ) . size ( ) - 1 ) ) } , null , 4 ) ;
2021-08-03 07:33:18 +00:00
} else {
charSequence = data . getSpeakers ( ) . get ( 0 ) . getUser ( ) . getUsername ( ) ;
}
materialTextView . setText ( charSequence ) ;
}
2021-09-24 06:27:57 +00:00
this . binding . d . setText ( data . getLocationInfo ( ) instanceof GuildScheduledEventLocationInfo . ExternalLocation ? R . string . guild_event_see_detail : ! z2 ? R . string . join : R . string . stage_channel_join_button ) ;
2021-08-03 07:33:18 +00:00
}
}
/* compiled from: WidgetChannelsListAdapter.kt */
public static final class ItemStageChannelAudienceCount extends Item {
private final WidgetChannelsListItemAudienceCountBinding binding ;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ItemStageChannelAudienceCount ( int i , WidgetChannelsListAdapter widgetChannelsListAdapter ) {
super ( i , widgetChannelsListAdapter ) ;
m . checkNotNullParameter ( widgetChannelsListAdapter , " adapter " ) ;
View view = this . itemView ;
2021-08-09 22:51:56 +00:00
int i2 = R . id . stage_channel_audience_icon ;
ImageView imageView = ( ImageView ) view . findViewById ( R . id . stage_channel_audience_icon ) ;
2021-08-03 07:33:18 +00:00
if ( imageView ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . stage_channels_audience_count ;
TextView textView = ( TextView ) view . findViewById ( R . id . stage_channels_audience_count ) ;
2021-08-03 07:33:18 +00:00
if ( textView ! = null ) {
WidgetChannelsListItemAudienceCountBinding widgetChannelsListItemAudienceCountBinding = new WidgetChannelsListItemAudienceCountBinding ( ( RelativeLayout ) view , imageView , textView ) ;
m . checkNotNullExpressionValue ( widgetChannelsListItemAudienceCountBinding , " WidgetChannelsListItemAu…untBinding.bind(itemView) " ) ;
this . binding = widgetChannelsListItemAudienceCountBinding ;
return ;
}
}
throw new NullPointerException ( " Missing required view with ID: " . concat ( view . getResources ( ) . getResourceName ( i2 ) ) ) ;
}
public void onConfigure ( int i , ChannelListItem channelListItem ) {
m . checkNotNullParameter ( channelListItem , " data " ) ;
super . onConfigure ( i , ( int ) channelListItem ) ;
ChannelListItemStageAudienceCount channelListItemStageAudienceCount = ( ChannelListItemStageAudienceCount ) channelListItem ;
TextView textView = this . binding . b ;
if ( channelListItemStageAudienceCount . getAudienceSize ( ) ! = 0 ) {
2021-08-09 22:51:56 +00:00
b . n ( textView , R . string . stage_channel_audience_count , new Object [ ] { Integer . valueOf ( channelListItemStageAudienceCount . getAudienceSize ( ) ) } , null , 4 ) ;
2021-08-03 07:33:18 +00:00
} else {
2021-08-09 22:51:56 +00:00
textView . setText ( R . string . stage_channel_no_audience ) ;
2021-08-03 07:33:18 +00:00
}
}
}
/* compiled from: WidgetChannelsListAdapter.kt */
public static final class ItemVoiceUser extends Item {
private final WidgetChannelsListItemVoiceUserBinding binding ;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ItemVoiceUser ( int i , WidgetChannelsListAdapter widgetChannelsListAdapter ) {
super ( i , widgetChannelsListAdapter ) ;
m . checkNotNullParameter ( widgetChannelsListAdapter , " adapter " ) ;
View view = this . itemView ;
2021-08-09 22:51:56 +00:00
int i2 = R . id . channels_item_voice_user_avatar ;
SimpleDraweeView simpleDraweeView = ( SimpleDraweeView ) view . findViewById ( R . id . channels_item_voice_user_avatar ) ;
2021-08-03 07:33:18 +00:00
if ( simpleDraweeView ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . channels_item_voice_user_camera ;
ImageView imageView = ( ImageView ) view . findViewById ( R . id . channels_item_voice_user_camera ) ;
2021-08-03 07:33:18 +00:00
if ( imageView ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . channels_item_voice_user_headphones ;
ImageView imageView2 = ( ImageView ) view . findViewById ( R . id . channels_item_voice_user_headphones ) ;
2021-08-03 07:33:18 +00:00
if ( imageView2 ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . channels_item_voice_user_live ;
TextView textView = ( TextView ) view . findViewById ( R . id . channels_item_voice_user_live ) ;
2021-08-03 07:33:18 +00:00
if ( textView ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . channels_item_voice_user_microphone ;
ImageView imageView3 = ( ImageView ) view . findViewById ( R . id . channels_item_voice_user_microphone ) ;
2021-08-03 07:33:18 +00:00
if ( imageView3 ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . channels_item_voice_user_name ;
TextView textView2 = ( TextView ) view . findViewById ( R . id . channels_item_voice_user_name ) ;
2021-08-03 07:33:18 +00:00
if ( textView2 ! = null ) {
2021-08-09 22:51:56 +00:00
i2 = R . id . indicators_container ;
LinearLayout linearLayout = ( LinearLayout ) view . findViewById ( R . id . indicators_container ) ;
2021-08-03 07:33:18 +00:00
if ( linearLayout ! = null ) {
WidgetChannelsListItemVoiceUserBinding widgetChannelsListItemVoiceUserBinding = new WidgetChannelsListItemVoiceUserBinding ( ( RelativeLayout ) view , simpleDraweeView , imageView , imageView2 , textView , imageView3 , textView2 , linearLayout ) ;
m . checkNotNullExpressionValue ( widgetChannelsListItemVoiceUserBinding , " WidgetChannelsListItemVo…serBinding.bind(itemView) " ) ;
this . binding = widgetChannelsListItemVoiceUserBinding ;
return ;
}
}
}
}
}
}
}
throw new NullPointerException ( " Missing required view with ID: " . concat ( view . getResources ( ) . getResourceName ( i2 ) ) ) ;
}
public static final /* synthetic */ WidgetChannelsListAdapter access$getAdapter$p ( ItemVoiceUser itemVoiceUser ) {
return ( WidgetChannelsListAdapter ) itemVoiceUser . adapter ;
}
public void onConfigure ( int i , ChannelListItem channelListItem ) {
m . checkNotNullParameter ( channelListItem , " data " ) ;
super . onConfigure ( i , ( int ) channelListItem ) ;
ChannelListItemVoiceUser channelListItemVoiceUser = ( ChannelListItemVoiceUser ) channelListItem ;
Channel component1 = channelListItemVoiceUser . component1 ( ) ;
VoiceState component2 = channelListItemVoiceUser . component2 ( ) ;
User component3 = channelListItemVoiceUser . component3 ( ) ;
GuildMember component4 = channelListItemVoiceUser . component4 ( ) ;
boolean component5 = channelListItemVoiceUser . component5 ( ) ;
boolean component6 = channelListItemVoiceUser . component6 ( ) ;
SimpleDraweeView simpleDraweeView = this . binding . b ;
m . checkNotNullExpressionValue ( simpleDraweeView , " binding.channelsItemVoiceUserAvatar " ) ;
2021-08-09 22:51:56 +00:00
IconUtils . setIcon$default ( simpleDraweeView , component3 , R . dimen . avatar_size_small , null , null , channelListItemVoiceUser . getComputed ( ) , 24 , null ) ;
2021-08-03 07:33:18 +00:00
RelativeLayout relativeLayout = this . binding . a ;
m . checkNotNullExpressionValue ( relativeLayout , " binding.root " ) ;
ViewExtensions . setOnLongClickListenerConsumeClick ( relativeLayout , new WidgetChannelsListAdapter$ItemVoiceUser$onConfigure$1 ( this , channelListItem ) ) ;
this . binding . a . setOnClickListener ( new WidgetChannelsListAdapter$ItemVoiceUser$onConfigure$2 ( this , channelListItem ) ) ;
TextView textView = this . binding . g ;
m . checkNotNullExpressionValue ( textView , " binding.channelsItemVoiceUserName " ) ;
textView . setText ( GuildMember . Companion . getNickOrUsername$default ( GuildMember . Companion , component3 , component4 , component1 , null , 8 , null ) ) ;
2021-11-20 07:11:29 +00:00
ImageView imageView = this . binding . f1800c ;
2021-08-03 07:33:18 +00:00
m . checkNotNullExpressionValue ( imageView , " binding.channelsItemVoiceUserCamera " ) ;
int i2 = 8 ;
imageView . setVisibility ( component2 . j ( ) ? 0 : 8 ) ;
ImageView imageView2 = this . binding . f ;
m . checkNotNullExpressionValue ( imageView2 , " binding.channelsItemVoiceUserMicrophone " ) ;
2021-11-05 06:48:17 +00:00
imageView2 . setVisibility ( d . U0 ( component2 ) ? 0 : 8 ) ;
2021-08-03 07:33:18 +00:00
ImageView imageView3 = this . binding . d ;
m . checkNotNullExpressionValue ( imageView3 , " binding.channelsItemVoiceUserHeadphones " ) ;
boolean z2 = true ;
imageView3 . setVisibility ( component2 . g ( ) | | component2 . b ( ) ? 0 : 8 ) ;
TextView textView2 = this . binding . e ;
m . checkNotNullExpressionValue ( textView2 , " binding.channelsItemVoiceUserLive " ) ;
if ( ! component5 | | ! component6 ) {
z2 = false ;
}
if ( z2 ) {
i2 = 0 ;
}
textView2 . setVisibility ( i2 ) ;
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public WidgetChannelsListAdapter ( RecyclerView recyclerView , FragmentManager fragmentManager ) {
super ( recyclerView , false , 2 , null ) ;
m . checkNotNullParameter ( recyclerView , " recycler " ) ;
m . checkNotNullParameter ( fragmentManager , " fragmentManager " ) ;
this . fragmentManager = fragmentManager ;
}
public static final /* synthetic */ int access$getBottomNavHeight$p ( WidgetChannelsListAdapter widgetChannelsListAdapter ) {
return widgetChannelsListAdapter . bottomNavHeight ;
}
public static final /* synthetic */ FragmentManager access$getFragmentManager$p ( WidgetChannelsListAdapter widgetChannelsListAdapter ) {
return widgetChannelsListAdapter . fragmentManager ;
}
public static final /* synthetic */ void access$setBottomNavHeight$p ( WidgetChannelsListAdapter widgetChannelsListAdapter , int i ) {
widgetChannelsListAdapter . bottomNavHeight = i ;
}
public final Function0 < Unit > getOnAddServer ( ) {
return this . onAddServer ;
}
/* JADX DEBUG: Type inference failed for r0v0. Raw type applied. Possible types: kotlin.jvm.functions.Function1<? super com.discord.api.channel.Channel, kotlin.Unit>, kotlin.jvm.functions.Function1<com.discord.api.channel.Channel, kotlin.Unit> */
public final Function1 < Channel , Unit > getOnCallChannel ( ) {
return this . onCallChannel ;
}
/* JADX DEBUG: Type inference failed for r0v0. Raw type applied. Possible types: kotlin.jvm.functions.Function2<? super com.discord.api.channel.Channel, ? super java.lang.Boolean, kotlin.Unit>, kotlin.jvm.functions.Function2<com.discord.api.channel.Channel, java.lang.Boolean, kotlin.Unit> */
public final Function2 < Channel , Boolean , Unit > getOnCollapseCategory ( ) {
return this . onCollapseCategory ;
}
/* JADX DEBUG: Type inference failed for r0v0. Raw type applied. Possible types: kotlin.jvm.functions.Function1<? super com.discord.api.channel.Channel, kotlin.Unit>, kotlin.jvm.functions.Function1<com.discord.api.channel.Channel, kotlin.Unit> */
public final Function1 < Channel , Unit > getOnJoinStageChannel ( ) {
return this . onJoinStageChannel ;
}
/* JADX DEBUG: Type inference failed for r0v0. Raw type applied. Possible types: kotlin.jvm.functions.Function1<? super com.discord.api.channel.Channel, kotlin.Unit>, kotlin.jvm.functions.Function1<com.discord.api.channel.Channel, kotlin.Unit> */
public final Function1 < Channel , Unit > getOnSelectChannel ( ) {
return this . onSelectChannel ;
}
/* JADX DEBUG: Type inference failed for r0v0. Raw type applied. Possible types: kotlin.jvm.functions.Function1<? super com.discord.api.channel.Channel, kotlin.Unit>, kotlin.jvm.functions.Function1<com.discord.api.channel.Channel, kotlin.Unit> */
public final Function1 < Channel , Unit > getOnSelectChannelOptions ( ) {
return this . onSelectChannelOptions ;
}
2021-11-02 06:38:17 +00:00
/* JADX DEBUG: Type inference failed for r0v0. Raw type applied. Possible types: kotlin.jvm.functions.Function1<? super com.discord.api.channel.Channel, kotlin.Unit>, kotlin.jvm.functions.Function1<com.discord.api.channel.Channel, kotlin.Unit> */
public final Function1 < Channel , Unit > getOnSelectGuildRoleSubscriptionLockedChannel ( ) {
return this . onSelectGuildRoleSubscriptionLockedChannel ;
}
2021-08-03 07:33:18 +00:00
/* 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 > getOnSelectInvite ( ) {
return this . onSelectInvite ;
}
/* JADX DEBUG: Type inference failed for r0v0. Raw type applied. Possible types: kotlin.jvm.functions.Function2<? super com.discord.models.user.User, ? super com.discord.api.channel.Channel, kotlin.Unit>, kotlin.jvm.functions.Function2<com.discord.models.user.User, com.discord.api.channel.Channel, kotlin.Unit> */
public final Function2 < User , Channel , Unit > getOnSelectUserOptions ( ) {
return this . onSelectUserOptions ;
}
2021-09-21 06:31:55 +00:00
public final Function0 < Unit > getOnViewGuildRoleSubscriptions ( ) {
return this . onViewGuildRoleSubscriptions ;
}
2021-09-22 06:37:51 +00:00
/* JADX DEBUG: Type inference failed for r0v0. Raw type applied. Possible types: kotlin.jvm.functions.Function1<? super java.lang.Long, kotlin.Unit>, kotlin.jvm.functions.Function1<java.lang.Long, kotlin.Unit> */
public final Function1 < Long , Unit > getOnViewGuildScheduledEvents ( ) {
2021-08-03 07:33:18 +00:00
return this . onViewGuildScheduledEvents ;
}
public final long getSelectedGuildId ( ) {
return this . selectedGuildId ;
}
public final void handleBottomNavHeight ( int i ) {
this . bottomNavHeight = i ;
notifyItemChanged ( getInternalData ( ) . lastIndexOf ( new ChannelListBottomNavSpaceItem ( this . selectedGuildId ) ) ) ;
}
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
public MGRecyclerViewHolder < ? , ChannelListItem > onCreateViewHolder ( ViewGroup viewGroup , int i ) {
2021-09-21 06:31:55 +00:00
MGRecyclerViewHolder < ? , ChannelListItem > mGRecyclerViewHolder ;
2021-08-03 07:33:18 +00:00
m . checkNotNullParameter ( viewGroup , " parent " ) ;
switch ( i ) {
case 0 :
2021-08-09 22:51:56 +00:00
return new ItemChannelText ( R . layout . widget_channels_list_item_channel , this ) ;
2021-08-03 07:33:18 +00:00
case 1 :
2021-08-09 22:51:56 +00:00
return new ItemChannelVoice ( R . layout . widget_channels_list_item_channel_voice , this ) ;
2021-08-03 07:33:18 +00:00
case 2 :
2021-08-09 22:51:56 +00:00
return new ItemVoiceUser ( R . layout . widget_channels_list_item_voice_user , this ) ;
2021-08-03 07:33:18 +00:00
case 3 :
2021-08-09 22:51:56 +00:00
return new ItemChannelPrivate ( R . layout . widget_channels_list_item_channel_private , this ) ;
2021-08-03 07:33:18 +00:00
case 4 :
case 5 :
case 10 :
default :
throw invalidViewTypeException ( i ) ;
case 6 :
2021-08-09 22:51:56 +00:00
return new ItemHeader ( R . layout . widget_channels_list_item_header , this ) ;
2021-08-03 07:33:18 +00:00
case 7 :
2021-08-09 22:51:56 +00:00
return new ItemMFA ( R . layout . widget_channels_list_item_mfa , this ) ;
2021-08-03 07:33:18 +00:00
case 8 :
2021-08-09 22:51:56 +00:00
return new ItemChannelCategory ( R . layout . widget_channels_list_item_category , this ) ;
2021-08-03 07:33:18 +00:00
case 9 :
2021-08-09 22:51:56 +00:00
return new ItemInvite ( R . layout . widget_channels_list_item_invite , this ) ;
2021-08-03 07:33:18 +00:00
case 11 :
2021-08-09 22:51:56 +00:00
return new ItemSpace ( R . layout . recycler_item_bottom_nav_space , this ) ;
2021-08-03 07:33:18 +00:00
case 12 :
2021-08-09 22:51:56 +00:00
return new ItemChannelThread ( R . layout . widget_channels_list_item_thread , this ) ;
2021-08-03 07:33:18 +00:00
case 13 :
2021-08-09 22:51:56 +00:00
return new ItemChannelStageVoice ( R . layout . widget_channels_list_item_channel_stage_voice , this ) ;
2021-08-03 07:33:18 +00:00
case 14 :
2021-08-09 22:51:56 +00:00
return new MGRecyclerViewHolder < > ( ( int ) R . layout . widget_channels_list_item_stage_events_separator , this ) ;
2021-08-03 07:33:18 +00:00
case 15 :
2021-09-14 06:27:26 +00:00
return new ItemStageActiveEvent ( R . layout . widget_channels_list_item_active_event , this ) ;
2021-08-03 07:33:18 +00:00
case 16 :
2021-08-09 22:51:56 +00:00
return new ItemStageChannelAudienceCount ( R . layout . widget_channels_list_item_audience_count , this ) ;
2021-08-03 07:33:18 +00:00
case 17 :
2021-09-21 06:31:55 +00:00
mGRecyclerViewHolder = new ItemChannelDirectory ( R . layout . widget_channels_list_item_directory , this ) ;
break ;
2021-08-03 07:33:18 +00:00
case 18 :
2021-09-21 06:31:55 +00:00
mGRecyclerViewHolder = new ItemChannelAddServer ( R . layout . widget_channels_list_item_directory , this ) ;
break ;
2021-08-03 07:33:18 +00:00
case 19 :
2021-08-09 22:51:56 +00:00
return new ItemGuildScheduledEvents ( R . layout . widget_channels_list_item_guild_scheduled_events , this ) ;
2021-08-03 07:33:18 +00:00
case 20 :
2021-09-21 06:31:55 +00:00
mGRecyclerViewHolder = new ItemInvite ( R . layout . widget_channels_list_item_directory , this ) ;
break ;
case 21 :
return new ItemGuildRoleSubscriptionsOverview ( R . layout . widget_channels_list_item_guild_role_subs , this ) ;
2021-08-03 07:33:18 +00:00
}
2021-09-21 06:31:55 +00:00
return mGRecyclerViewHolder ;
2021-08-03 07:33:18 +00:00
}
public final void setOnAddServer ( Function0 < Unit > function0 ) {
m . checkNotNullParameter ( function0 , " <set-?> " ) ;
this . onAddServer = function0 ;
}
public final void setOnCallChannel ( Function1 < ? super Channel , Unit > function1 ) {
m . checkNotNullParameter ( function1 , " <set-?> " ) ;
this . onCallChannel = function1 ;
}
public final void setOnCollapseCategory ( Function2 < ? super Channel , ? super Boolean , Unit > function2 ) {
m . checkNotNullParameter ( function2 , " <set-?> " ) ;
this . onCollapseCategory = function2 ;
}
public final void setOnJoinStageChannel ( Function1 < ? super Channel , Unit > function1 ) {
m . checkNotNullParameter ( function1 , " <set-?> " ) ;
this . onJoinStageChannel = function1 ;
}
public final void setOnSelectChannel ( Function1 < ? super Channel , Unit > function1 ) {
m . checkNotNullParameter ( function1 , " <set-?> " ) ;
this . onSelectChannel = function1 ;
}
public final void setOnSelectChannelOptions ( Function1 < ? super Channel , Unit > function1 ) {
m . checkNotNullParameter ( function1 , " <set-?> " ) ;
this . onSelectChannelOptions = function1 ;
}
2021-11-02 06:38:17 +00:00
public final void setOnSelectGuildRoleSubscriptionLockedChannel ( Function1 < ? super Channel , Unit > function1 ) {
2021-08-03 07:33:18 +00:00
m . checkNotNullParameter ( function1 , " <set-?> " ) ;
2021-11-02 06:38:17 +00:00
this . onSelectGuildRoleSubscriptionLockedChannel = function1 ;
2021-08-03 07:33:18 +00:00
}
2021-11-02 06:38:17 +00:00
public final void setOnSelectInvite ( Function1 < ? super View , Unit > function1 ) {
2021-10-20 06:51:20 +00:00
m . checkNotNullParameter ( function1 , " <set-?> " ) ;
2021-11-02 06:38:17 +00:00
this . onSelectInvite = function1 ;
2021-10-20 06:51:20 +00:00
}
2021-08-03 07:33:18 +00:00
public final void setOnSelectUserOptions ( Function2 < ? super User , ? super Channel , Unit > function2 ) {
m . checkNotNullParameter ( function2 , " <set-?> " ) ;
this . onSelectUserOptions = function2 ;
}
2021-09-21 06:31:55 +00:00
public final void setOnViewGuildRoleSubscriptions ( Function0 < Unit > function0 ) {
m . checkNotNullParameter ( function0 , " <set-?> " ) ;
this . onViewGuildRoleSubscriptions = function0 ;
}
2021-09-22 06:37:51 +00:00
public final void setOnViewGuildScheduledEvents ( Function1 < ? super Long , Unit > function1 ) {
2021-08-03 07:33:18 +00:00
m . checkNotNullParameter ( function1 , " <set-?> " ) ;
this . onViewGuildScheduledEvents = function1 ;
}
public final void setSelectedGuildId ( long j ) {
this . selectedGuildId = j ;
}
}