Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using SearchView in layout together with navigation view #71

Closed
volkdown opened this issue Dec 5, 2016 · 7 comments · Fixed by #84
Closed

Using SearchView in layout together with navigation view #71

volkdown opened this issue Dec 5, 2016 · 7 comments · Fixed by #84
Assignees
Milestone

Comments

@volkdown
Copy link

volkdown commented Dec 5, 2016

Hello! I have the following problem. When I use your view in the layout with navigation view, then when open the search and I click on item recycler view, search is minimized and lost all of the search results. How should I place your element, so that when you click on the free space on your element search was not closed. I also have another problem. The items in the list suggestions not selected.
My current layout, you can see the following link: http://pastebin.com/3RKEmwY5
Detail problem: http://prntscr.com/dffvu4

@Mauker1
Copy link
Owner

Mauker1 commented Dec 5, 2016

I'll take a look on this.

@volkdown
Copy link
Author

volkdown commented Dec 5, 2016

Okay thanks, I'll wait for your answer. Thank you in advance.

@Mauker1
Copy link
Owner

Mauker1 commented Dec 10, 2016

Let me see if I got this correctly. You want to be able to tap on the "empty" space bellow the search results and keep the search view open?
Are you losing the data, or it's just closing?

@volkdown
Copy link
Author

Hello!

  1. You want to be able to tap on the "empty" space bellow the search results and keep the search view open?
    -Yes, I want to search view closed only when user performs an action: clicks the back button, and click on the icon of the cross.
  2. Are you losing the data, or it's just closing?
    Now the problem is when I click on a list item, the search view is closed. I understand that the search view in an open state occupies the entire layaut. Accordingly, I can not open the item in the list because the action is not passed to the listener item of list. After the search is closed I lose filter list items. Ie search view closes and I lose the filter.

@Mauker1
Copy link
Owner

Mauker1 commented Dec 14, 2016

Ok, so. For the first question, this is the default behavior of the app, and it's defined here:

    mTintView.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                closeSearch();
            }
        });

As for version 1.2.0 it's not possible to change this behavior yet. But I'll add this as a feature so it'll be possible to change this behavior to whatever you want it to do.

As for the second question, you can change the behavior using this method:

public void setOnItemClickListener(AdapterView.OnItemClickListener listener)

@Mauker1 Mauker1 self-assigned this Dec 14, 2016
@Mauker1 Mauker1 added this to the 1.2.1 milestone Dec 14, 2016
@Mauker1
Copy link
Owner

Mauker1 commented Dec 14, 2016

Mauker1 added a commit that referenced this issue Feb 7, 2017
Fix #71 
The fix was possible by adding the `setCloseOnTintClick` method, where you can disable the default close behavior when you click on the blank area (Tint).
Added more docs on the setters.
@Mauker1 Mauker1 mentioned this issue Feb 7, 2017
@Mauker1
Copy link
Owner

Mauker1 commented Feb 7, 2017

I've made possible to disable the default behavior of the tint click, as seem on #84. To do that, you'll just have to call the setCloseOnTintClick(boolean) method and set it to false.

Mauker1 added a commit that referenced this issue Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants