Browse Source

For #8408: fix requireContext crash in HomeFragment#onViewCreated

master
Severin Rudie 2 years ago
committed by Emily Kager
parent
commit
1be812eba0
  1. 6
      app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt

6
app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt

@ -282,10 +282,10 @@ class HomeFragment : Fragment() {
// TODO remove when viewLifecycleOwner is fixed
val context = context ?: return@launch
val iconSize = resources.getDimensionPixelSize(R.dimen.preference_icon_drawable_size)
val iconSize = context.resources.getDimensionPixelSize(R.dimen.preference_icon_drawable_size)
val searchEngine = requireComponents.search.provider.getDefaultEngine(context)
val searchIcon = BitmapDrawable(resources, searchEngine.icon)
val searchEngine = context.components.search.provider.getDefaultEngine(context)
val searchIcon = BitmapDrawable(context.resources, searchEngine.icon)
searchIcon.setBounds(0, 0, iconSize, iconSize)
withContext(Main) {

Loading…
Cancel
Save