Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
levinli303 committed Feb 17, 2023
1 parent 91ec4d7 commit becf3a6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ class SearchFragment : NavigationFragment.SubFragment() {
.launchIn(lifecycleScope)

val weakSelf = WeakReference(this)
searchView.addTransitionListener { searchView, previousState, newState ->
searchView.addTransitionListener { _, _, newState ->
val self = weakSelf.get() ?: return@addTransitionListener
if (newState == SearchView.TransitionState.HIDING || newState == SearchView.TransitionState.HIDDEN) {
self.searchBar.text = self.searchView.text
}
}
searchView.editText.setOnEditorActionListener { textView, actionId, keyEvent ->
searchView.editText.setOnEditorActionListener { _, actionId, _ ->
val self = weakSelf.get() ?: return@setOnEditorActionListener false
val searchKey = self.searchView.text
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
Expand Down

0 comments on commit becf3a6

Please sign in to comment.