Skip to content

Commit

Permalink
Make sure ItemFragment is always registered as a search listener
Browse files Browse the repository at this point in the history
Fixes #30
  • Loading branch information
Parseus committed Oct 5, 2024
1 parent 8ac41c1 commit e1abebf
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ class ItemFragment : MonetFragment(), SearchView.OnQueryTextListener {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

if (activity as? MainActivity != null) {
val searchListenerList = (activity as MainActivity).searchListeners
if (!searchListenerList.contains(this)) {
searchListenerList.add(this)
}
}

if (isDynamicThemingEnabled(requireContext()) && !isNativeMonetAvailable()) {
view.applyMonetRecursively()
}
Expand Down

0 comments on commit e1abebf

Please sign in to comment.