2021-08-20 05:39:29 +00:00
package com.discord.widgets.directories ;
import androidx.viewpager2.adapter.FragmentStateAdapter ;
import c.d.b.a.a ;
import com.airbnb.lottie.parser.AnimatableValueParser ;
import com.discord.app.AppFragment ;
import com.discord.models.hubs.DirectoryEntryCategory ;
import d0.t.n ;
import d0.t.u ;
import d0.z.d.m ;
import java.util.List ;
/* compiled from: WidgetDirectoryChannelViewPagerAdapter.kt */
public final class WidgetDirectoryChannelViewPagerAdapter extends FragmentStateAdapter {
private List < ? extends DirectoryEntryCategory > tabs = n . emptyList ( ) ;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public WidgetDirectoryChannelViewPagerAdapter ( AppFragment appFragment ) {
super ( appFragment ) ;
m . checkNotNullParameter ( appFragment , " fragment " ) ;
}
@Override // androidx.viewpager2.adapter.FragmentStateAdapter
public WidgetDirectoryCategory createFragment ( int i ) {
WidgetDirectoryCategory widgetDirectoryCategory = new WidgetDirectoryCategory ( ) ;
DirectoryEntryCategory directoryEntryCategory = ( DirectoryEntryCategory ) u . getOrNull ( this . tabs , i ) ;
if ( directoryEntryCategory ! = null ) {
2021-10-02 06:32:57 +00:00
widgetDirectoryCategory . setArguments ( AnimatableValueParser . H2 ( new DirectoryCategoryArgs ( directoryEntryCategory ) ) ) ;
2021-08-20 05:39:29 +00:00
return widgetDirectoryCategory ;
}
2021-08-28 06:29:07 +00:00
StringBuilder Q = a . Q ( " Couldn't find tab with position " , i , " in " ) ;
Q . append ( this . tabs ) ;
throw new IllegalStateException ( Q . toString ( ) ) ;
2021-08-20 05:39:29 +00:00
}
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
public int getItemCount ( ) {
return this . tabs . size ( ) ;
}
/* JADX DEBUG: Type inference failed for r0v0. Raw type applied. Possible types: java.util.List<? extends com.discord.models.hubs.DirectoryEntryCategory>, java.util.List<com.discord.models.hubs.DirectoryEntryCategory> */
public final List < DirectoryEntryCategory > getTabs ( ) {
return this . tabs ;
}
public final void setTabs ( List < ? extends DirectoryEntryCategory > list ) {
m . checkNotNullParameter ( list , " value " ) ;
this . tabs = list ;
notifyDataSetChanged ( ) ;
}
}