I'm doing an Android application and I have to show a DatePickerDialog. The fact is that the application will be on a device with a smart screen and the calendar doesn't fit in it. I would like the calendar to be smaller while keeping the same proportions.
I tried to use the ScaleY
and ScaleX
functions on the DatePicker to resize it but it just resizes all the DatePickers.
Here's the code I use to show the DatePickerDialog
public void ShowDate() {
final Calendar c = Calendar.getInstance();
year = c.get(Calendar.YEAR);
month = c.get(Calendar.MONTH);
day = c.get(Calendar.DAY_OF_MONTH);
DatePickerDialog dateForm = new DatePickerDialog(ViewForm.this, R.style.ColorOne, new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker datePicker, int year, int monthOfYear, int dayOfMonth) {
}
}, year, month, day);
dateForm.show();
DatePicker dp = dateForm.getDatePicker();
dp.setScaleY(Float.parseFloat("0.5"));
dp.setScaleX(Float.parseFloat("0.5"));
}
I hope someone will know how to do this
Thank you