PageViewFragment: handle home page

This commit is contained in:
dece 2022-01-10 17:12:22 +01:00
parent 656b699ce9
commit 51d1844ba0

View file

@ -63,6 +63,11 @@ class PageViewFragment : Fragment(), ContentAdapter.ContentAdapterListener {
pageViewModel.event.observe(viewLifecycleOwner, { handleEvent(it) }) pageViewModel.event.observe(viewLifecycleOwner, { handleEvent(it) })
activity?.onBackPressedDispatcher?.addCallback(viewLifecycleOwner) { onBackPressed() } activity?.onBackPressedDispatcher?.addCallback(viewLifecycleOwner) { onBackPressed() }
if (visitedUrls.isEmpty()) {
PreferenceManager.getDefaultSharedPreferences(requireContext())
.getString("home", null)?.let { openUrl(it) }
}
} }
override fun onLinkClick(url: String) { override fun onLinkClick(url: String) {