[TIMOB-20281] Windows: Implement enabled property for View
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2016-02-10T19:26:11.000+0000 |
| Affected Version/s | Release 5.1.0 |
| Fix Version/s | Release 5.3.0 |
| Components | Windows |
| Labels | parity, qe-5.3.0 |
| Reporter | Kota Iguchi |
| Assignee | Gary Mathews |
| Created | 2016-01-28T05:02:26.000+0000 |
| Updated | 2016-04-26T20:37:33.000+0000 |
Description
Implement
View.enabled property. It's undocumented property but Android has it, and it makes sens to make backgroundDisabledColor/Image property work.
var win = Ti.UI.createWindow();
var view = Ti.UI.createView({
enabled: false,
backgroundDisabledColor:'gray'
});
win.add(view);
win.open();
PR: https://github.com/appcelerator/titanium_mobile_windows/pull/555
[~gmathews] Tested on both Windows 8.1 / 10.0 devices. It seems that
enabledoutput is inverted, setting it tofalsewill show the view, and setting it totruewill hide it. Tested on: Windows 10 Pro Windows Phone 10.0 & 8.1 (Microsoft Lumia 640 LTE) Appc Studio: 4.6.0.201604081249 Ti SDK: 5.3.0.v20160421080259 Appc NPM: 4.2.5-3 Appc Core: 5.3.0-34 Node: v4.4.2[~htbryant] Could you provide a test code for it? I think
enabledproperty should be nothing to do with component visibility (hide/show) but component availability, for example disablingTextFieldshould stop accepting user's input for the TextField. Here's my test code (tested on 5.3.0.v20160415121959).var win = Ti.UI.createWindow({ backgroundColor: 'green', layout: 'vertical' }); var searchText = Ti.UI.createTextField({width:Ti.UI.FILL, height: '10%', enabled: false}); win.addEventListener('open', function () { setTimeout(function () { searchText.enabled = true; }, 5000); }); win.add(searchText); win.open();