List of usage examples for android.widget DatePicker setSpinnersShown
@Deprecated public void setSpinnersShown(boolean shown)
From source file:me.tipi.kiosk.ui.fragments.IdentityFragment.java
/** * Style date picker./* w ww. j a v a 2 s .c o m*/ * * @param datePicker the date picker */ private void styleDatePicker(DatePicker datePicker) { datePicker.setCalendarViewShown(false); datePicker.setSpinnersShown(true); LinearLayout llFirst = (LinearLayout) datePicker.getChildAt(0); LinearLayout llSecond = (LinearLayout) llFirst.getChildAt(0); for (int i = 0; i < llSecond.getChildCount(); i++) { NumberPicker picker = (NumberPicker) llSecond.getChildAt(i); // NumberPickers in llSecond Field[] pickerFields = NumberPicker.class.getDeclaredFields(); for (Field pf : pickerFields) { if (pf.getName().equals("mSelectionDivider")) { pf.setAccessible(true); try { pf.set(picker, ContextCompat.getDrawable(getActivity(), R.drawable.picker_divider)); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (Resources.NotFoundException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } break; } } } }