diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/SearchFragment.kt b/app/src/main/java/com/keylesspalace/tusky/fragment/SearchFragment.kt index 769bec9b8..ff40159d5 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/SearchFragment.kt +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/SearchFragment.kt @@ -236,7 +236,18 @@ class SearchFragment : SFragment(), StatusActionListener, Injectable { } override fun onContentCollapsedChange(isCollapsed: Boolean, position: Int) { - TODO("not implemented") + // TODO: No out-of-bounds check in getConcreteStatusAtPosition + val status = searchAdapter.getConcreteStatusAtPosition(position) + if(status == null) { + Log.e(TAG, String.format("Tried to access status but got null at position: %d", position)) + return + } + + val updatedStatus = StatusViewData.Builder(status) + .setCollapsed(isCollapsed) + .createStatusViewData() + searchAdapter.updateStatusAtPosition(updatedStatus, position) + searchRecyclerView.post { searchAdapter.notifyItemChanged(position, updatedStatus) } } companion object {