package com.android.chmo.utils;

import android.content.Context;

import com.android.chmo.R;
import com.bigkoo.pickerview.configure.PickerOptions;
import com.bigkoo.pickerview.listener.OnTimeSelectListener;
import com.bigkoo.pickerview.view.TimePickerView;

import java.util.Calendar;

/**
 * Created by Administrator on 2018/8/3.
 */

public class PickTimeUtils {

    public static void showPickTime(Context context, String title, boolean showHour, boolean showMin,OnTimeSelectListener listener) {
        PickerOptions pickerOptions = new PickerOptions(PickerOptions.TYPE_PICKER_TIME);
        pickerOptions.context = context;
        pickerOptions.textColorConfirm = context.getResources().getColor(R.color.pink);
        pickerOptions.textColorCancel = context.getResources().getColor(R.color.gray);
        pickerOptions.type = new boolean[]{true, true, true, showHour, showMin, false};
        pickerOptions.startDate = Calendar.getInstance();
        pickerOptions.textSizeContent = 16;
        pickerOptions.timeSelectListener = listener;
        TimePickerView pickerView = new TimePickerView(pickerOptions);
        pickerView.setTitleText(title);
        pickerView.setDate(Calendar.getInstance());
        pickerView.show();
    }
}
