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)
|
files.removeAt(position)
|
||||||
notifyItemRemoved(position)
|
notifyItemRemoved(position)
|
||||||
|
notifyItemRangeChanged(position, itemCount)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,6 +104,7 @@ class PlaylistsAdapter(
|
|||||||
playlists.removeAt(position)
|
playlists.removeAt(position)
|
||||||
activity.runOnUiThread {
|
activity.runOnUiThread {
|
||||||
notifyItemRemoved(position)
|
notifyItemRemoved(position)
|
||||||
|
notifyItemRangeChanged(position, itemCount)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
@ -32,14 +32,14 @@ class SearchHistoryAdapter(
|
|||||||
historyText.text = historyQuery
|
historyText.text = historyQuery
|
||||||
|
|
||||||
deleteHistory.setOnClickListener {
|
deleteHistory.setOnClickListener {
|
||||||
val itemIndex = historyList.indexOf(historyQuery)
|
|
||||||
historyList -= historyQuery
|
historyList -= historyQuery
|
||||||
query {
|
query {
|
||||||
Database.searchHistoryDao().delete(
|
Database.searchHistoryDao().delete(
|
||||||
SearchHistoryItem(query = historyQuery)
|
SearchHistoryItem(query = historyQuery)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
notifyItemRemoved(itemIndex)
|
notifyItemRemoved(position)
|
||||||
|
notifyItemRangeChanged(position, itemCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
root.setOnClickListener {
|
root.setOnClickListener {
|
||||||
|
@ -24,6 +24,7 @@ class WatchHistoryAdapter(
|
|||||||
DatabaseHelper.removeFromWatchHistory(position)
|
DatabaseHelper.removeFromWatchHistory(position)
|
||||||
watchHistory.removeAt(position)
|
watchHistory.removeAt(position)
|
||||||
notifyItemRemoved(position)
|
notifyItemRemoved(position)
|
||||||
|
notifyItemRangeChanged(position, itemCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): WatchHistoryViewHolder {
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): WatchHistoryViewHolder {
|
||||||
|
Loading…
Reference in New Issue
Block a user