File tree 2 files changed +19
-0
lines changed
android/modules/ui/src/java/ti/modules/titanium/ui/widget/picker
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 7
7
package ti .modules .titanium .ui .widget .picker ;
8
8
9
9
import android .os .Build ;
10
+ import android .view .Gravity ;
10
11
import android .view .View ;
11
12
import android .widget .DatePicker ;
12
13
import android .widget .DatePicker .OnDateChangedListener ;
@@ -100,6 +101,15 @@ public TiUIDatePicker(@NonNull PickerProxy proxy)
100
101
};
101
102
textInputLayout .getEditText ().setOnClickListener (clickListener );
102
103
textInputLayout .setEndIconOnClickListener (clickListener );
104
+
105
+ if (proxy .hasPropertyAndNotNull (TiC .PROPERTY_TEXT_ALIGN )) {
106
+ String textAlign = TiConvert .toString (proxy .getProperty (TiC .PROPERTY_TEXT_ALIGN ));
107
+ if (textAlign .equals ("center" )) {
108
+ textInputLayout .getEditText ().setGravity (Gravity .CENTER_VERTICAL | Gravity .CENTER );
109
+ } else if (textAlign .equals ("right" )) {
110
+ textInputLayout .getEditText ().setGravity (Gravity .CENTER_VERTICAL | Gravity .END );
111
+ }
112
+ }
103
113
view = textInputLayout ;
104
114
}
105
115
}
Original file line number Diff line number Diff line change @@ -409,6 +409,15 @@ properties:
409
409
platforms : [android]
410
410
since : " 5.0.0"
411
411
412
+ - name : textAlign
413
+ summary : |
414
+ Horizontal text alignment of the date picker when using <Titanium.UI.PICKER_TYPE_DATE>.
415
+ type : [String, Number]
416
+ constants : Titanium.UI.TEXT_ALIGNMENT_*
417
+ default : <Titanium.UI.TEXT_ALIGNMENT_LEFT>,
418
+ platforms : [android]
419
+ since : " 12.4.0"
420
+
412
421
- name : datePickerStyle
413
422
summary : Determines how a date or time picker should appear.
414
423
description : |
You can’t perform that action at this time.
0 commit comments