From 7d878476d164c7bb1c850e5b8d0b64e372e10714 Mon Sep 17 00:00:00 2001 From: Krunal Patel Date: Mon, 28 Nov 2022 20:21:00 +0530 Subject: [PATCH] Fix empty history view when all history is removed `onChanged()` is trigered when `notifyDataSetChanged()` is called. Since `notifyItemRemoved(Int)` is used override `onItemRangeRemoved()`. --- .../com/github/libretube/ui/fragments/WatchHistoryFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/libretube/ui/fragments/WatchHistoryFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/WatchHistoryFragment.kt index 69a06d390..a74fed717 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/WatchHistoryFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/WatchHistoryFragment.kt @@ -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