Java Code Examples for android.widget.TimePicker#setMinute()

The following examples show how to use android.widget.TimePicker#setMinute() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TimePreference.java    From privacy-friendly-pedometer with GNU General Public License v3.0 5 votes vote down vote up
protected void setMinute(TimePicker timePicker, int minute) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        timePicker.setMinute(minute);
    } else {
        timePicker.setCurrentMinute(minute);
    }
}
 
Example 2
Source File: GeckoViewPrompt.java    From focus-android with Mozilla Public License 2.0 5 votes vote down vote up
@SuppressWarnings("deprecation")
private static void setTimePickerTime(final TimePicker picker, final Calendar cal) {
    if (Build.VERSION.SDK_INT >= 23) {
        picker.setHour(cal.get(Calendar.HOUR_OF_DAY));
        picker.setMinute(cal.get(Calendar.MINUTE));
    } else {
        picker.setCurrentHour(cal.get(Calendar.HOUR_OF_DAY));
        picker.setCurrentMinute(cal.get(Calendar.MINUTE));
    }
}
 
Example 3
Source File: TimeEventSkillViewFragment.java    From Easer with GNU General Public License v3.0 5 votes vote down vote up
private static void setTimePicker(TimePicker timePicker, Calendar calendar) {
    int hour, minute;
    hour = calendar.get(Calendar.HOUR_OF_DAY);
    minute = calendar.get(Calendar.MINUTE);
    if (Build.VERSION.SDK_INT >= 23) {
        timePicker.setHour(hour);
        timePicker.setMinute(minute);
    } else {
        timePicker.setCurrentHour(hour);
        timePicker.setCurrentMinute(minute);
    }
}
 
Example 4
Source File: TimeSkillViewFragment.java    From Easer with GNU General Public License v3.0 5 votes vote down vote up
private static void setTimePicker(TimePicker timePicker, Calendar calendar) {
    int hour, minute;
    hour = calendar.get(Calendar.HOUR_OF_DAY);
    minute = calendar.get(Calendar.MINUTE);
    if (Build.VERSION.SDK_INT >= 23) {
        timePicker.setHour(hour);
        timePicker.setMinute(minute);
    } else {
        timePicker.setCurrentHour(hour);
        timePicker.setCurrentMinute(minute);
    }
}
 
Example 5
Source File: TimePreference.java    From privacy-friendly-interval-timer with GNU General Public License v3.0 5 votes vote down vote up
protected void setMinute(TimePicker timePicker, int minute) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        timePicker.setMinute(minute);
    } else {
        timePicker.setCurrentMinute(minute);
    }
}