|
|
|
@ -14,6 +14,7 @@ import org.mozilla.fenix.home.sessioncontrol.AdapterItem.TopSitePagerPayload
|
|
|
|
|
import org.mozilla.fenix.home.sessioncontrol.TopSiteInteractor
|
|
|
|
|
import org.mozilla.fenix.home.sessioncontrol.viewholders.TopSitePagerViewHolder.Companion.TOP_SITES_PER_PAGE
|
|
|
|
|
import org.mozilla.fenix.home.sessioncontrol.viewholders.TopSiteViewHolder
|
|
|
|
|
import java.lang.IndexOutOfBoundsException
|
|
|
|
|
|
|
|
|
|
class TopSitesPagerAdapter(
|
|
|
|
|
private val interactor: TopSiteInteractor
|
|
|
|
@ -30,6 +31,7 @@ class TopSitesPagerAdapter(
|
|
|
|
|
position: Int,
|
|
|
|
|
payloads: MutableList<Any>
|
|
|
|
|
) {
|
|
|
|
|
try {
|
|
|
|
|
if (payloads.isNullOrEmpty()) {
|
|
|
|
|
onBindViewHolder(holder, position)
|
|
|
|
|
} else {
|
|
|
|
@ -40,6 +42,9 @@ class TopSitesPagerAdapter(
|
|
|
|
|
update(payload, position, adapter)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (e: IndexOutOfBoundsException) {
|
|
|
|
|
// IDK where this comes from
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@VisibleForTesting
|
|
|
|
|