mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-09 19:10:42 +00:00
For #8408: fix requireContext crash in HomeFragment#onViewCreated
This commit is contained in:
parent
2264e6e1b1
commit
1be812eba0
@ -282,10 +282,10 @@ class HomeFragment : Fragment() {
|
|||||||
// TODO remove when viewLifecycleOwner is fixed
|
// TODO remove when viewLifecycleOwner is fixed
|
||||||
val context = context ?: return@launch
|
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 searchEngine = context.components.search.provider.getDefaultEngine(context)
|
||||||
val searchIcon = BitmapDrawable(resources, searchEngine.icon)
|
val searchIcon = BitmapDrawable(context.resources, searchEngine.icon)
|
||||||
searchIcon.setBounds(0, 0, iconSize, iconSize)
|
searchIcon.setBounds(0, 0, iconSize, iconSize)
|
||||||
|
|
||||||
withContext(Main) {
|
withContext(Main) {
|
||||||
|
Loading…
Reference in New Issue
Block a user