mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-27 16:26:29 +03:00
Fix setting search re-animating on activity recreation (fixes #5882)
This commit is contained in:
parent
0ec7121b8f
commit
774f818bbb
2 changed files with 4 additions and 6 deletions
|
@ -68,6 +68,9 @@ abstract class SettingsController : PreferenceController() {
|
|||
animatePreferenceHighlight(it.itemView)
|
||||
}
|
||||
}
|
||||
|
||||
// Explicitly clear it to avoid re-scrolling/animating on activity recreations
|
||||
preferenceKey = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ class SettingsSearchController :
|
|||
/**
|
||||
* Adapter containing search results grouped by lang.
|
||||
*/
|
||||
protected var adapter: SettingsSearchAdapter? = null
|
||||
private var adapter: SettingsSearchAdapter? = null
|
||||
private lateinit var searchView: SearchView
|
||||
|
||||
init {
|
||||
|
@ -54,15 +54,12 @@ class SettingsSearchController :
|
|||
* @param inflater used to load the menu xml.
|
||||
*/
|
||||
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
|
||||
// Inflate menu.
|
||||
inflater.inflate(R.menu.settings_main, menu)
|
||||
|
||||
// Initialize search menu
|
||||
val searchItem = menu.findItem(R.id.action_search)
|
||||
searchView = searchItem.actionView as SearchView
|
||||
searchView.maxWidth = Int.MAX_VALUE
|
||||
|
||||
// Change hint to show "search settings."
|
||||
searchView.queryHint = applicationContext?.getString(R.string.action_search_settings)
|
||||
|
||||
searchItem.expandActionView()
|
||||
|
@ -102,8 +99,6 @@ class SettingsSearchController :
|
|||
super.onViewCreated(view)
|
||||
|
||||
adapter = SettingsSearchAdapter(this)
|
||||
|
||||
// Create recycler and set adapter.
|
||||
binding.recycler.layoutManager = LinearLayoutManager(view.context)
|
||||
binding.recycler.adapter = adapter
|
||||
|
||||
|
|
Loading…
Reference in a new issue