Ti.UI.ShortcutItem class needs lot of refactoring and improvements as listed below:
- icon property does not accept Ti.File.nativePath string to create downloaded remote icons, it supports only the bundled icons as of now in the form of drawable which limits its usage.
- While adding two shortcut items with same icon, one of the item does not shown icon (shown in attached screenshot)
- Adding multiple shortcuts (out of maximum allowed) throw error. It should check and provide a support for knowing maximum shortcuts allowed as described HERE (shown in attached screenshot)
- Before creating icon in proxy-class, it should be checked for their maximum dimension allowed as per getIconMaxWidth() and getIconMaxHeight().
- Add feature to remove shortcut by just passing the ID since the current way to remove shortcut is to first create it & then calling its hide() method which seems odd.
- Add feature to remove all shortcuts with a single call using removeAllDynamicShortcuts() method from native side. A common method for Titanium can be used for this point and the one above.
- Return a list of all shortcuts added so we don't need to keep a track in app. Refer getShortcuts() or the getDynamicShortcuts() method.