Closed ernestkamara closed 8 years ago
Try using:
app:floatingSearch_leftActionMode="showHome"
And then listen for it using mSearchView.setOnLeftMenuClickListener(...)
Are u suggesting have a new layout for my search fragment? I know that as an option B, but would like a single floatingsearchview for the whole app.
I do not understand your problem. My previous solution will give you a left arrow in the search view to which you will be able to listen to and switch fragments as needed. To make the search bar show the back arrow, add: app:floatingSearch_leftActionMode="showHome"
in xml
Thanks for your replies!
I am trying to use your search view with a single Activity and multiple Fragments, meaning i have to handle the back arrow. My main screen uses app:floatingSearch_leftActionMode="showSearch"
and would like to change the search view to app:floatingSearch_leftActionMode="showHome"
after search is complete, so that the user can navigate back to the previous screen.
In other words i would like to switch between showSearch
and showHome
dynamically .
Ok then, I will look into it later and will add it to next release. I don't know when the next release is going to happen, but you can always download the library, dig into the code, make that method public, adn setup the lib as a local lib in your project.
Would this be added in the next release @arimorty ?
I will try my best for this release, if not this than next one (2.2.0) the next release contains very important fixes so I want it to be out within a few days
Will be included in 2.0.0
hi @arimorty ,,, when will the 2.2.0 version be released? i need this feature,, i have no idea how to go back to the previous view if user want to cancel search.
Hi,
The mentioned release 2.2.0 is an error, this feature was actually included in 2.0.0 (look at the milestone)
You can set the leftActionMode
dynamically using this and you can also listen to when the left arrow is clicked. To be clear, the left action mode is the left button that is visible when search is NOT focused. If you want to switch a view or otherwise react to when the search loses focus, you can set a listener for focus changes.
Hope it helps. Please refer to the detailed sample project if you have questions before submitting a new issue.
Thanks,
Why is the setLeftActionMode in FloatingSearchView not exposed? I have a single Activity with Fragments and would be nice if i can use "Home-up/ back arrow" as the left action mode for navigation back to the previous Fragment.