DateTimePicker for Wear OS (from Wear OS Settings)
Original (Wear OS Settings)
Library
Original (Wear OS Settings)
Library
dependencies {
implementation 'com.kimjio:weardatetimepicker:1.0'
}
//DatePicker
new DatePickerDialog(/* context */ this)
.setOnDateSetListener(new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
//TODO date
}
})
.show();
//TimePicker
new TimePickerDialog(/* context */ this, /* 24 hours */ true)
.setOnTimeSetListener(new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
//TODO time
}
})
.show();
<layout>
<!-- DatePicker -->
<com.kimjio.wear.datetimepicker.widget.DatePicker
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<!-- TimePicker -->
<com.kimjio.wear.datetimepicker.widget.TimePicker
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</layout>
Wear OS 3 design
WearableListView to WearableRecyclerView
xml attrs