2

I imported floatingsearchview into my app and I can't change the bottom border color and remove other borders. At this point it looks like this enter image description here

I'm trying to get it to work like on the example below enter image description here

Link to the lib: https ://github.com/arimorty/floatingsearchview

Xml code of the widget:

<com.arlib.floatingsearchview.FloatingSearchView
        android:id="@+id/floating_search_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:textAlignment="center"
        android:textColor="@color/color_white"
        android:textColorHint="@color/color_title_en"
        android:textCursorDrawable="@drawable/color_cursor"
        android:textSize="22sp"
        android:visibility="visible"
        app:floatingSearch_actionMenuOverflowColor="@color/color_primary_red"
        app:floatingSearch_clearBtnColor="@color/color_primary_red"
        app:floatingSearch_close_search_on_keyboard_dismiss="true"
        app:floatingSearch_dimBackground="false"
        app:floatingSearch_dismissOnOutsideTouch="true"
        app:floatingSearch_dividerColor="@color/color_primary_red"
        app:floatingSearch_leftActionColor="@color/color_primary_red"
        app:floatingSearch_leftActionMode="noLeftAction"
        app:floatingSearch_searchBarMarginLeft="@dimen/search_view_inset"
        app:floatingSearch_searchBarMarginRight="@dimen/search_view_inset"
        app:floatingSearch_searchBarMarginTop="@dimen/search_view_inset"
        app:floatingSearch_searchHint="@string/search_hint"
        app:floatingSearch_showSearchKey="true"
        app:floatingSearch_suggestionsListAnimDuration="150"
        app:floatingSearch_backgroundColor="@color/transparent"/>
skr
  • 2,146
  • 19
  • 22
JustNice
  • 23
  • 3

1 Answers1

1

This issue on the repository asks the same question. It seems there is no official way, however there are some hacky methods used to solve the issue.

1) Add this in your XML code

app:floatingSearch_searchBarMarginLeft="-5dp"
app:floatingSearch_searchBarMarginRight="-5dp"
app:floatingSearch_searchBarMarginTop="-5dp"

2)Add the following line in the Java class.

mSearchView.findViewById(R.id.search_query_section).setBackgroundColor(Color.TRANSPARENT);
Abhi
  • 3,431
  • 1
  • 17
  • 35