Comments (7)
@mars885 Thank you for your help.
I managed to develop a very simple application which shows you the issue.
Since it's in a public repository, you should be able to import it via:
git clone https://github.com/artemius30/TestSearchView.git
Basically, it's made of a ViewPager which contains 2 Fragments.
If we search before swiping Fragment everything works, but if we swipe right and then back, searching is impossible, since
PersistentSearchView won't do anything.
Hope this will help you understand the issue :)
If you need anything, I'm here.
Thank you again, hope to hear from you soon.
from persistent-search-view.
Hello.
Can you set up a sample repo project and send me a link so that I could take a look?
Thanks.
from persistent-search-view.
I've run into same issue @irvine752 has described:
Basically I have a ViewPager, PersistentSearchView is only in first fragment. When staying in first fragment works good, but as soon as I swipe right onto the second fragment, if I swipe back left PersistentSearchView does not work anymore, it simply won't do anything.
I solved this way:
In [onResume] method of Fragment which contains PersistentSearchView:
override fun onResume() {
super.onResume()
//Reinitialize PersistentSearchView
persistentSearchView = findViewbyId(R.id.xxx)
//Set OnSearch Confirmed Listener once again
persistentSearchView.setOnSearchConfirmedListener((object : OnSearchConfirmedListener{
override fun onSearchConfirmed(searchView: PersistentSearchView, query: String) {
//Do your stuff
}
}
//Set On Clear Input Click Listener once again
txtBlinkSearch.setOnClearInputBtnClickListener{
//Do your stuff
}
}
This way, it doesn't matter how many times we swipe right or left, PersistentSearchView will always work :)
Hope this will be useful to anyone who run into the same issue.
Thank you @mars885 for this library, you saved me a lot of time 👍
from persistent-search-view.
@artemius30 Thanks for sharing your solution. However, it's more like a workaround and the behavior is definitely not right. I suspect that there might be some issue with loosing focus over the PersistentSearchView
.
If someone can set up a reproducible repo and send me a link to it so that I could take a look when I have time, I'll be extremely thankful.
from persistent-search-view.
Thanks for the update on this issue. @artemius30 saw the same issue as I did. Do we have any update on a potential fix so far? For now, I will update my code to use the fix mentioned above.
I was also wondering if there's a way to customize or remove the speech to text Google warning.
from persistent-search-view.
Sorry @irvine752 . I haven't heard from anyone about this...
You might try to use fix I mentioned, but keep in mind, as @mars885 said, even if it works, it's just a workaround.
Not a good thing to keep in production environments, that's for sure.
Can't help you with Speech to Text functionality, didn't had chance to try it.
from persistent-search-view.
@mars885 Any updates so far?
@artemius30 Can the patch be used with ViewBinding? I'm not sure if it's possible to reinitialize the SearchView.
from persistent-search-view.
Related Issues (20)
- Change textappearances HOT 1
- How to remove default padding, or maybe set custom padding HOT 4
- suggestion itemModel not resolved HOT 9
- Strange background image HOT 4
- Binary XML file line #29: Binary XML file line #29: Error inflating class com.paulrybitskyi.persistentsearchview.PersistentSearchView HOT 2
- Button to set suggestion text as query HOT 2
- jcenter deprecation HOT 4
- how to add message item when item not found?
- Gradle build error while removing jcenter HOT 2
- Change voice recognition language
- Trigger onSearchConfirmed when pressing the "ENTER" key (tablets with external keyboard)
- unable to scrool suggestion only in fragment HOT 4
- Sample application in Java for the usage in Fragment. HOT 1
- Class not found Exception in XML HOT 1
- Your own given sample has missing classes.
- Unable to add library to app. HOT 1
- problem on getting suggestion text HOT 9
- Unable to extract title of SuggestionItem from SuggestionItem object. HOT 2
- RecyclerView.addOnScrollListener is called automatically called whenever i click on persistentSearchView in my ui HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from persistent-search-view.