arimorty / floatingsearchview

A search view that implements a floating search bar also known as persistent search
https://github.com/arimorty/floatingsearchview/blob/master/README.md
Apache License 2.0
3.54k stars 667 forks source link

Change setSearchFocusedInternal method from private to public #251

Open Khoosham opened 7 years ago

Khoosham commented 7 years ago

private void setSearchFocusedInternal(final boolean focused)

can you change this method to public i have override the OnFocusChangeListener and now my when i click on the search the menu items does not push to left.

the problem i have is that i have a listview on my main activity with the floatingsearchview on top when i click on the search (edittext) i want to adjustResize on the window so that the listview scrolls when the keyboard opens.

i tried to adjustPan|adjustResize in manifest for main activity but that does not work on the listview it does not get resize

the only way i found is that when the edittext has got focus so the issue comes here when overiding the menu items does not push to the left.

mSearchInput.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public void onFocusChange(View v, boolean hasFocus) {
                if(hasFocus){
                    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
                }
            }
        });

EDIT 2: got it to work as the following but it will be nice to still change it to public :)

 mSearchInput.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
                return false;
            }
        });