Search in sources :

Example 66 with TimePickerDialog

use of android.app.TimePickerDialog in project Etar-Calendar by Etar-Group.

the class SnoozeDelayActivity method onPrepareDialog.

@Override
protected void onPrepareDialog(int id, Dialog d) {
    if (id == DIALOG_DELAY) {
        TimePickerDialog tpd = (TimePickerDialog) d;
        int delayMinutes = (int) (Utils.getDefaultSnoozeDelayMs(this) / (60L * 1000L));
        int hours = delayMinutes / 60;
        int minutes = delayMinutes % 60;
        tpd.updateTime(hours, minutes);
    }
    super.onPrepareDialog(id, d);
}
Also used : TimePickerDialog(android.app.TimePickerDialog)

Aggregations

TimePickerDialog (android.app.TimePickerDialog)66 TimePicker (android.widget.TimePicker)30 Calendar (java.util.Calendar)26 View (android.view.View)23 TextView (android.widget.TextView)16 DatePickerDialog (android.app.DatePickerDialog)15 DialogInterface (android.content.DialogInterface)12 Context (android.content.Context)11 AlertDialog (android.app.AlertDialog)9 Button (android.widget.Button)8 CompoundButton (android.widget.CompoundButton)8 Bundle (android.os.Bundle)7 DatePicker (android.widget.DatePicker)6 LocalTime (java.time.LocalTime)6 Intent (android.content.Intent)5 FrameLayout (android.widget.FrameLayout)5 Date (java.util.Date)5 SuppressLint (android.annotation.SuppressLint)4 Nullable (android.support.annotation.Nullable)4 LinearLayout (android.widget.LinearLayout)4