Display thread header in CFv2.

This commit is contained in:
Cody Henthorne
2023-05-11 15:39:59 -04:00
committed by Greyson Parrelli
parent ffbbdc1576
commit 3ba128793a
26 changed files with 235 additions and 49 deletions

View File

@@ -4,6 +4,7 @@ import android.graphics.Canvas
import androidx.core.view.children
import androidx.recyclerview.widget.RecyclerView
import org.thoughtcrime.securesms.conversation.ConversationAdapter
import org.thoughtcrime.securesms.conversation.v2.ConversationAdapterV2
import kotlin.math.min
/**
@@ -28,7 +29,7 @@ class GiphyMp4ItemDecoration(
} else {
val footerViewHolder = parent.children
.map { parent.getChildViewHolder(it) }
.filterIsInstance(ConversationAdapter.FooterViewHolder::class.java)
.filter { it is ConversationAdapter.FooterViewHolder || it is ConversationAdapterV2.ThreadHeaderViewHolder }
.firstOrNull()
if (footerViewHolder == null) {

View File

@@ -66,7 +66,7 @@ final class GiphyMp4PagedDataSource implements PagedDataSource<String, GiphyImag
}
@Override
public @NonNull List<GiphyImage> load(int start, int length, @NonNull CancellationSignal cancellationSignal) {
public @NonNull List<GiphyImage> load(int start, int length, int totalSize, @NonNull CancellationSignal cancellationSignal) {
try {
Log.d(TAG, "Loading from " + start + " to " + (start + length));
return new LinkedList<>(performFetch(start, length).getData());