當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。