Skip to content

Commit

Permalink
Merge pull request #6 from russelarms/patch-1
Browse files Browse the repository at this point in the history
Apply dark/light theme to android picker
  • Loading branch information
shiv19 authored Dec 27, 2017
2 parents f2cd45d + 4ce22fc commit 16a6211
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/modal-datetimepicker.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,13 @@ export class ModalDatetimepicker {
let startDate = new Date();
if (options.startingDate) startDate = options.startingDate;
try {
let themeId = android.app.AlertDialog.THEME_DEVICE_DEFAULT_LIGHT;
if (options.theme && options.theme === "dark") {
themeId = android.app.AlertDialog.THEME_DEVICE_DEFAULT_DARK;
}
let datePicker = new android.app.DatePickerDialog(app.android.foregroundActivity,
new android.app.DatePickerDialog.OnDateSetListener({
themeId,
new android.app.DatePickerDialog.OnDateSetListener({
onDateSet: function(view, year, monthOfYear, dayOfMonth) {
const date = {
"day": dayOfMonth,
Expand Down

0 comments on commit 16a6211

Please sign in to comment.