In android application, I have used TimePickerDialog
and DatePickerDialog
. I want to develop this app in all different screen sizes.
The problem is, this dialog size is the same on all screen sizes. Dialog does not adjust its size as the size of the screen changes. So, on a smaller screen, the content of the dialog is cut off.
How can I adjust this dialog?
below is output I am getting in different size device. I even can't able to scroll in this dialog
Code of DatePickerdialog:
DatePickerDialog datePicker;
editText_date.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
datePicker = new DatePickerDialog(mActivity,new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int y, int m, int d) {
//other code here
}
},yy,mm,dd);
//allow only future dates
datePicker.getDatePicker().setMinDate(System.currentTimeMillis());
datePicker.getDatePicker().setMaxDate(maxDate.getTimeInMillis());
datePicker.show();
}
});