Android
Signature
Explore example code
Browse the Filter Numeric Comparison example code on GitHub.
About this widget
Filter Numeric Comparison is a view to filter on a numeric value using a comparison operator.Examples
Kotlin
Low-level API
If you want to fully control the Filter Numeric Comparison components and connect them manually, use the following components:Searcher. TheSearcherthat handles your searches.FilterState. The current state of the filters.NumberViewModel<T>. The logic applied to the numeric value.NumberView<T>. The view that renders the numeric value.
Kotlin
Compose UI
InstantSearch provides theNumberState as a state model,
which is an implementation of the NumberView interface.
You need to connect NumberState to the FilterComparisonConnector or NumberViewModel like any other NumberView implementation.
Kotlin
Parameters
The
FilterState that holds filters.The attribute to filter on.
The
NumericOperator used to perform a numeric comparison.Initial numeric value to filter on.
Groups all created filters under an ID and composes them with this operator.
Defaults to the used attribute, with
FilterOperator.And between filters in this group.View
The view that renders the numeric value.
How to display the numeric value.
Kotlin