
org.robolectric.shadows.ShadowTimePickerDialog Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of shadows-framework Show documentation
Show all versions of shadows-framework Show documentation
An alternative Android testing framework.
The newest version!
package org.robolectric.shadows;
import static org.robolectric.util.reflector.Reflector.reflector;
import android.app.TimePickerDialog;
import android.widget.TimePicker;
import org.robolectric.annotation.Implements;
import org.robolectric.annotation.RealObject;
import org.robolectric.util.reflector.Accessor;
import org.robolectric.util.reflector.ForType;
@Implements(value = TimePickerDialog.class)
public class ShadowTimePickerDialog extends ShadowAlertDialog {
@RealObject protected TimePickerDialog realTimePickerDialog;
public int getHourOfDay() {
return reflector(TimePickerDialogProvider.class, realTimePickerDialog)
.getTimePicker()
.getCurrentHour();
}
public int getMinute() {
return reflector(TimePickerDialogProvider.class, realTimePickerDialog)
.getTimePicker()
.getCurrentMinute();
}
public boolean getIs24HourView() {
return reflector(TimePickerDialogProvider.class, realTimePickerDialog)
.getTimePicker()
.is24HourView();
}
@ForType(TimePickerDialog.class)
interface TimePickerDialogProvider {
@Accessor("mTimePicker")
TimePicker getTimePicker();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy