Skip to content

dudmy/DateTimePicker

Repository files navigation

DateTimePicker

License Download

An android library to select dates and times from a single screen.

How to use

Add a dependency to build.gradle.

dependiencies {
    implementation 'net.dudmy:datetimepicker:1.0.1'
}

Use as shown below, or refer to the sample code provided here.

<net.dudmy.datetimepicker.DateTimePicker
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />
val dateTimePicker = DateTimePicker(it.context)
dateTimePicker.setMinDate(minDate)
dateTimePicker.setMaxDate(maxDate)
// ...
dateTimePicker.setOnDateTimeChangeListener(object : OnDateTimeChangeListener {
    override fun onDateTimeChanged(year: Int, month: Int, dayOfMonth: Int, hour: Int, minute: Int) {
        // do something.
    }
})

License

Copyright 2019 Yujin Jung

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.