当前位置: 首页>>代码示例>>Java>>正文


Java TimePickerDialog.updateTime方法代码示例

本文整理汇总了Java中android.app.TimePickerDialog.updateTime方法的典型用法代码示例。如果您正苦于以下问题:Java TimePickerDialog.updateTime方法的具体用法?Java TimePickerDialog.updateTime怎么用?Java TimePickerDialog.updateTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.app.TimePickerDialog的用法示例。


在下文中一共展示了TimePickerDialog.updateTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreateDialog

import android.app.TimePickerDialog; //导入方法依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    TextView textView = new TextView(getActivity().getApplicationContext());
    textView.setText("Set Time");
    textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 20f);
    textView.setPadding(20, 20, 20, 20);

    final TimePickerDialog timePickerDialog = new TimePickerDialog(getActivity(), this, 0, 0, true);
    timePickerDialog.setCustomTitle(textView);

    String setting = getArguments().getString(SETTING);
    if (isBlank(setting)) {
        throw new IllegalArgumentException("Setting must be provided");
    }

    long time = Setting.getLong(getActivity().getApplicationContext(), setting);
    time = time / 1000 / 60;
    int hour = (int) time / 60;
    int minute = (int) time % 60;
    timePickerDialog.updateTime(hour, minute);

    return timePickerDialog;
}
 
开发者ID:gigaSproule,项目名称:silent-meeting,代码行数:24,代码来源:TimePickerFragment.java

示例2: onCreateDialog

import android.app.TimePickerDialog; //导入方法依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {

    TimePickerDialog timePickerDialog = new TimePickerDialog(getActivity(), mTimeSetListener, calendar.get(Calendar.HOUR_OF_DAY),
            calendar.get(Calendar.MINUTE), false);
    if (scheduledTimeHolder.getTimestamp() != null) {
        String scheduledTime = scheduledTimeHolder.getTime();
        String[] st = scheduledTime.split(":");
        timePickerDialog.updateTime(Integer.parseInt(st[0]), Integer.parseInt(st[1]));
    }
    return timePickerDialog;
}
 
开发者ID:AppLozic,项目名称:Applozic-Android-Chat-Sample,代码行数:13,代码来源:SelectTimeFragment.java

示例3: onCreateDialog

import android.app.TimePickerDialog; //导入方法依赖的package包/类
@NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) {
    setupArguments(savedInstanceState);
    final Calendar calendar = Calendar.getInstance();
    TimePickerDialog timePickerDialog = new TimePickerDialog(getContext(), builder.getThemeResId(), this,
            calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE), builder.is24Hours());
    if (builder.getCurrentHour() != -1 && builder.getCurrentMinute() != -1) {
        timePickerDialog.updateTime(builder.getCurrentHour(), builder.getCurrentMinute());
    }
    return timePickerDialog;
}
 
开发者ID:k0shk0sh,项目名称:RetainedDateTimePickers,代码行数:11,代码来源:TimePickerFragmentDialog.java


注:本文中的android.app.TimePickerDialog.updateTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。