在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):arimorty/floatingsearchview开源软件地址(OpenSource Url):https://github.com/arimorty/floatingsearchview开源编程语言(OpenSource Language):Java 99.7%开源软件介绍(OpenSource Introduction):Floating Search ViewAn implementation of a floating search box with search suggestions, also called persistent search bar. NoteThis project is not being actively maintained. Have a look here for information that might help you make changes to your own copy of the code base. ... Usage
Example: <com.arlib.floatingsearchview.FloatingSearchView
android:id="@+id/floating_search_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:floatingSearch_searchBarMarginLeft="@dimen/search_view_inset"
app:floatingSearch_searchBarMarginTop="@dimen/search_view_inset"
app:floatingSearch_searchBarMarginRight="@dimen/search_view_inset"
app:floatingSearch_searchHint="Search..."
app:floatingSearch_suggestionsListAnimDuration="250"
app:floatingSearch_showSearchKey="false"
app:floatingSearch_leftActionMode="showHamburger"
app:floatingSearch_menu="@menu/menu_main"
app:floatingSearch_close_search_on_keyboard_dismiss="true"/>
Left action mode: The left action can be configured as follows: Add app:floatingSearch_leftActionMode="[insert one of the options from table below]"
Listen to hamburger button clicks:
To quickly connect your NavigationDrawer to the hamburger button:
Listen to home (back arrow) button clicks:
Configure menu items: Add a menu resource app:floatingSearch_menu="@menu/menu_main" In the menu resource, set items'
Listen for item selections
Configure suggestion item: First, implement SearchSuggestion Optional: Set a callback for when a given suggestion is bound to the suggestion list. For the history icons to show, you would need to implement this. Refer to the sample app for an example implementation.
Styling: Available styling: <style name="SearchView">
<item name="floatingSearch_backgroundColor"></item>
<item name="floatingSearch_viewSearchInputTextColor"></item>
<item name="floatingSearch_viewSuggestionItemTextColor"></item>
<item name="floatingSearch_hintTextColor"></item>
<item name="floatingSearch_dividerColor"></item>
<item name="floatingSearch_clearBtnColor"></item>
<item name="floatingSearch_leftActionColor"></item>
<item name="floatingSearch_menuItemIconColor"></item>
<item name="floatingSearch_suggestionRightIconColor"></item>
<item name="floatingSearch_actionMenuOverflowColor"></item>
</style> RxBinding ExtensionThe RxBinding library allows you to listen for query changes using RxJava Obervables. Observable<CharSequence> queryObservable = RxFloatingSearchView.queryChanges(view);
queryObservable.doOnNext { query -> Toast.makeText(this, "Query is %s".format(query), Toast.LENGTH_LONG).show() }.subscribe(); The Kotlin ExtensionThe Kotlin extension adds an extension function to the view for more goodness. view.queryChanges(5).doOnNext { query -> Toast.makeText(this, "Query is %s".format(query), Toast.LENGTH_LONG).show() }.subscribe() License
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论