Android-pickerView时间选择器封装

Android-pickerView时间选择器封装,第1张

Android-pickerView时间选择器封装
public abstract class TimePickerView {

    private TYPE dateType;
    private Activity activity;
    private boolean isDialog=false;

    public enum TYPE {
        SECOND, MINUTE, HOUR, DAY, MINUTE_SECOND,YEAR_MonTH
    }

    public TimePickerView(TYPE dateType, Activity activity) {
        this.dateType = dateType;
        this.activity = activity;
        getTimeWithType();
    }

    public TimePickerView(TYPE dateType, Activity activity, boolean isDialog) {
        this.dateType = dateType;
        this.activity = activity;
        this.isDialog = isDialog;

        getTimeWithType();
    }

    private void getTimeWithType() {
        boolean[] type = new boolean[0];//控制时间的显示类型
        if (dateType.equals(TYPE.SECOND)) {
            //秒
            type = new boolean[]{true, true, true, true, true, true};
        } else if (dateType.equals(TYPE.HOUR)) {
            //时
            type = new boolean[]{true, true, true, true, false,

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5638462.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存