Skip to content

yamin8000/TimeRangePicker

Repository files navigation

TimeRangePicker

Similar to the original TimePicker but this library is for picking a range of time.

Preview

Image

simple preview

Video

video.mp4

Compatibility

SDK 24+ or Android 7.0+

Usage

Simple

val state = rememberTimeRangePickerState(
    start = Random.nextInt(0..23).toFloat(),
    end = Random.nextInt(0..23).toFloat()
)
TimeRangePicker(
    state = state
)

Advanced

TimeRangePicker(
    state = state,
    ringColor = Color(0xffFFFD55),
    selectedArcColor = Color(0xffDE6210),
    centerTextColor = Color.Black,
    ringTextColor = Color.DarkGray,
    startColor = Color(0xffF08784),
    endColor = Color(0xffF09B59),
)

State

You can also access or change state directly if you want.

Text(
    text = state.start.toString()
)
state.end = 12f

simple preview

Install

implementation("ir.yamins.timerangepicker:timerangepicker-jvm:1.0.1")

License

TimeRangePicker is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

TimeRangePicker is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with TimeRangePicker. If not, see https://www.gnu.org/licenses/.