Switched to the official SearchWidget.
This commit is contained in:
parent
14516092f5
commit
e80a1317f1
4 changed files with 65 additions and 106 deletions
|
|
@ -7,10 +7,7 @@
|
|||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar">
|
||||
|
||||
<include layout="@layout/search_bar" />
|
||||
</android.support.v7.widget.Toolbar>
|
||||
style="@style/Toolbar" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/search_src_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="36dip"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:ellipsize="end"
|
||||
android:imeOptions="actionSearch"
|
||||
android:inputType="text|textAutoComplete|textNoSuggestions"
|
||||
android:minWidth="@dimen/abc_search_view_text_min_width"
|
||||
android:paddingLeft="@dimen/abc_dropdownitem_text_padding_left"
|
||||
android:paddingRight="@dimen/abc_dropdownitem_text_padding_right"
|
||||
android:singleLine="true"
|
||||
android:textCursorDrawable="@null"
|
||||
tools:ignore="RtlHardcoded" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/search_close_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/abc_searchview_description_clear"
|
||||
android:focusable="true"
|
||||
android:paddingLeft="8dip"
|
||||
android:paddingRight="8dip"
|
||||
android:src="@drawable/ic_close_white_24dp" />
|
||||
</LinearLayout>
|
||||
10
app/src/main/res/menu/menu_search.xml
Normal file
10
app/src/main/res/menu/menu_search.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/search"
|
||||
android:icon="@drawable/abc_ic_search_api_mtrl_alpha"
|
||||
android:title="@string/action_search"
|
||||
app:showAsAction="ifRoom|collapseActionView"
|
||||
app:actionViewClass="android.support.v7.widget.SearchView" />
|
||||
</menu>
|
||||
Loading…
Add table
Add a link
Reference in a new issue