From 398fd91ad9c4e8bb32535e2a36d310f4def2e2b7 Mon Sep 17 00:00:00 2001 From: sictiru Date: Thu, 11 Jul 2024 09:08:57 -0700 Subject: [PATCH] Revert binding view destroy --- .../com/newsblur/fragment/ReadingItemFragment.kt | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/clients/android/NewsBlur/app/src/main/java/com/newsblur/fragment/ReadingItemFragment.kt b/clients/android/NewsBlur/app/src/main/java/com/newsblur/fragment/ReadingItemFragment.kt index f64736d1f4..8472c35722 100644 --- a/clients/android/NewsBlur/app/src/main/java/com/newsblur/fragment/ReadingItemFragment.kt +++ b/clients/android/NewsBlur/app/src/main/java/com/newsblur/fragment/ReadingItemFragment.kt @@ -122,10 +122,8 @@ class ReadingItemFragment : NbFragment(), PopupMenu.OnMenuItemClickListener { private var savedScrollPosRel = 0f private val webViewContentMutex = Any() - private var _binding: FragmentReadingitemBinding? = null - private var _readingItemActionsBinding: ReadingItemActionsBinding? = null - private val binding get() = _binding!! - private val readingItemActionsBinding get() = _readingItemActionsBinding!! + private lateinit var binding: FragmentReadingitemBinding + private lateinit var readingItemActionsBinding: ReadingItemActionsBinding private lateinit var markStoryReadBehavior: MarkStoryReadBehavior @@ -166,9 +164,6 @@ class ReadingItemFragment : NbFragment(), PopupMenu.OnMenuItemClickListener { override fun onDestroyView() { sampledQueue?.close() - binding.readingWebview.webChromeClient = null - _readingItemActionsBinding = null - _binding = null super.onDestroyView() } @@ -186,8 +181,8 @@ class ReadingItemFragment : NbFragment(), PopupMenu.OnMenuItemClickListener { } override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { - _binding = FragmentReadingitemBinding.inflate(inflater, container, false) - _readingItemActionsBinding = ReadingItemActionsBinding.bind(binding.root) + binding = FragmentReadingitemBinding.inflate(inflater, container, false) + readingItemActionsBinding = ReadingItemActionsBinding.bind(binding.root) val readingActivity = requireActivity() as Reading fs = readingActivity.fs