[TIMOB-20000] Rename appearance properties to keyboardAppearance
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2015-11-24T19:03:41.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 5.2.0 |
| Components | iOS |
| Labels | qe-5.2.0 |
| Reporter | Fokke Zandbergen |
| Assignee | Angel Petkov |
| Created | 2015-11-17T08:40:18.000+0000 |
| Updated | 2016-01-22T00:42:37.000+0000 |
Description
The TextField and [TextArea.appearance](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TextArea-property-appearance) properties should be renamed to
keyboardAppearance to better describe what appearance they are about.
TIMOB-19940 has already used this new name for adding appearance control to the AlertDialog input fields. To prevent confusion we should resolve this ticket together.
[~fokkezb] What is with the SearchBar, can we set it there, too?
That weirdo has
keyboardType(so not appearance) without documenting what the value can be: https://appcelerator.github.io/appc-docs/latest/#!/api/Titanium.UI.SearchBar-property-keyboardType https://github.com/appcelerator/titanium_mobile/blob/bc85170157d3bebc5de1d61a9fe6e34bce84a8c9/iphone/Classes/TiUISearchBar.m#L102 We should rename that tokeyboardAppearanceas well and while we're at it see if we can addreturnKeyTypeas well.keyboardType != keyboardAppearence
Not? What's the difference?
-
keyboardTypeconfigures the keyboard type (number pad, email, phone pad, ascii, etc.) -keyboardAppearanceconfigures the keyboard appearance (default, light, dark, alert)O shoot, yes... sorry :) Well, it's missing documentation https://appcelerator.github.io/appc-docs/latest/#!/api/Titanium.UI.SearchBar-property-keyboardType
PR pending https://github.com/appcelerator/titanium_mobile/pull/7459/files Demo Code:
Expected Results : A warning stating that keyboard_twitter and keyboard_ASCII is deprecated. A warning stating that appearance is deprecated in favor of keyboardApperance.Ti.UI.setBackgroundColor('white'); var win = Ti.UI.createWindow({ title: 'Click window to test' }); var field = Ti.UI.createTextArea({ width : 300, height : 50, top : 200, right : 0 , backgroundColor : "#f0f0f0", value : "Hello", keyboardType : Titanium.UI.KEYBOARD_ASCII, appearance: Titanium.UI.KEYBOARD_APPEARANCE_LIGHT, }); var textField = Ti.UI.createTextField({ borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED, color : '#336699', top : 100, right : 0, width : 250, height : 60, backgroundColor :'Green', keyboardType : Titanium.UI.KEYBOARD_TWITTER, appearance : Titanium.UI.KEYBOARD_APPEARANCE_DARK }); var search = Titanium.UI.createSearchBar({ barColor :'#000', showCancel :true, height :43, top :20, left :0, keyboardType : Titanium.UI.KEYBOARD_TYPE_URL, keyboardAppearance : Titanium.UI.KEYBOARD_APPEARANCE_DARK }); field.autocorrect = false; win.add(textField); win.add(field); win.add(search); win.open();QE: Changes done as part of TIMOB-19939. Please check that ticket for demo code.
Verified as fixed, with SDK
5.2.0.v20160114021251Receive DEPRECATED warning messages in console as per the expected results. Tested on: iPhone 6s Plus Device (9.2) Mac OSX El Capitan 10.11 (15A284) Ti SDK: 5.2.0.v20160114021251 Appc NPM: 4.2.2 App CLI: 5.2.0-220 Xcode 7.2 Node v4.2.3 *Closing Ticket.*