Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/codbking/PickTime
一个Android高效日期选择控件,支持(年月日时分星期)等多种模式的控件
https://github.com/codbking/PickTime
Last synced: 3 months ago
JSON representation
一个Android高效日期选择控件,支持(年月日时分星期)等多种模式的控件
- Host: GitHub
- URL: https://github.com/codbking/PickTime
- Owner: codbking
- Created: 2016-12-15T09:55:35.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-07T09:09:56.000Z (over 6 years ago)
- Last Synced: 2024-06-16T03:32:22.194Z (5 months ago)
- Language: Java
- Homepage:
- Size: 1.71 MB
- Stars: 434
- Watchers: 12
- Forks: 100
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-github-android-ui - PickTime - 日期选择控件 (选择器(Picker))
README
# PickTime
## 日期选择控件 ##[![](https://jitpack.io/v/codbking/PickTime.svg)](https://jitpack.io/#codbking/PickTime)
[**apk下载**](https://raw.githubusercontent.com/codbking/PickTime/master/app-debug.apk)
### 截图
------------------|TYPE_ALL|TYPE_YMDHM|TYPE_YMDH|TYPE_YMD|TYPE_HM|
|:--:|:--:|:--:|:--:|:--:|
|![Alt text](image/all.jpg)|![Alt text](image/ymdhm.jpg)|![Alt text](image/ymdh.jpg)|![Alt text](image/ymd.jpg)|![Alt text](image/hm.jpg)|### 效果
-------------![Alt text](image/dd.gif)
### DateType
- TYPE_ALL--年、月、日、星期、时、分
- TYPE_YMDHM--年、月、日、时、分
- TYPE_YMDH--年、月、日、时
- TYPE_YMD--年、月、日
- TYPE_HM--时、分### how to use
- **Add it in your root build.gradle at the end of repositories:**
```
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```- **Add the dependency**
```sh
dependencies {
compile 'com.github.codbking:PickTime:v1.0.1'
}
```- **java**
```java
DatePickDialog dialog = new DatePickDialog(this);
//设置上下年分限制
dialog.setYearLimt(5);
//设置标题
dialog.setTitle("选择时间");
//设置类型
dialog.setType(DateType.TYPE_ALL);
//设置消息体的显示格式,日期格式
dialog.setMessageFormat("yyyy-MM-dd HH:mm");
//设置选择回调
dialog.setOnChangeLisener(null);
//设置点击确定按钮回调
dialog.setOnSureLisener(null);
dialog.show();
```