[AC-303] Date Picker (Calendar View) on Android 5.0 not detecting selection.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Cannot Reproduce |
Resolution Date | 2015-11-14T00:56:21.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | android-5, datepicker, lollipop |
Reporter | Paul Flood |
Assignee | Shak Hossain |
Created | 2015-08-14T14:19:56.000+0000 |
Updated | 2015-11-14T00:56:21.000+0000 |
Description
Using the example code found in the Kitchen Sink shown below the selection made on the calendar has no effect. The changed event listener doesn't detect any interaction. On Android 5.1 the code works fine. All versions before 5.0 use the Android UI spinner not the 'usespinner:true' version and work fine.
var minDate = new Date();
minDate.setFullYear(2009);
minDate.setMonth(0);
minDate.setDate(1);
var maxDate = new Date();
maxDate.setFullYear(2009);
maxDate.setMonth(11);
maxDate.setDate(31);
var value = new Date();
value.setFullYear(2009);
value.setMonth(0);
value.setDate(1);
var picker = Ti.UI.createPicker({
type:Ti.UI.PICKER_TYPE_DATE,
minDate:minDate,
maxDate:maxDate,
value:value,
calendarViewShown: false
});
// turn on the selection indicator (off by default)
picker.selectionIndicator = true;
picker_Win.add(picker);
var label = Ti.UI.createLabel({
text:'Choose a date',
top:6,
width:'auto',
height:'auto',
textAlign:'center',
color:'white'
});
picker_Win.add(label);
picker.addEventListener('change',function(e)
{
label.text = e.value.toLocaleString();
});
Attachments
File | Date | Size |
---|---|---|
Screen Shot 2015-08-13 at 20.46.34.png | 2015-08-14T14:17:38.000+0000 | 65043 |
Found a workaround for this but the calendar view issue is still there. Details on the workaround are here https://community.appcelerator.com/topic/2989/android-5-0-datepicker-not-working/2.
Tested this issue in our updated environment. Date Picker *change* event is now working for android 5.0.0 with latest SDK. I tested this using the 5.1.0.v20151104190037 and Google Nexus 6 - 5.0.0 - API 21 - 1440x2560. *change* event log
*Environment*