I have added a date picker which is show once user clicks a view and date picker appears and user can select date on some devices date picker is not showing properly and user is unable to select date. Below screenshot is from Samsung J7 Android version 7.1.1.

code i'm using for date picker is this
public void initDatePicker(final TextView textView) {
Calendar calendar = Calendar.getInstance();
DatePickerDialog dialog = new DatePickerDialog(this, (view, year, month, dayOfMonth) -> {
Date date = new Date();
Calendar c = Calendar.getInstance();
c.set(Calendar.YEAR, year);
c.set(Calendar.MONTH, month);
c.set(Calendar.DAY_OF_MONTH, dayOfMonth);
// and get that as a Date
Date dateSpecified = c.getTime();
if (dateSpecified.before(date)) {
((TextView)findViewById(R.id.tv_date)).setTextColor(getResources().getColor(R.color.red));
UIHelper.showShortToastInCenter(this, "Selected Date is in Past");
} else {
DateSelected = dateSpecified;
String predate = new SimpleDateFormat("EEE,MMM d").format(c.getTime());
String predateNew = new SimpleDateFormat("dd/MM/yyyy").format(c.getTime());
textView.setText(predate);
textView.setPaintFlags(Typeface.BOLD);
dateStr = predateNew;
}
},
calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH),
calendar.get(Calendar.DAY_OF_MONTH)
);
Calendar min = Calendar.getInstance();
min.set(calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH),
calendar.get(Calendar.DAY_OF_MONTH));
dialog.getDatePicker().setMinDate(min.getTimeInMillis());
Calendar max = Calendar.getInstance();
max.set(calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH),
calendar.get(Calendar.DAY_OF_MONTH) + 30);
dialog.getDatePicker().setMaxDate(max.getTimeInMillis());
dialog.getDatePicker().setEnabled(true);
dialog.show();
}
here is the theme of activity
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="colorPrimary">@color/colorAccent</item>
<item name="colorPrimaryDark">@color/colorAccent</item>
<item name="colorAccent">@color/colorAccent</item>
</style>