Skip to content

Commit

Permalink
Let the link-driven add-on install logic build with our collection fe…
Browse files Browse the repository at this point in the history
…tcher
  • Loading branch information
interfect committed Feb 2, 2021
1 parent 3d8b00f commit 1b87a8b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,14 @@ class AddonsManagementFragment : Fragment(R.layout.fragment_add_ons_management)
val allowCache = args.installAddonId == null || installExternalAddonComplete
lifecycleScope.launch(IO) {
try {
addons = requireContext().components.addonManager.getAddons(allowCache = allowCache)
val addons = requireContext().components.addonManager.getAddons(allowCache = allowCache)
lifecycleScope.launch(Dispatchers.Main) {
runIfFragmentIsAttached {
if (!shouldRefresh) {
adapter = PagedAddonsManagerAdapter(
requireContext().components.addonCollectionProvider,
managementView,
addons!!,
addons,
style = createAddonStyle(requireContext())
)
}
Expand All @@ -193,7 +193,7 @@ class AddonsManagementFragment : Fragment(R.layout.fragment_add_ons_management)

recyclerView.adapter = adapter
if (shouldRefresh) {
adapter?.updateAddons(addons!!)
adapter?.updateAddons(addons)
}

args.installAddonId?.let { addonIn ->
Expand Down Expand Up @@ -244,7 +244,7 @@ class AddonsManagementFragment : Fragment(R.layout.fragment_add_ons_management)
}

private fun createAddonStyle(context: Context): PagedAddonsManagerAdapter.Style {
return AddonsManagerAdapter.Style(
return PagedAddonsManagerAdapter.Style(
sectionsTextColor = ThemeManager.resolveAttribute(R.attr.primaryText, context),
addonNameTextColor = ThemeManager.resolveAttribute(R.attr.primaryText, context),
addonSummaryTextColor = ThemeManager.resolveAttribute(R.attr.secondaryText, context),
Expand Down

0 comments on commit 1b87a8b

Please sign in to comment.