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

Completely remove left button (arrow, hamburger etc) #212

Closed djdance closed 7 years ago

djdance commented 7 years ago

Im using your great lib as an overlay. I do not nedd in "back" button or hamburger. I set it's color to white, but it still shows big empty space while focused. Also I tried to set setLeftActionMode(SOME_WRONG_NUMBER); but it continue to show black icon and big padding while focused.

Please add an ability to completely hide left button in the new version, thanks. p.s. Also to remove bottom line, please. device-2017-04-14-164450

djdance commented 7 years ago

of course I can add this

        mSearchView.setLeftActionMode(3);
        mSearchView.findViewById(R.id.search_bar_left_action_container).setVisibility(View.GONE);
echthard commented 7 years ago

Why don't you check what's available?

mSearchView.setLeftActionMode(FloatingSearchView.LEFT_ACTION_MODE_NO_LEFT_ACTION);

arimorty commented 7 years ago

Thanks @echthard !

djdance commented 7 years ago

> Why don't you check what's available? @echthard that's exactly what you can see on the screenshot. it IS the result of LEFT_ACTION_MODE_NO_LEFT_ACTION

echthard commented 7 years ago

I see, you get that when you type a text. When you type a text, you should get an arrow pointing to the left as a left action mode. That's sort of a "cancel" to go back to the previous state (cancel the search action). This is the XML:

<com.arlib.floatingsearchview.FloatingSearchView
        android:id="@+id/floating_search_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:floatingSearch_close_search_on_keyboard_dismiss="true"
        app:floatingSearch_leftActionMode="noLeftAction"
        app:floatingSearch_menu="@menu/menu_search"
        app:floatingSearch_searchBarMarginLeft="4dp"
        app:floatingSearch_searchBarMarginRight="4dp"
        app:floatingSearch_searchBarMarginTop="-2dp"
        app:floatingSearch_searchHint="Search"
        app:floatingSearch_showSearchKey="true"
        app:floatingSearch_suggestionsListAnimDuration="250" />
djdance commented 7 years ago

I know it all, that's why Im asking to add a 5-th case to remove this arrow completely. Actually I can remove it by the hack above, but this is ridiculous.

echthard commented 7 years ago

I'm sorry, I understand it now. However it's weird that you don't want to be able to cancel the search (remove all suggestions and lose focus from search view). Because when you'll press BACK button, it will be the same as pressing the arrow pointing to the left.

But it is something different and could be added to the lib. However, I think it's weird behaviour and not consistent with other (Google) apps.