Welcome Folks I am back with another blog post. In this post I will be showing how to make a simple time picker dialog in android with the help of a library.
Include the Library
1 |
implementation 'com.jzxiang.pickerview:TimePickerDialog:1.0.1' |
Demo
Configuration Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
mDialogAll = new TimePickerDialog.Builder() .setCallBack(this) .setCancelStringId("Cancel") .setSureStringId("Sure") .setTitleStringId("TimePicker") .setYearText("Year") .setMonthText("Month") .setDayText("Day") .setHourText("Hour") .setMinuteText("Minute") .setCyclic(false) .setMinMillseconds(System.currentTimeMillis()) .setMaxMillseconds(System.currentTimeMillis() + tenYears) .setCurrentMillseconds(System.currentTimeMillis()) .setThemeColor(getResources().getColor(R.color.timepicker_dialog_bg)) .setType(Type.ALL) .setWheelItemTextNormalColor(getResources().getColor(R.color.timetimepicker_default_text_color)) .setWheelItemTextSelectorColor(getResources().getColor(R.color.timepicker_toolbar_bg)) .setWheelItemTextSize(12) .build(); |