Use Number Picker
. For that you will do the following:
In your application graddle add the following within dependencies
:
compile 'com.shawnlin:number-picker:2.4.4'
Synchronize the project. Then you add the NumberPicker
to your view:
<com.shawnlin.numberpicker.NumberPicker
android:id="@+id/number_picker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
app:np_width="64dp"
app:np_height="180dp"
app:np_dividerColor="@color/colorPrimary" // color que lo divide
app:np_formatter="@string/number_picker_formatter"
app:np_max="59" // maximo de los numeros del picker
app:np_min="0" // minimo de los numeros
app:np_selectedTextColor="@color/colorPrimary" // color del numero seleccionado
app:np_selectedTextSize="@dimen/selected_text_size" // tamaño del numero seleccionado
app:np_textColor="@color/colorPrimary" // color de los numeros
app:np_textSize="@dimen/text_size" // tamano por defecto de lo snumeros
app:np_value="3" /> // valor seleccionado
The default orientation is vertical but if you want horizontal, just add the following:
np_orientation="horizonal"