I’m writing an android tv app with lean-back and I want to use android standard date picker and I want to make this like this pic
(eg: Made year part bigger when the user is selecting year and so on)
You cannot use the standard date picker in Android TV apps because it was not designed for navigation using D-Pad. However, you can create your own widgets for day, month and year selection. You can simply use VerticalGridView to create them. For instance, you can do something similar to this for days:
customArrayObjectAdapterDays = new CustomArrayObjectAdapter(new DatePartPresenter(getContext()));
for (int i = 1; i < 31; i++) {
customArrayObjectAdapterDays.add(i);
}
2
Answers
Use three different NumberPicker and write some custom logic for day, month and year.
You cannot use the standard date picker in Android TV apps because it was not designed for navigation using D-Pad. However, you can create your own widgets for day, month and year selection. You can simply use VerticalGridView to create them. For instance, you can do something similar to this for days:
You also have to set the number of days (28, 29, 30, 31) depending on the year and selected month.