From bb706b9c92b91a2b914d1e1f2e9c1ad52e365b0c Mon Sep 17 00:00:00 2001 From: Kyle Corry Date: Sat, 18 Nov 2023 13:02:24 -0500 Subject: [PATCH] Repopulate tools on resume --- .../com/kylecorry/trail_sense/tools/ui/ToolsFragment.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/kylecorry/trail_sense/tools/ui/ToolsFragment.kt b/app/src/main/java/com/kylecorry/trail_sense/tools/ui/ToolsFragment.kt index 5b147ed76..193491954 100644 --- a/app/src/main/java/com/kylecorry/trail_sense/tools/ui/ToolsFragment.kt +++ b/app/src/main/java/com/kylecorry/trail_sense/tools/ui/ToolsFragment.kt @@ -29,7 +29,7 @@ import com.kylecorry.trail_sense.tools.ui.sort.ToolSortType class ToolsFragment : BoundFragment() { - private val tools by lazy { Tools.getTools(requireContext()) } + private var tools: List = emptyList() private val prefs by lazy { UserPreferences(requireContext()) } private val pinnedToolManager by lazy { PinnedToolManager(prefs) } @@ -101,6 +101,11 @@ class ToolsFragment : BoundFragment() { } + override fun onResume() { + super.onResume() + tools = Tools.getTools(requireContext()) + } + // TODO: Add a way to customize this private fun updateQuickActions() { ToolsQuickActionBinder(this, binding).bind()