Closed furq closed 7 years ago
I have the same problem, have you solved this issue?
Yap, paste is not showing up on tap and hold.
Hi,
Not sure what would be the side effect of my change, but this is how I did it..
Remove the following line from search_query_section.xml, SearchInputView:
android:longClickable="false"
Hope this helps.
Ren
Thanks everyone, good catch. There appears no reason for android:longClickable="false"
so @rendecano 's solution is correct. Fix will be on maven in the coming weeks.
Regards, Ari
Hei guys, there is one reason for that "longClickable=false" -> https://github.com/arimorty/floatingsearchview/issues/87
Hey @drjunior thanks so much for reminding me what this was for to begin with. So, if we remove longClickable=false
would issue #87 be reintroduced?
yes.
Finally I solved this problem. Don't add this library as dependency. Instead, download source files and add new library module to your project. Then copy all java and resource files to your library's corresponding folders. So you will have your own library to change something. Findinit()
function in SearchInputView.java
file. And change it like this:
private void init() {
this.setTextIsSelectable(true); //This is the key point.
setOnKeyListener(mOnKeyListener);
}
Maybe there is another way to override this method. If you can, override and add setTextIsSelectable(true).
Or, wait until owner of the library do this. 😄 @arimorty @drjunior @rendecano @ThunderRoid @Kuanghusing @furq
EDÄ°T: I found another trick. This time you can add library as dependency. Then in your Activity or fragment (wherever you use this view), get a referans to SearchInputView with findViewById() method and then use setTextIsSelectable(true) on it like below.
//This is search view.
mSearchView = (FloatingSearchView) view.findViewById(R.id.floating_search_view);
//this is EditText in the search view. (id:search_bar_text, don't change this.)
SearchInputView searchInputView= (SearchInputView) mSearchView.findViewById(R.id.search_bar_text);
searchInputView.setTextIsSelectable(true);
//Now you can paste.
@drjunior the next release 2.0.4 contains a new fix for issue #87 that also allows for long clicks. I would recommend to first make sure that the fix works for you, because I wasn't able to reproduce it.
As always, thanks for contributing. Ari
when you click on the search field when it's empty it doesn't show a paste option, but once you entered any keyword and tap the search field it will show paste and copy option then.