Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3504] Theme property for datepicker

GitHub Issuen/a
TypeNew Feature
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2016-04-26T18:27:25.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterRainer Schleevoigt
AssigneeShak Hossain
Created2016-04-14T10:28:33.000+0000
Updated2016-04-26T18:53:22.000+0000

Description

With binding the app to a theme I would modify the colors etc. of date picker. But maybe an app has different departments and for every part I need different colors. Conclusion: We need a theme property in datepicker like we have in window.
var picker = Ti.UI.createPicker({
	theme : 'Theme.firstColor',	
        type : Ti.UI.PICKER_TYPE_DATE,
	minDate : new Date(2009, 0, 1),
	maxDate : Moment().toDate(),
	value : parent.date.toDate(),
	locale : 'de'
});

Comments

  1. Nazmus Salahin 2016-04-18

    Hello, Thanks for the query. Style of datepicker in Appcelerator can be customized as it can be customized on native android. You have to add the picker in a window and you can add a theme in that window. In that theme you can customize the datepicker item like this:
       <item name="android:datePickerStyle">@style/datepicker</item>
       
    *Sample Custom Theme XML*
       <?xml version="1.0" encoding="utf-8"?>
       <resources xmlns:android="http://schemas.android.com/apk/res/android">
       	<style name="LightDarkBar" parent="Theme.AppCompat.Light.DarkActionBar">
       		<item name="android:datePickerStyle">@style/datepicker</item>
       	</style>
       	<style name="datepicker" parent="Theme.AppCompat.Light.Dialog">
       		<item name="colorPrimary">#fff000</item>
       	</style>
       </resources>
       
    Thanks
  2. Rainer Schleevoigt 2016-04-18

    Thanks for quick answer. The picker inherits from parent (window). But I have in window different sections (scrollableView) and depending of view I dream of different colors. Background: we have a couple of radiostations with own colors. Depending of station we looking for different colors. Is it possible to change the theme of windows dynamicly?
  3. Nazmus Salahin 2016-04-19

    Hi [~titanium@webmasterei-hamburg.de], You cannot change the theme of an existing window, so you'd need to close the existing window and reopen it with the newly selected theme as the value for "theme" in the params for createWindow(). It’s a known fact in Native Android that themes cannot be changed during run time. If the new theme change has to be reflected in the application, all the views have to be re-inflated, as the theme based values are parsed only once during inflation. Thanks
  4. Sharif AbuDarda 2016-04-20

    Hello [~titanium@webmasterei-hamburg.de], As you are requesting a new feature, It always better to provide example screenshots of the said feature available in native platform. Please provide example of the feature done in native android. Regards, Sharif.
  5. Rainer Schleevoigt 2016-04-26

    Which native element will called by using of datapicker?

JSON Source