You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I put SearchView in a fragment and hide or show the BottomNavigationView according to the state of the searchview. Once I switch to another fragment and back, the TransitionListener is not called
Expected behavior:
video_2024-04-16_01-08-14.mp4
Source code:
private val transitionListener = SearchView.TransitionListener { _, _, newState ->
Log.w("HomeFragment", "newState: ${newState.name}")
if (newState == SearchView.TransitionState.SHOWING) {
(activity as? MainActivity)?.hideNavView()
} else if (newState == SearchView.TransitionState.HIDDEN) {
(activity as? MainActivity)?.showNavView()
}
}
override fun onResume() {
super.onResume()
searchViewBinding.searchView.addTransitionListener(transitionListener)
}
override fun onPause() {
super.onPause()
searchViewBinding.searchView.removeTransitionListener(transitionListener)
}
Minimal sample app repro: Please consider attaching a minimal sample app that reproduces the issue. This will help narrow down the conditions required for reproducing the issue, and it will speed up the bug fix process. You may attach a zip file of the sample app or link to a GitHub repo that contains the sample app.
Android API version: 34
Material Library version: 1.11.0
Device: OnePlus 12
The text was updated successfully, but these errors were encountered:
Description:
I put SearchView in a fragment and hide or show the BottomNavigationView according to the state of the searchview. Once I switch to another fragment and back, the TransitionListener is not called
Expected behavior:
video_2024-04-16_01-08-14.mp4
Source code:
Minimal sample app repro: Please consider attaching a minimal sample app that reproduces the issue. This will help narrow down the conditions required for reproducing the issue, and it will speed up the bug fix process. You may attach a zip file of the sample app or link to a GitHub repo that contains the sample app.
Android API version: 34
Material Library version: 1.11.0
Device: OnePlus 12
The text was updated successfully, but these errors were encountered: