资源简介
可以实现一步选择日期和时间的控件,代码简单易懂,显示效果同安卓原生
代码片段和文件信息
package com.mager.ausome.Tools;
import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import android.content.Context;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.TimePicker;
import java.util.Calendar;
/**
* Created by mafanwei on 2018/5/21.
*/
public class DateTimePicker implements DatePickerDialog.OnDateSetListenerTimePickerDialog.OnTimeSetListener{
private static Context context;
private static DatePickerDialog datePickerDialog;
private static TimePickerDialog pickerDialog;
private static Calendar calendar;
private static EditText editText;
@RequiresApi(api = Build.VERSION_CODES.N)
public void init(Context context1 EditText editText1)
{
calendar=Calendar.getInstance();
editText=editText1;
context=context1;
datePickerDialog=new DatePickerDialog(contextthis calendar.get(Calendar.YE
- 上一篇:Android 躲避球
- 下一篇:android 版贪吃蛇源码_课程设计
评论
共有 条评论