SearchHeader.Builder


public final class SearchHeader.Builder


A builder of SearchHeader.

Summary

Public constructors

Creates a new Builder with provided search callback SearchCallback.

Public methods

@NonNull SearchHeader

Constructs the SearchHeader instance.

@NonNull SearchHeader.Builder

Adds an Action to be displayed at the end of the header.

@NonNull SearchHeader.Builder

Sets the initial search text to display in the search box.

@NonNull SearchHeader.Builder

Sets the text hint to display in the search box when it is empty.

@NonNull SearchHeader.Builder
@CanIgnoreReturnValue
setShowKeyboardByDefault(boolean showKeyboardByDefault)

Sets whether the keyboard should be displayed by default.

@NonNull SearchHeader.Builder

Sets the start header Action.

Public constructors

Builder

Added in 1.9.0-alpha02
public Builder(@NonNull SearchCallback callback)

Creates a new Builder with provided search callback SearchCallback.

Parameters
@NonNull SearchCallback callback

the callback to be invoked for search events

Throws
java.lang.NullPointerException

if callback is null

Public methods

build

Added in 1.9.0-alpha02
public @NonNull SearchHeader build()

Constructs the SearchHeader instance.

setEndHeaderActions

Added in 1.9.0-alpha02
@CanIgnoreReturnValue
public @NonNull SearchHeader.Builder setEndHeaderActions(@NonNull List<Action> endHeaderActions)

Adds an Action to be displayed at the end of the header.

Throws
java.lang.NullPointerException

if headerAction is null

setInitialSearchText

Added in 1.9.0-alpha02
@CanIgnoreReturnValue
public @NonNull SearchHeader.Builder setInitialSearchText(@NonNull String initialSearchText)

Sets the initial search text to display in the search box.

Throws
java.lang.NullPointerException

if initialSearchText is null

setSearchHint

Added in 1.9.0-alpha02
@CanIgnoreReturnValue
public @NonNull SearchHeader.Builder setSearchHint(@NonNull String searchHint)

Sets the text hint to display in the search box when it is empty.

Throws
java.lang.NullPointerException

if searchHint is null

setShowKeyboardByDefault

Added in 1.9.0-alpha02
@CanIgnoreReturnValue
public @NonNull SearchHeader.Builder setShowKeyboardByDefault(boolean showKeyboardByDefault)

Sets whether the keyboard should be displayed by default. Defaults to true.

setStartHeaderAction

Added in 1.9.0-alpha02
@CanIgnoreReturnValue
public @NonNull SearchHeader.Builder setStartHeaderAction(@NonNull Action headerAction)

Sets the start header Action.

Throws
java.lang.NullPointerException

if headerAction is null

java.lang.IllegalArgumentException

if headerAction does not meet the requirements