InstantSearch provides the NumberState 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
class MyActivity : AppCompatActivity() { val searcher = HitsSearcher( applicationID = "YourApplicationID", apiKey = "YourSearchOnlyAPIKey", indexName = "YourIndexName" ) val filterState = FilterState() val price = "price" val priceState = NumberState<Long>() val filterComparison = FilterComparisonConnector<Long>( filterState = filterState, attribute = price, operator = NumericOperator.GreaterOrEquals ) val connections = ConnectionHandler(filterComparison) init { connections += searcher.connectFilterState(filterState) connections += filterComparison.connectView(priceState) } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { MyFilterPrice(priceState) // your own UI composable to display `text` and `computation` } searcher.searchAsync() } override fun onDestroy() { super.onDestroy() connections.disconnect() searcher.cancel() }}
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.