API Reference / Android Widgets / numericSelector
Apr. 24, 2019

numericSelector

Widget signature
<com.algolia.instantsearch.ui.views.filters.NumericSelector
  android:id="@+id/numericSelector"
  algolia:attribute="string"
  algolia:labels="string"
  algolia:values="string"
  algolia:operator="string"

  <!-- Optional parameters -->
  algolia:defaultLabel="string"
  algolia:autoHide="boolean"
  algolia:variant="string"
/>

About this widget

Displays a dropdown menu to refine a specific attribute with one of several values.

Examples

1
2
3
4
5
6
7
8
9
10
 <com.algolia.instantsearch.ui.views.filters.NumericSelector
    android:id="@+id/numericSelector"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    algolia:labels="&lt; 10€, &lt; 100€, &lt; 1000€"
    algolia:values="10, 100, 1000"
    algolia:defaultLabel="Any price"
    algolia:operator="lt"
    algolia:autoHide="true"
  />

Parameters

attribute
type: string
Required

The faceted attribute that is used by the widget.

1
algolia:attribute="price"
labels
type: string
Required

The labels to display for each choice item.

1
algolia:labels="&lt; 10€, &lt; 100€, &lt; 1000€"
values
type: string
Required

The values to refine with for each choice item.

1
algolia:values="10, 100, 1000"
operator
type: string
Required

The operator to use for refining, in the form lt (<), le (<=), eq (=), etc.

1
algolia:operator="lt"
defaultLabel
type: string

A default label to use as the first option and that doesn’t refine on any value.

1
algolia:defaultLabel="Any price"
autoHide
type: boolean
default: false

Whether the widget should be hidden when there are no results.

1
algolia:autoHide="true"
variant
type: string

An identifier for the widget group this widget is part of. If specified, this widget is only linked to other widgets that have the same variant. See Multi-Index Searches.

1
algolia:variant="actors"

Did you find this page helpful?

Android InstantSearch v1