I'm using DataPicker to implement Data Dialog: import android.widget.DatePicker;
When I tested on API < 21 there is no problem:
But on API > 21 there is problem (I think because of material design) dialog looks:
And sometimes there are scaled buttons, corners etc. I would like to have identical design for both cases.
How to force not to use the android material design in this case ?
Method:
public Dialog ShowDate(final Context context, String title,
OnClickListener listener, int year, int mounth, int day) {
Dialog dialog = new Dialog(context);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View mView = inflater.inflate(R.layout.date_picker, null);
DatePicker date = (DatePicker) mView.findViewById(R.id.date);
TextView titleDate = (TextView) mView.findViewById(R.id.titleDate);
titleDate.setText(title);
Button cancel = (Button) mView.findViewById(R.id.cancelDate);
Button ok = (Button) mView.findViewById(R.id.okDate);
cancel.setOnClickListener(listener);
ok.setOnClickListener(listener);
if (year == 0) {
date.updateDate(1990, 4, 9);
} else {
date.updateDate(year, mounth - 1, day);
}
dialog.setContentView(mView);
dialog.show();
return dialog;
}

