Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary TimePickerDialog constructor shadow #6838

Merged
merged 1 commit into from Nov 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -3,13 +3,9 @@
import static org.robolectric.util.reflector.Reflector.reflector;

import android.app.TimePickerDialog;
import android.content.Context;
import android.widget.TimePicker;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import org.robolectric.annotation.RealObject;
import org.robolectric.shadow.api.Shadow;
import org.robolectric.util.ReflectionHelpers.ClassParameter;
import org.robolectric.util.reflector.Accessor;
import org.robolectric.util.reflector.ForType;

Expand All @@ -18,24 +14,6 @@ public class ShadowTimePickerDialog extends ShadowAlertDialog {
@RealObject
protected TimePickerDialog realTimePickerDialog;

@Implementation
protected void __constructor__(
Context context,
int theme,
TimePickerDialog.OnTimeSetListener callBack,
int hourOfDay,
int minute,
boolean is24HourView) {

Shadow.invokeConstructor(TimePickerDialog.class, realTimePickerDialog,
ClassParameter.from(Context.class, context),
ClassParameter.from(int.class, theme),
ClassParameter.from(TimePickerDialog.OnTimeSetListener.class, callBack),
ClassParameter.from(int.class, hourOfDay),
ClassParameter.from(int.class, minute),
ClassParameter.from(boolean.class, is24HourView));
}

public int getHourOfDay() {
return reflector(TimePickerDialogProvider.class, realTimePickerDialog)
.getTimePicker()
Expand Down