GithubHelp home page GithubHelp logo

zhangzwei1988 / circletimepicker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ly-sun/circletimepicker

0.0 2.0 0.0 557 KB

这是一款仿IOS10(就寝功能)的圆盘时间选择器

License: MIT License

Java 100.00%

circletimepicker's Introduction

CircleTimePicker

这是一款仿IOS10(就寝功能)圆盘时间选择器的自定义控件

项目演示

简单用例

1.在 buld.gradle 中添加依赖

dependencies {
    compile 'com.kyesun.ly:CircleTimePicker:1.0.0'
}

2.在XML布局文件中添加 CirclePicker

    <com.kyesun.ly.CircleTimePicker.widget.CirclePicker
        android:id="@+id/timer"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

3.在 Activity 或者 Fragment 中添加代码

    // 0到720度对应0到24小时
     mTimer.setOnTimerChangeListener(new OnCirclePickerTimeChangedListener() {
            @Override
            public void startTimeChanged(float startDegree, float endDegree) {
                // 设置开始时间的回调
            }

            @Override
            public void endTimeChanged(float startDegree, float endDegree) {
                 // 设置结束时间的回调
            }

            @Override
            public void onTimeInitail(float startDegree, float endDegree) {
                   // 初始化开始,结束时间的回调

            }

            @Override
            public void onAllTimeChanaged(float startDegree, float endDegree) {
                    // 滑动选中时间段的回调
            }
        });

自定义属性

XML Attribute description
Degree_Cycle 一个循环的周期
Start_Degree 开始时间对应的角度
End_Degree 结束时间对应的角度
Start_Btn_Bg 开始时间设置按钮的背景图
End_Btn_Bg 结束时间设置按钮的背景图
Clock_Bg 中间时钟的背景图
Ring_Default_Color 外层圆环的默认背景
Start_Btn_Color 开始时间设置按钮的背景颜色
End_Btn_Color 结束时间设置按钮的背景颜色
Btn_Width 开始,结束设置时间按钮的直径
Btn_Offset_Size 开始,结束时间按钮背景图与背景颜色的间隔

circletimepicker's People

Contributors

ly-sun avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.