1

I have a simple/default TimePickerDialog:

TimePickerDialog timePickerDialog = new TimePickerDialog(getActivity());
timePickerDialog.setTitle("Select Time");
timePickerDialog.show();

My problem:

No matter how the device dimension (4", 7", 10"...) , the dialog always take the full screen size when it's shown (screenshot below).

My question:

Is it possible to scale (not resize) the dialog view?

Like this:

PS:

1) I don't want to use a Dialog with a custom view.

2) This is what i get when i resize the dialog:

 Display display =((WindowManager)getActivity().getSystemService(getActivity().WINDOW_SERVICE)).getDefaultDisplay();
 int width = display.getWidth();
 int height=display.getHeight();

 timePickerDialog.getWindow().setLayout((width) / 2, (height) / 2);

Rami
  • 7,879
  • 12
  • 36
  • 66

1 Answers1

1

Create your own time picker dialog by extending it.

read the following thread.

Show TimePicker with minutes intervals in android

Community
  • 1
  • 1