mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 14:20:30 +05:30
Merge pull request #1499 from Bnyro/master
fix crashes when removing recview items
This commit is contained in:
commit
bdfc8ccf6c
@ -66,6 +66,7 @@ class DownloadsAdapter(
|
||||
|
||||
files.removeAt(position)
|
||||
notifyItemRemoved(position)
|
||||
notifyItemRangeChanged(position, itemCount)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -104,6 +104,7 @@ class PlaylistsAdapter(
|
||||
playlists.removeAt(position)
|
||||
activity.runOnUiThread {
|
||||
notifyItemRemoved(position)
|
||||
notifyItemRangeChanged(position, itemCount)
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user