https://github.com/wheely/android-day-time-picker
Day Time Picker Widget
https://github.com/wheely/android-day-time-picker
Last synced: 12 months ago
JSON representation
Day Time Picker Widget
- Host: GitHub
- URL: https://github.com/wheely/android-day-time-picker
- Owner: wheely
- Created: 2022-03-30T10:17:47.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-06-01T07:11:24.000Z (about 3 years ago)
- Last Synced: 2025-01-16T01:16:53.629Z (over 1 year ago)
- Language: Kotlin
- Size: 304 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Widget for choosing Day and Time for Android apps with flexible configuration
Add repository:
```groovy
repositories {
maven { url 'https://jitpack.io' }
}
```
Add the dependency
```groovy
dependencies {
implementation 'com.github.wheely:android-day-time-picker:1.0.2'
}
```
Sample usage
```xml
```
```kotlin
val dayTimePicker: DayTimePicker = findViewById(R.id.day_time_picker)
val currentTime = LocalDateTime.of(1993, Month.SEPTEMBER, 3, 21, 21)
val startTime = LocalDate.of(1993, Month.SEPTEMBER, 2).atStartOfDay()
val dayFormatter = DateTimeFormatterBuilder().appendPattern("d MMMM YYYY").toFormatter()
dayTimePicker.setDateTimeParams(
startTime,
currentTime,
Duration.ofDays(3)
) { dayFormatter.format(it) }
dayTimePicker.onUserSelected = { time: LocalDateTime ->
// handle time
}
```