android.widget.TimePicker.setIs24HourView()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(132)

本文整理了Java中android.widget.TimePicker.setIs24HourView()方法的一些代码示例,展示了TimePicker.setIs24HourView()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TimePicker.setIs24HourView()方法的具体详情如下:
包路径:android.widget.TimePicker
类名称:TimePicker
方法名:setIs24HourView

TimePicker.setIs24HourView介绍

暂无

代码示例

代码示例来源:origin: ankidroid/Anki-Android

@Override
protected View onCreateDialogView() {
  timePicker = new TimePicker(getContext());
  timePicker.setIs24HourView(true);
  return timePicker;
}

代码示例来源:origin: stackoverflow.com

selectedMinute = calendar_date.get(Calendar.MINUTE);
timePicker.setIs24HourView(is24HourView);
timePicker.setCurrentHour(selectedHour);
timePicker.setCurrentMinute(selectedMinute);

代码示例来源:origin: WangDaYeeeeee/GeometricWeather

private void initWidget(View view) {
  this.container = (CoordinatorLayout) view.findViewById(R.id.dialog_time_setter_container);
  Button done = (Button) view.findViewById(R.id.dialog_time_setter_done);
  done.setOnClickListener(this);
  Button cancel = (Button) view.findViewById(R.id.dialog_time_setter_cancel);
  cancel.setOnClickListener(this);
  TimePicker timePicker = (TimePicker) view.findViewById(R.id.dialog_time_setter_time_picker);
  timePicker.setIs24HourView(true);
  timePicker.setOnTimeChangedListener(this);
}

代码示例来源:origin: WangDaYeeeeee/Mysplash

private void initWidget(View view) {
  this.container = view.findViewById(R.id.dialog_time_picker_container);
  Button done = view.findViewById(R.id.dialog_time_picker_done);
  done.setOnClickListener(this);
  Button cancel = view.findViewById(R.id.dialog_time_picker_cancel);
  cancel.setOnClickListener(this);
  TimePicker timePicker = view.findViewById(R.id.dialog_time_picker_time_picker);
  timePicker.setIs24HourView(true);
  timePicker.setOnTimeChangedListener(this);
}

代码示例来源:origin: stackoverflow.com

private TimePicker timePicker;
 timePicker = (TimePicker) dialog.findViewById(R.id.timePickerDialog);
 if(DateFormat.is24HourFormat(getActivity()){
   timePicker.setIs24HourView(true);
 }else {
   timePicker.setIs24HourView(false);
 }
 // here you can define your hour and minute value.
 timePicker.setCurrentHour(hour);
 timePicker.setCurrentMinute(minute);

代码示例来源:origin: ai212983/android-spinnerwheel

private void initViews() {
  initWheelsStyle();
  mPicker.setIs24HourView(true);
}

代码示例来源:origin: renyuneyun/Easer

@NonNull
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
  View view = inflater.inflate(R.layout.plugin_condition__time, container, false);
  timePicker = view.findViewById(R.id.timePicker);
  timePicker.setIs24HourView(!SettingsHelper.use12HourClock(getContext()));
  return view;
}

代码示例来源: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: emmaguy/clean-status-bar

@Override
protected View onCreateDialogView() {
  mTimePicker = new TimePicker(getContext());
  mTimePicker.setIs24HourView(true);
  return mTimePicker;
}

代码示例来源:origin: renyuneyun/Easer

@NonNull
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
  timePicker = new TimePicker(getContext());
  timePicker.setIs24HourView(!SettingsHelper.use12HourClock(getContext()));
  return timePicker;
}

代码示例来源:origin: mathisdt/trackworktime

@Override
protected View onCreateDialogView() {
  picker = new TimePicker(getContext());
  picker.setIs24HourView(true);
  return (picker);
}

代码示例来源:origin: saki4510t/libcommon

@Override
protected View onCreateDialogView() {
  picker = new TimePicker(getContext());
  picker.setIs24HourView(true);
  return (picker);
}

代码示例来源:origin: saki4510t/libcommon

@Override
protected View onCreateDialogView() {
  picker = new TimePicker(getContext());
  picker.setIs24HourView(true);
  return (picker);
}

代码示例来源:origin: Joysing/AlipayAutoGetForest

private void initVaule() {
  mShareUtil = new ShareUtil(this);
  timepick.setIs24HourView(true);
  timepick.setDescendantFocusability(TimePicker.FOCUS_BLOCK_DESCENDANTS);
}

代码示例来源: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: lkorth/screen-notifications

@Override
protected void onBindDialogView(View v) {
  super.onBindDialogView(v);
  mPicker.setIs24HourView(mIs24HourFormat);
  mPicker.setCurrentHour(mLastHour);
  mPicker.setCurrentMinute(mLastMinute);
}

代码示例来源:origin: SecUSo/privacy-friendly-pedometer

@Override
protected void onBindDialogView(View v) {
  super.onBindDialogView(v);
  setHour(picker, calendar.get(Calendar.HOUR_OF_DAY));
  setMinute(picker, calendar.get(Calendar.MINUTE));
  picker.setIs24HourView(DateFormat.is24HourFormat(getContext()));
}

代码示例来源:origin: oliexdev/openScale

@Override
protected View getInputView() {
  TimePicker timePicker = new TimePicker(getContext());
  timePicker.setPadding(0, 15, 0, 0);
  Calendar cal = Calendar.getInstance();
  cal.setTime(time);
  timePicker.setCurrentHour(cal.get(Calendar.HOUR_OF_DAY));
  timePicker.setCurrentMinute(cal.get(Calendar.MINUTE));
  timePicker.setIs24HourView(android.text.format.DateFormat.is24HourFormat(getContext()));
  return timePicker;
}

代码示例来源:origin: oliexdev/openScale

@Override
protected View onCreateDialogView() {
  picker = new TimePicker(getContext());
  picker.setIs24HourView(android.text.format.DateFormat.is24HourFormat(getContext()));
  return picker;
}

代码示例来源:origin: lordi/tickmate

@Override
protected View onCreateDialogView() {
  picker = new TimePicker(getContext());
  // Set the picker to the system default 24 hour format setting
  picker.setIs24HourView(new DateFormat().is24HourFormat(this.getContext()));
  return picker;
}

相关文章