I'm trying to implement search interface in actionbar like in Google Play Video App (https://play.google.com/store/apps/details?id=com.google.android.videos). I think it is SearchView widget but don't understand how do same customization: add up button inside it, set background, and expand the full width of actionbar
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
@Quiny898 create a nice lib, have a look:
https://github.com/Quinny898/PersistentSearch
回答2:
Use a standalone Toolbar and set it with an elevation, then inflate your menu in it.
You can add this item to your menu:
<item android:id="@+id/menu_search"
android:title="@string/action_search"
android:icon="@drawable/abc_ic_search_api_mtrl_alpha"
pawesome:showAsAction="ifRoom|collapseActionView"
pawesome:actionViewClass="android.support.v7.widget.SearchView"/>
回答3:
I'm using not bad library for this: https://github.com/MiguelCatalan/MaterialSearchView