# YrMTimeDialog **Repository Path**: yrmao/YrMTimeDialog ## Basic Information - **Project Name**: YrMTimeDialog - **Description**: 一个自定义的时间选择器 1.选择日期 2.选择月份 3.选择年份 - **Primary Language**: Android - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2016-11-28 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #YrMTimeDialog 就前两天的事情由于项目上需要用到时间选择器,系统的又无法满足,无奈之下自定义了一个,由于时间紧急未做优化。 版本v1.0.0 支持日期选择 支持月份选择 支持年份选择 未添加时间星期显示,预计下版本添加 版本v1.1.0 新增时间星期显示 依赖 compile 'com.android.support:appcompat-v7:25.0.0' compile 'com.android.support:recyclerview-v7:25.0.0' 使用方法 实现接口: implements MTimeOnClickListener 实例化: MTimeDialog mTimeDialog = new MTimeDialog(this); 设置监听: mTimeDialog.setMTimeOnClickListener(this); 日期选择: mTimeDialog.showDayTime(); 月份选择: mTimeDialog.showMonthTime(); 年份选择: mTimeDialog.showYearTime(); @Override public void getYear(int year) {//year对话框点击确定时调用 tv_time.setText(year + "年"); } @Override public void getYear_Month(int year, int month) {//month对话框点击确定时调用 tv_time.setText(year + "年" + month + "月"); } @Override public void getYear_Month_Day(int year, int month, int day) {//日期对话框点击确定时调用 tv_time.setText(year + "年" + month + "月" + day + "日"); }