Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 1.33 KB

README.md

File metadata and controls

48 lines (36 loc) · 1.33 KB

TimeIntervalPicker

TimeIntervalPicker is a library that helps developers choose the hour and minute intervals from customized dialog which is not possible with MaterialTimePicker.

screenshot" "

How to add to your project

First, add the JitPack repository to your project gradle file.

repositories {
  maven { url 'https://jitpack.io' }
}

Then, add library to your build.gradle (app module).

implementation 'com.github.mirzemehdi:timeintervalpicker:1.0.0'

Usage

You can customize shown properties in the sample.

val timeIntervalPicker = TimeIntervalPicker.Builder()
            .setTitleText("Time Interval Picker")
            .setIntervalBetweenHours(1)
            .setIntervalBetweenMinutes(5)
            .setHour(3)
            .setMinute(10)
            .setHourListCircular(true)
            .setMinuteListCircular(true)
            .build()

timeIntervalPicker.addOnPositiveButtonClickListener {
  Log.d("TimePickerValues",
            "hour:${timeIntervalPicker.hour}, " +
            "minute:${timeIntervalPicker.minute}, " +
            "timeStamp:${timeIntervalPicker.timeStampInMillis} "
       )
}

//Show dialog
timeIntervalPicker.show(supportFragmentManager, "TimeIntervalPicker")