Example usage for android.app TimePickerDialog TimePickerDialog

List of usage examples for android.app TimePickerDialog TimePickerDialog

Introduction

In this page you can find the example usage for android.app TimePickerDialog TimePickerDialog.

Prototype

public TimePickerDialog(Context context, OnTimeSetListener listener, int hourOfDay, int minute,
        boolean is24HourView) 

Source Link

Document

Creates a new time picker dialog.

Usage

From source file:de.uni_koblenz_landau.apow.dialogs.TimeDialogFragment.java

@NonNull
@Override//from w w w .j a  v  a2 s. com
public Dialog onCreateDialog(Bundle savedInstanceState) {
    setRetainInstance(true);
    mTarget = this.getTag();
    return new TimePickerDialog(getActivity(), timeSetListener, mCalendar.get(Calendar.HOUR_OF_DAY),
            mCalendar.get(Calendar.MINUTE), DateFormat.is24HourFormat(getActivity()));
}

From source file:pl.selvin.android.listsyncsample.app.TimePickerFragment.java

@Override
@NonNull//from ww w.jav a  2 s  .  co m
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final Calendar calendar = getCalendar();
    return new TimePickerDialog(getActivity(), this, calendar.get(Calendar.HOUR_OF_DAY),
            calendar.get(Calendar.MINUTE), true);
}

From source file:br.org.funcate.dynamicforms.FormTimePickerFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    return new TimePickerDialog(getActivity(), this, hourOfDay, minute, is24);
}

From source file:com.example.android.DateTimePickers.TimePickerFragment.java

/**
 * Creates the time picker dialog with the current time from Calendar.
 * @param savedInstanceState    Saved instance
 * @return TimePickerDialog     The time picker dialog
 *//*from ww  w  .j  a va2s . c om*/
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    // Use the current time as the default values for the picker.
    final Calendar c = Calendar.getInstance();
    int hour = c.get(Calendar.HOUR_OF_DAY);
    int minute = c.get(Calendar.MINUTE);

    // Create a new instance of TimePickerDialog and return it.
    return new TimePickerDialog(getActivity(), this, hour, minute, DateFormat.is24HourFormat(getActivity()));
}

From source file:org.chaos.fx.cnbeta.theme.TimePickerDialogFragment.java

@NonNull
@Override//from  w  w  w .  j  av  a 2 s  .c  o  m
public Dialog onCreateDialog(Bundle savedInstanceState) {
    int hour = 0;
    int minute = 0;
    if (getArguments() != null) {
        hour = getArguments().getInt(KEY_HOUR_OF_DAY);
        minute = getArguments().getInt(KEY_MINUTE);
    }
    return new TimePickerDialog(getActivity(), mTimeSetListener, hour, minute,
            DateFormat.is24HourFormat(getActivity()));
}

From source file:nz.al4.airclock.TimePickerFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    mCallback = (OnAlarmTimePickedListener) getActivity();

    // Create a new instance of TimePickerDialog and return it
    return new TimePickerDialog(getActivity(), this, 0, 0, DateFormat.is24HourFormat(getActivity()));
}

From source file:org.libreoffice.impressremote.fragment.TimerEditingDialog.java

@Override
public Dialog onCreateDialog(Bundle aSavedInstanceState) {
    TimePickerDialog aDialog = new TimePickerDialog(getActivity(), this, getHours(mMinutes),
            getMinutes(mMinutes), IS_24_HOUR_VIEW);

    aDialog.setTitle(R.string.title_timer);

    aDialog.setButton(DialogInterface.BUTTON_POSITIVE, getString(R.string.button_save), this);
    aDialog.setButton(DialogInterface.BUTTON_NEUTRAL, getString(R.string.button_remove), this);

    return aDialog;
}

From source file:com.hyperaware.conference.android.fragment.TimePickerDialogFragment.java

@NonNull
@Override/*w  w w. j  ava  2s .  c  o  m*/
public Dialog onCreateDialog(Bundle savedInstanceState) {
    return new TimePickerDialog(getActivity(), this, hourOfDay, minute,
            DateFormat.is24HourFormat(getActivity()));
}

From source file:com.finchuk.clock2.dialogs.SystemTimePickerDialog.java

@NonNull
@Override/*from w w  w  .  j  av a 2s .  c  o  m*/
public Dialog onCreateDialog(Bundle savedInstanceState) {
    return new TimePickerDialog(getActivity(), this, mInitialHourOfDay, mInitialMinute, mIs24HourMode);
}

From source file:org.svij.taskwarriorapp.ui.TimePickerFragment.java

public Dialog onCreateDialog(Bundle savedInstanceState) {
    final Calendar cal = Calendar.getInstance();

    Date date = new Date(timestamp);
    if (!DateFormat.getTimeInstance().format(date).equals("01:00:00")) {
        cal.setTime(date);//from ww  w  .ja va2  s.c om
    }

    int hour = cal.get(Calendar.HOUR_OF_DAY);
    int minute = cal.get(Calendar.MINUTE);

    return new TimePickerDialog(getActivity(), onTimeSet, hour, minute, true);
}