VitaliiBlagodir / cordova-plugin-datepicker

MIT License
318 stars 351 forks source link

Theme name changes - Android API 23 #180

Open wallstudios opened 8 years ago

wallstudios commented 8 years ago

Just noticed on api 22 and up (android) that the theme names seem to have changed. I've added an extended option list to the DatePicker.js to test. I'm sure there is a better way to do this. seeing as they are the same themes just a different name.

Perhaps a version check somewhere in the code and use the correct name based on the api version.

eg if api 23 or greater for option 1 use "Theme_Material_Dialog_Alert" etc.

http://developer.android.com/reference/android/app/AlertDialog.html "THEME_TRADITIONAL This constant was deprecated in API level 23. Use Theme_Material_Dialog_Alert."

    DatePicker.prototype.ANDROID_THEMES = {
      THEME_TRADITIONAL          : 1, // default
      THEME_HOLO_DARK            : 2,
      THEME_HOLO_LIGHT           : 3,
      THEME_DEVICE_DEFAULT_DARK  : 4,
      THEME_DEVICE_DEFAULT_LIGHT : 5,
      Theme_Material_Dialog_Alert : 6,
      Theme_Material_Dialog_Alert : 7,
      Theme_Material_Light_Dialog_Alert : 8,
      Theme_DeviceDefault_Dialog_Alert : 9,
      Theme_DeviceDefault_Light_Dialog_Alert : 10  
      };
jasoneastburn commented 8 years ago

I have issues with API 23 on Android with the dialog having extra white space along the right side. Has anyone encountered that and/or any known fix?