In the linked ticket there was some inconsistencies around setters that existed on one platform but not the other, but were documented to exist on both. In order to make sure we're clean, I took a look through the JSCA file to try and see if there were anymore that existed here. My criteria was (script attached)
* Have to be under Titanium namespace (but not XML)
* Are not deprecated already
* Have a corresponding read-write property
* Getter has 0 arguments, setter has 1 argument
This gave me the below potential problematic APIs
{
"getters": [
{
"function": "getTabs",
"parent": "Titanium.UI.TabGroup"
}
],
"setters": [
{
"function": "setCheckable",
"parent": "Titanium.Android.MenuItem"
},
{
"function": "setChecked",
"parent": "Titanium.Android.MenuItem"
},
{
"function": "setEnabled",
"parent": "Titanium.Android.MenuItem"
},
{
"function": "setVisible",
"parent": "Titanium.Android.MenuItem"
},
{
"function": "setTimeout",
"parent": "Titanium.Network.HTTPClient"
},
{
"function": "setWindow",
"parent": "Titanium.UI.Tab"
},
{
"function": "setHeaderPullView",
"parent": "Titanium.UI.TableView"
}
],
"isers": [
{
"function": "isCheckable",
"parent": "Titanium.Android.MenuItem"
},
{
"function": "isChecked",
"parent": "Titanium.Android.MenuItem"
},
{
"function": "isEnabled",
"parent": "Titanium.Android.MenuItem"
},
{
"function": "isVisible",
"parent": "Titanium.Android.MenuItem"
},
{
"function": "isSupported",
"parent": "Titanium.App.iOS.UserActivity"
},
{
"function": "isLooping",
"parent": "Titanium.Media.Sound"
},
{
"function": "isPaused",
"parent": "Titanium.Media.Sound"
}
]
}
If these are incorrectly documented they need the same treatment as this commit
This may also apply to some of the "is" APIs? Edit: yes it does, updated list and script
* TabGroup.getTabs - done in https://github.com/appcelerator/titanium_mobile/commit/580cffc90d27d5b21d5fbb9de34bc9bb73f923a7 * MenuItem.setCheckable (Android only) - Does not exist * MenuItem.setChecked (Android only) - Does not exist * MenuItem.setEnabled (Android only) - Does not exist * MenuItem. setVisible (Android only)- Does not exist * HTTPClient.setTimeout - Does not exist on either platform * Tab.setWindow - exists on Android, does not exist on iOS * TableView.setHeaderPullView (iOS only) - Does not exist Only one that isn't clearcut (i.e. it's obvious the docs are invalid) is Tab.setWindow, I think this is the same as in https://github.com/appcelerator/titanium_mobile/pull/12661 and should be reworked? Everything else is clearcut and should be marked as deprecated/removed in 10
* MenuItem.isCheckable (Android only) - Does not exist * MenuItem.isChecked (Android only) - Does not exist * MenuItem.isEnabled (Android only) - Does not exist * MenuItem.isVisible (Android only)- Does not exist * UserActivity.isSupported (iOS only) - Exists is valid per TIMOB-19510 * Sound.isLooping - Does not exist on Android, exists on iOS * Sound.isPlaying - Does not exist on Android, exists on iOS
I think the read-write should only be applicable for setter methods, get/is should probably only look for if a property exists, which adds the following: * Intent.getData (Android only) - Does not exist * HTTPClient.getAllResponseHeaders - Exists on both platforms * MenuItem.isActionViewExpanded (Android only) - Does not exist * ResultSet.isValidRow - Exists on both platforms * Sound.isPaused - Does not exist on Android, exists on iOS
PR for comments: https://github.com/appcelerator/titanium_mobile/pull/12677 Not marking for review as there is technically work to be done still, I just want opinions on what that work should be: * Remove the APIs fully now across both platforms * Mark as removed/deprecated on the right platform, and only deprecate on the platform with a view to remove properly in future cc [~cwilliams] [~jquick] [~vijaysingh] [~gmathews] whatcha thinking?
Test case (requires the attached
cat.mp3
file in the Resources directory)https://github.com/appcelerator/titanium_mobile/pull/12692
merged to master and 10_0_X branches