diff --git a/app/src/main/java/com/github/libretube/ui/adapters/DownloadsAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/DownloadsAdapter.kt index 1bafddb5b..bb4e851e7 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/DownloadsAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/DownloadsAdapter.kt @@ -66,6 +66,7 @@ class DownloadsAdapter( files.removeAt(position) notifyItemRemoved(position) + notifyItemRangeChanged(position, itemCount) } } } diff --git a/app/src/main/java/com/github/libretube/ui/adapters/PlaylistsAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/PlaylistsAdapter.kt index 819d5600f..65aeb5a95 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/PlaylistsAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/PlaylistsAdapter.kt @@ -104,6 +104,7 @@ class PlaylistsAdapter( playlists.removeAt(position) activity.runOnUiThread { notifyItemRemoved(position) + notifyItemRangeChanged(position, itemCount) } } } catch (e: Exception) { diff --git a/app/src/main/java/com/github/libretube/ui/adapters/SearchHistoryAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/SearchHistoryAdapter.kt index e6fff4d31..f7ef52edc 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/SearchHistoryAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/SearchHistoryAdapter.kt @@ -32,14 +32,14 @@ class SearchHistoryAdapter( historyText.text = historyQuery deleteHistory.setOnClickListener { - val itemIndex = historyList.indexOf(historyQuery) historyList -= historyQuery query { Database.searchHistoryDao().delete( SearchHistoryItem(query = historyQuery) ) } - notifyItemRemoved(itemIndex) + notifyItemRemoved(position) + notifyItemRangeChanged(position, itemCount) } root.setOnClickListener { diff --git a/app/src/main/java/com/github/libretube/ui/adapters/WatchHistoryAdapter.kt b/app/src/main/java/com/github/libretube/ui/adapters/WatchHistoryAdapter.kt index 1fcd4c3d4..d6287289b 100644 --- a/app/src/main/java/com/github/libretube/ui/adapters/WatchHistoryAdapter.kt +++ b/app/src/main/java/com/github/libretube/ui/adapters/WatchHistoryAdapter.kt @@ -24,6 +24,7 @@ class WatchHistoryAdapter( DatabaseHelper.removeFromWatchHistory(position) watchHistory.removeAt(position) notifyItemRemoved(position) + notifyItemRangeChanged(position, itemCount) } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): WatchHistoryViewHolder {