PickTime
日期选择控件
效果

这里写图片描述
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' }
}
}
dependencies {
compile 'com.github.codbking:PickTime:v1.0.1'
}
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();
源码
pickTime
网友评论
//设置点击确定按钮回调
dialog.setOnSureLisener(new OnSureLisener() {
@Override
public void onSure(Date date) {
mBackTime.setText(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(date));
}
});
mBackTime换成是你要显示的TextView就行了!
Error:/Users/bukeyishidecheng/AndroidStudioProjects/anterroom/AnterRoom/src/main/AndroidManifest.xml:74:9-36 Error:
Attribute application@label value=(@string/app_name_company) from AndroidManifest.xml:74:9-36
is also present at [com.github.codbking:PickTime:v1.0.1] AndroidManifest.xml:13:9-41 value=(@string/app_name).
Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:69:5-782:19 to override.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':AnterRoom:processCompanyDebugManifest'.
> Manifest merger failed with multiple errors, see logs
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
compile 'com.github.codbking:PickTime:v1.0.1'