mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 06:40: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
|
// observe changes
|
||||||
watchHistoryAdapter.registerAdapterDataObserver(object :
|
watchHistoryAdapter.registerAdapterDataObserver(object :
|
||||||
RecyclerView.AdapterDataObserver() {
|
RecyclerView.AdapterDataObserver() {
|
||||||
override fun onChanged() {
|
override fun onItemRangeRemoved(positionStart: Int, itemCount: Int) {
|
||||||
if (watchHistoryAdapter.itemCount == 0) {
|
if (watchHistoryAdapter.itemCount == 0) {
|
||||||
binding.watchHistoryRecView.visibility = View.GONE
|
binding.watchHistoryRecView.visibility = View.GONE
|
||||||
binding.historyEmpty.visibility = View.VISIBLE
|
binding.historyEmpty.visibility = View.VISIBLE
|
||||||
|
Loading…
Reference in New Issue
Block a user