Skip to content

Latest commit

 

History

History
executable file
·
94 lines (87 loc) · 3.65 KB

File metadata and controls

executable file
·
94 lines (87 loc) · 3.65 KB

SearchBar

Donations

Please support me!

Get it on Google Play

XML

<com.lapism.searchview.widget.SearchBar
    android:id="@+id/searchBar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

XML attributes

        <attr name="search_logo" format="enum">
            <enum name="google" value="1000" />
            <enum name="hamburger_arrow" value="1001" />
            <enum name="arrow" value="1002" />
        </attr>
        <attr name="search_shape" format="enum">
            <enum name="classic" value="2000" />
            <enum name="rounded" value="2001" />
            <enum name="oval" value="2002" />
        </attr>
        <attr name="search_theme" format="enum">
            <enum name="play" value="3000" />
            <enum name="google" value="3001" />
            <enum name="light" value="3002" />
            <enum name="dark" value="3003" />
        </attr>
        <attr name="search_version_margins" format="enum">
            <enum name="bar" value="5000" />
            <enum name="toolbar" value="5001" />
            <enum name="menu_item" value="5002" />
        </attr>
        <attr name="search_elevation" format="dimension" />

Java or Kotlin

SearchBar searchBar = findViewById(R.id.searchBar);

Public methods

Name Format Default Description
getLogo() ... ... ...
setLogo(@Search.Logo int logo) ... ... ...
getShape() ... ... ...
setShape(@Search.Shape int shape) ... ... ...
getTheme() ... ... ...
setTheme(@Search.Theme int theme) ... ... ...
setLogoIcon(@DrawableRes int resource) ... ... ...
setLogoIcon(@Nullable Drawable drawable) ... ... ...
setLogoColor(@ColorInt int color) ... ... ...
setMicIcon(@DrawableRes int resource) ... ... ...
setMicIcon(@Nullable Drawable drawable) ... ... ...
setMicColor(@ColorInt int color) ... ... ...
setMenuIcon(@DrawableRes int resource) ... ... ...
setMenuIcon(@Nullable Drawable drawable) ... ... ...
setMenuColor(@ColorInt int color) ... ... ...
setTextImeOptions(int imeOptions) ... ... ...
setTextInputType(int inputType) ... ... ...
getText() ... ... ...
setText(CharSequence text) ... ... ...
setText(@StringRes int text) ... ... ...
setTextColor(@ColorInt int color) ... ... ...
setTextSize(float size) ... ... ...
setTextStyle(int style) ... ... ...
setTextFont(Typeface font) ... ... ...
setTextGravity(int gravity) ... ... ...
setHint(CharSequence hint) ... ... ...
setHint(@StringRes int hint) ... ... ...
setHintColor(@ColorInt int color) ... ... ...
getQuery() ... ... ...
setQuery(CharSequence query, boolean submit) ... ... ...
setQuery(@StringRes int query, boolean submit) ... ... ...
getCustomHeight() ... ... ...
setCustomHeight(int height) ... ... ...
setElevation(float elevation) ... ... ...
setBackgroundColor(@ColorInt int color) ... ... ...
setAlpha(@FloatRange(from = 0.5, to = 1.0) float alpha) ... ... ...
isOpen() ... ... ...
setOnMicClickListener(Search.OnMicClickListener listener) ... ... ...
setOnMenuClickListener(Search.OnMenuClickListener listener) ... ... ...
setOnQueryTextListener(Search.OnQueryTextListener listener) ... ... ...
setOnBarClickListener(Search.OnBarClickListener listener) ... ... ...