# TimeRangePicker **Repository Path**: liveb/TimeRangePicker ## Basic Information - **Project Name**: TimeRangePicker - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: develop - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-06-18 - **Last Updated**: 2021-06-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # TimeRangePicker [](https://maven-badges.herokuapp.com/maven-central/nl.joery.timerangepicker/timerangepicker) [](https://android-arsenal.com/api?level=14) [](https://opensource.org/licenses/MIT) A customizable, easy-to-use, and functional circular time range picker library for Android. Use this library to mimic Apple's iOS or Samsung's bedtime picker. ## Examples
![]() |
![]() ![]() |
Download the playground app: [demo.apk](./art/demo.apk). In this app, you can try out all features and even generate XML layouts.
## Contents
- [Getting started](#getting-started)
- [Managing picker programmatically](#managing-picker-programmatically)
- [Configuration](#configuration)
## Getting started
This library is available on Maven Central, add the following dependency to your build.gradle:
```gradle
implementation 'nl.joery.timerangepicker:timerangepicker:1.0.0'
```
Define `TimeRangePicker` in your XML layout with custom attributes. See the [Configuration](#configuration) section for more information.
```xml
| Attribute | Description | Default |
|---|---|---|
| trp_startTime | Set the start time by providing a time with format h:mm. | 0:00 |
| trp_startTimeMinutes | Set the start time by providing minutes between 0 and 1440 (24 hours). | 0 |
| trp_endTime | Set the end time by providing a time with format h:mm. | 8:00 |
| trp_endTimeMinutes | Set the end time by providing minutes between 0 and 1440 (24 hours). | 480 |
| trp_minDuration | Set the minimum selectable duration by providing a duration with format h:mm. | |
| trp_maxDuration | Set the maximum selectable duration by providing a duration with format h:mm. | |
| trp_maxDurationMinutes | Set the maximum selectable duration by providing minutes between 0 and 1440 (24 hours). | 480 |
| trp_minDurationMinutes | Set the minimum selectable duration by providing minutes between 0 and 1440 (24 hours). | 0 |
| trp_stepTimeMinutes | Determines at what interval the time should be rounded. Setting it to a less accurate number (e.g. 10 minutes) makes it easier for a user to select his desired time. | 10 |
| Attribute | Description | Default |
|---|---|---|
| trp_sliderWidth | The width of the slider wheel. | 8dp |
| trp_sliderColor | The background color of the slider wheel. | #E1E1E1 |
| trp_sliderRangeColor | The color of the active part of the slider wheel. | ?android:colorPrimary |
| trp_sliderRangeGradientStart | Set the starting gradient color of the active part of the slider wheel. Please note that both trp_sliderRangeGradientStart and trp_sliderRangeGradientEnd need to be configured. Tip: Set the thumbColor to transparent to mimic the Apple iOS slider. |
|
| trp_sliderRangeGradientStart | Optional for gradient: set the middle gradient color of the active part of the slider wheel. | |
| trp_sliderRangeGradientEnd | Set the ending gradient color of the active part of the slider wheel. Please note that both trp_sliderRangeGradientStart and trp_sliderRangeGradientEnd need to be configured. |
| Attribute | Description | Default |
|---|---|---|
| trp_thumbIconStart | Set the start thumb icon. | |
| trp_thumbIconEnd | Set the end thumb icon. | |
| trp_thumbSize | The size of both the starting and ending thumb. | 28dp |
| trp_thumbSizeActiveGrow | The amount of growth of the size when a thumb is being dragged. | 1.2 |
| trp_thumbColor | The background color of the thumbs. | ?android:colorPrimary |
| trp_thumbIconColor | The color (tint) of the icons inside the thumbs. | white |
| trp_thumbIconSize | The size of the thumb icons. | 24dp |
| Attribute | Description | Default |
|---|---|---|
| trp_clockVisible | Whether the clock face in the middle should be visible. | true |
| trp_clockFace | There a two different clock faces (appearance of the inner clock) you can use, both mimicking the Clock apps: APPLE ![]() SAMSUNG
|
APPLE |
| trp_clockLabelSize | The text size of the hour labels in the clock (1, 2, 3, etc.). This value is recommended to be set as scale-independent pixels (sp). | 16sp |
| trp_clockLabelColor | Set the text color of the hour labels in the clock. | ?android:textColorPrimary |
| trp_clockIndicatorColor | Set the color of the small time indicator lines in the clock. | ?android:textColorPrimary |