mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 22:30:30 +05:30
Fix empty history view when all history is removed
`onChanged()` is trigered when `notifyDataSetChanged()` is called. Since `notifyItemRemoved(Int)` is used override `onItemRangeRemoved()`.
This commit is contained in:
parent
f76da90447
commit
7d878476d1
@ -89,7 +89,7 @@ class WatchHistoryFragment : BaseFragment() {
|
||||
// observe changes
|
||||
watchHistoryAdapter.registerAdapterDataObserver(object :
|
||||
RecyclerView.AdapterDataObserver() {
|
||||
override fun onChanged() {
|
||||
override fun onItemRangeRemoved(positionStart: Int, itemCount: Int) {
|
||||
if (watchHistoryAdapter.itemCount == 0) {
|
||||
binding.watchHistoryRecView.visibility = View.GONE
|
||||
binding.historyEmpty.visibility = View.VISIBLE
|
||||
|
Loading…
Reference in New Issue
Block a user