Similar to the original TimePicker but this library is for picking a range of time.
video.mp4
SDK 24+ or Android 7.0+
val state = rememberTimeRangePickerState(
start = Random.nextInt(0..23).toFloat(),
end = Random.nextInt(0..23).toFloat()
)
TimeRangePicker(
state = state
)TimeRangePicker(
state = state,
ringColor = Color(0xffFFFD55),
selectedArcColor = Color(0xffDE6210),
centerTextColor = Color.Black,
ringTextColor = Color.DarkGray,
startColor = Color(0xffF08784),
endColor = Color(0xffF09B59),
)You can also access or change state directly if you want.
Text(
text = state.start.toString()
)state.end = 12fimplementation("ir.yamins.timerangepicker:timerangepicker-jvm:1.0.1")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/.