mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-08-02 22:30:40 +00:00
Placing reply comments works again.
This commit is contained in:
parent
aa570ac29d
commit
90a1cd8280
1 changed files with 8 additions and 3 deletions
|
@ -14,6 +14,7 @@ import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.futo.platformplayer.R
|
import com.futo.platformplayer.R
|
||||||
import com.futo.platformplayer.UIDialogs
|
import com.futo.platformplayer.UIDialogs
|
||||||
import com.futo.platformplayer.api.media.models.comments.IPlatformComment
|
import com.futo.platformplayer.api.media.models.comments.IPlatformComment
|
||||||
|
import com.futo.platformplayer.api.media.models.comments.LazyComment
|
||||||
import com.futo.platformplayer.api.media.models.comments.PolycentricPlatformComment
|
import com.futo.platformplayer.api.media.models.comments.PolycentricPlatformComment
|
||||||
import com.futo.platformplayer.api.media.models.video.IPlatformVideoDetails
|
import com.futo.platformplayer.api.media.models.video.IPlatformVideoDetails
|
||||||
import com.futo.platformplayer.api.media.structures.IAsyncPager
|
import com.futo.platformplayer.api.media.structures.IAsyncPager
|
||||||
|
@ -267,9 +268,13 @@ class CommentsList : ConstraintLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun replaceComment(c: PolycentricPlatformComment, newComment: PolycentricPlatformComment) {
|
fun replaceComment(c: PolycentricPlatformComment, newComment: PolycentricPlatformComment) {
|
||||||
val index = _comments.indexOf(c);
|
val index = _comments.indexOfFirst { it == c || (it is LazyComment && it.getUnderlyingComment() == c) };
|
||||||
_comments[index] = newComment;
|
if (index >= 0) {
|
||||||
_adapterComments.notifyItemChanged(_adapterComments.childToParentPosition(index));
|
_comments[index] = newComment;
|
||||||
|
_adapterComments.notifyItemChanged(_adapterComments.childToParentPosition(index));
|
||||||
|
} else {
|
||||||
|
Logger.w(TAG, "Parent comment not found")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue