Add below codes to your project build.gradle
file.
buildscript {
repositories {
mavenCentral()
}
}
And add a dependency code to your module's build.gradle
file.
dependencies {
implementation 'studio.clapp:wheelpicker:1.0.1'
}
<dependency>
<groupId>studio.clapp</groupId>
<artifactId>wheelpicker</artifactId>
<version>1.0.1</version>
<type>aar</type>
</dependency>
<studio.clapp.wheelpicker.WheelPicker android:id="@+id/wheel_picker" android:layout_width="300dp"
android:layout_height="250dp" android:layout_marginTop="64dp" app:align="CENTER"
app:selectedTextScale="1.2" app:textSize="42sp" app:wheelItemCount="5" />
Attr | Type | Description |
---|---|---|
selectedTextColor | color | Text color of selected item |
selectedTextScale | float | Text scale of selected item |
textColor | color | Text color of unselected item |
textSize | dimension | Text size |
wheelItemCount | integer | How much items will be visible to user |
align | enum | Text align [LEFT, CENTER, RIGHT] |
textSize | dimension | Text size |
fadingEdgeEnabled | boolean | Whether text will be faded at top and bottom sides or not |
max | integer | Maximum visible item index |
min | integer | Minimum visible item index |
Simple customizable dialog to pick time with help of wheel pickers.
TimePickerDialog.Builder(this).build().show()
TimePickerDialog.Builder(requireContext()).build().show()
TimePickerDialog.Builder(this).setOnPickedListener { hours, minutes -> println("$hours $minutes") }
.build()
.show()
TimePickerDialog.Builder(this).setSelectedTime("23", "55")
.build()
.show()
WheelPicker is distributed under the MIT license. See LICENSE for details.