本文整理了Java中android.widget.TimePicker.setCurrentMinute()
方法的一些代码示例,展示了TimePicker.setCurrentMinute()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TimePicker.setCurrentMinute()
方法的具体详情如下:
包路径:android.widget.TimePicker
类名称:TimePicker
方法名:setCurrentMinute
暂无
代码示例来源:origin: RobotiumTech/robotium
public void run()
{
try{
timePicker.setCurrentHour(hour);
timePicker.setCurrentMinute(minute);
}catch (Exception ignored){}
}
});
代码示例来源:origin: stackoverflow.com
SimpleDateFormat sdf = new SimpleDateFormat("hh:ss");
Date date = null;
try {
date = sdf.parse("07:00");
} catch (ParseException e) {
}
Calendar c = Calendar.getInstance();
c.setTime(date);
TimePicker picker = new TimePicker(getApplicationContext());
picker.setCurrentHour(c.get(Calendar.HOUR_OF_DAY));
picker.setCurrentMinute(c.get(Calendar.MINUTE));
代码示例来源:origin: ankidroid/Anki-Android
@Override
@SuppressWarnings("deprecation")
public void setTime(TimePicker picker, int hour, int minute) {
picker.setCurrentHour(hour);
picker.setCurrentMinute(minute);
}
@Override
代码示例来源:origin: stackoverflow.com
private static final int TIME_PICKER_INTERVAL=15;
private boolean mIgnoreEvent=false;
private TimePicker.OnTimeChangedListener mTimePickerListener=new TimePicker.OnTimeChangedListener(){
public void onTimeChanged(TimePicker timePicker, int hourOfDay, int minute){
if (mIgnoreEvent)
return;
if (minute%TIME_PICKER_INTERVAL!=0){
int minuteFloor=minute-(minute%TIME_PICKER_INTERVAL);
minute=minuteFloor + (minute==minuteFloor+1 ? TIME_PICKER_INTERVAL : 0);
if (minute==60)
minute=0;
mIgnoreEvent=true;
timePicker.setCurrentMinute(minute);
mIgnoreEvent=false;
}
}
};
代码示例来源:origin: stackoverflow.com
picker.setCurrentMinute(lastMinute);
代码示例来源:origin: stackoverflow.com
super.onBindDialogView(v);
picker.setCurrentHour(calendar.get(Calendar.HOUR_OF_DAY));
picker.setCurrentMinute(calendar.get(Calendar.MINUTE));
代码示例来源:origin: stackoverflow.com
public void updateTime(int hourOfDay, int minuteOfHour) {
mTimePicker.setCurrentHour(hourOfDay);
mTimePicker.setCurrentMinute(minuteOfHour / TIME_PICKER_INTERVAL);
代码示例来源:origin: stackoverflow.com
timePicker.setCurrentMinute(selectedMinute);
代码示例来源:origin: stackoverflow.com
public static ViewAction setTime(final int hour, final int minute) {
return new ViewAction() {
@Override
public void perform(UiController uiController, View view) {
TimePicker tp = (TimePicker) view;
tp.setCurrentHour(hour);
tp.setCurrentMinute(minute)
}
@Override
public String getDescription() {
return "Set the passed time into the TimePicker";
}
@Override
public Matcher<View> getConstraints() {
return ViewMatchers.isAssignableFrom(TimePicker.class);
}
};
}
代码示例来源:origin: stackoverflow.com
DatePicker datePicker = (DatePicker) findViewById(R.id.inspected_at_date);
TimePicker timePicker = (TimePicker) findViewById(R.id.inspected_at_time);
DateTime inspected_at = DateTime.now() // Typically pulled from DB.
int year = inspected_at.getYear() ;
int month = inspected_at.getMonthOfYear() - 1; // Need to subtract 1 here.
int day = inspected_at.getDayOfMonth();
int hour = inspected_at.getHourOfDay();
int minutes = inspected_at.getMinuteOfHour();
datePicker.updateDate(year, month, day); // Set date.
timePicker.setCurrentHour(hour); // Set time.
timePicker.setCurrentMinute(minutes);
代码示例来源:origin: stackoverflow.com
TimePicker picker = (TimePicker) findViewById(R.id.timePicker1);
picker.setIs24HourView(true);
Calendar calendar = Calendar.getInstance();
int h = calendar.get(Calendar.HOUR_OF_DAY);
int m = calendar.get(Calendar.MINUTE);
picker.setCurrentHour(h);
picker.setCurrentMinute(m);
代码示例来源:origin: oliexdev/openScale
@Override
protected void onBindDialogView(View v) {
super.onBindDialogView(v);
picker.setCurrentHour(calendar.get(Calendar.HOUR_OF_DAY));
picker.setCurrentMinute(calendar.get(Calendar.MINUTE));
}
代码示例来源:origin: emmaguy/clean-status-bar
@Override
protected void onBindDialogView(View v) {
super.onBindDialogView(v);
mTimePicker.setCurrentHour(mLastHour);
mTimePicker.setCurrentMinute(mLastMinute);
}
代码示例来源:origin: renyuneyun/Easer
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);
}
}
代码示例来源:origin: mathisdt/trackworktime
@Override
protected void onBindDialogView(View v) {
super.onBindDialogView(v);
picker.setCurrentHour(lastHour);
picker.setCurrentMinute(lastMinute);
}
代码示例来源:origin: dsolonenko/financisto
private void prepareDialog(Dialog dialog, Calendar c) {
DatePicker dp = dialog.findViewById(R.id.date);
dp.init(c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH), null);
TimePicker tp = dialog.findViewById(R.id.time);
tp.setIs24HourView(is24HourFormat(this));
tp.setCurrentHour(c.get(Calendar.HOUR_OF_DAY));
tp.setCurrentMinute(c.get(Calendar.MINUTE));
}
代码示例来源:origin: ai212983/android-spinnerwheel
public void onChanged(AbstractWheel wheel, int oldValue, int newValue) {
if (!timeScrolled) {
timeChanged = true;
picker.setCurrentHour(hours.getCurrentItem());
picker.setCurrentMinute(mins.getCurrentItem());
timeChanged = false;
}
}
};
代码示例来源:origin: ai212983/android-spinnerwheel
public void onScrollingFinished(AbstractWheel wheel) {
timeScrolled = false;
timeChanged = true;
picker.setCurrentHour(hours.getCurrentItem());
picker.setCurrentMinute(mins.getCurrentItem());
timeChanged = false;
}
};
代码示例来源:origin: stackoverflow.com
final TimePicker timePicker = (TimePicker) findViewById(R.id.a_time_picker);
int hour = timePicker.getCurrentHour();
int minute = timePicker.getCurrentMinute();
timePicker.setCurrentHour(hour + 7);
timePicker.setCurrentMinute(minute + 30);
代码示例来源:origin: lkorth/screen-notifications
@Override
protected void onBindDialogView(View v) {
super.onBindDialogView(v);
mPicker.setIs24HourView(mIs24HourFormat);
mPicker.setCurrentHour(mLastHour);
mPicker.setCurrentMinute(mLastMinute);
}
内容来源于网络,如有侵权,请联系作者删除!