All Projects → DeweyReed → HmsPickerView

DeweyReed / HmsPickerView

Licence: Apache-2.0 license
A beautiful little Android view to pick hours, minutes and seconds.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to HmsPickerView

QuantityPickerView
A View capable of increasing or decreasing a unit value with a toggle animation
Stars: ✭ 42 (+133.33%)
Mutual labels:  android-pickers, android-pickerview
value-picker
An Android library that provides a simple and customizable ValuePicker.
Stars: ✭ 47 (+161.11%)
Mutual labels:  android-pickers, android-pickerview
Circular-Layout
A layout that arranges other views in a circle.
Stars: ✭ 46 (+155.56%)
Mutual labels:  android-custom-view
recurpickerlib
Recurrence picker fragment and dialog for Android, with utilities for finding recurrence dates
Stars: ✭ 64 (+255.56%)
Mutual labels:  android-pickers
Android Pickerview
This is a picker view for android , support linkage effect, timepicker and optionspicker.(时间选择器、省市区三级联动)
Stars: ✭ 13,003 (+72138.89%)
Mutual labels:  android-pickerview
Android
Android 自定义控件、框架
Stars: ✭ 48 (+166.67%)
Mutual labels:  android-custom-view
android-custom-view
No description or website provided.
Stars: ✭ 15 (-16.67%)
Mutual labels:  android-custom-view

JitPack Android Arsenal

HmsPickerView

A beautiful little Android view to pick hours, minutes and seconds.

Port

Land

Installation

Step 1. Add it in your root build.gradle at the end of repositories:

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

Step 2. Add the dependency

dependencies {
    implementation "xyz.aprildown:HmsPickerView:${version}"
}

Usage

In the XML:

<xyz.aprildown.hmspickerview.HmsPickerView
    android:id="@+id/hmsPickerView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />
<attr name="hpv_time_text_size" format="dimension" />
<!--default: 40sp port, 32sp land-->
<attr name="hpv_digit_text_size" format="dimension" />
<!--default: 40sp port, 24sp land-->

In the code:

fun getHours(): Int
fun setHours(hours: Int)

fun getMinutes(): Int
fun setMinutes(minutes: Int)

fun getSeconds(): Int
fun setSeconds(seconds: Int)

fun getTimeInMillis(): Long
fun setTimeInMillis(time: Long)

fun setTimeTextSize(@Px textSize: Int)
fun setDigitTextSize(@Px textSize: Int)

fun setListener(l: HmsPickerView.Listener)
interface Listener {
    /**
     * Indicates [HmsPickerView] now has an valid input(anything except 00h 00m 00s).
     * This methods can be used to allow user to go forward (such as enabling "next" button).
     */
    fun onHmsPickerViewHasValidInput(hmsPickerView: HmsPickerView)

    /**
     * Indicates [HmsPickerView]'s input becomes 00h 00m 00s.
     * This methods can be used to prevent user from going forward(such as disabling "next" button).
     */
    fun onHmsPickerViewHasNoInput(hmsPickerView: HmsPickerView)
}

Use this view in a dialog

  1. Create a XML file like this one.
  2. Wrap it into an AlertDialog like this one.

🦄 Please star this repo if you like it 🦄

License

LICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].