{ "id": "175199", "key": "TIMOB-27990", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "20950", "name": "Release 9.1.0", "archived": false, "released": true, "releaseDate": "2020-08-25" } ], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2020-07-17T21:18:29.000+0000", "created": "2020-06-27T04:20:44.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "api", "defect" ], "versions": [], "issuelinks": [ { "id": "58562", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "174999", "key": "TIMOB-27889", "fields": { "summary": "Android: Implement Ti.UI.Shortcut", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-07-17T21:18:29.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Ti.UI.ShortcutItem class needs lot of refactoring and improvements as listed below:\r\n\r\n*Issues:*\r\n# _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.\r\n# While adding two shortcut items with same icon, one of the item does not shown icon (shown in attached screenshot)\r\n# Adding multiple shortcuts (out of maximum allowed) throw error. It should check and provide a support for knowing maximum shortcuts allowed as described [HERE|https://developer.android.com/reference/android/content/pm/ShortcutManager#getMaxShortcutCountPerActivity()] (shown in attached screenshot)\r\n# Before creating icon in proxy-class, it should be checked for their maximum dimension allowed as per [getIconMaxWidth() and getIconMaxHeight()|https://developer.android.com/reference/android/content/pm/ShortcutManager#getIconMaxWidth()].\r\n\r\n*Feature Request:*\r\n# 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.\r\n# Add feature to remove all shortcuts with a single call using [removeAllDynamicShortcuts() method|https://developer.android.com/reference/android/content/pm/ShortcutManager#removeAllDynamicShortcuts()] from native side. A common method for Titanium can be used for this point and the one above.\r\n# Return a list of all shortcuts added so we don't need to keep a track in app. Refer [getShortcuts()|https://developer.android.com/reference/android/content/pm/ShortcutManager#getShortcuts(int)] or the [getDynamicShortcuts()|https://developer.android.com/reference/android/content/pm/ShortcutManager#getDynamicShortcuts()] method.\r\n# ", "attachment": [ { "id": "67462", "filename": "shortcut-2.png", "author": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-06-27T04:19:59.000+0000", "size": 821843, "mimeType": "image/png" }, { "id": "67461", "filename": "shortcut-max.png", "author": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-06-27T04:19:57.000+0000", "size": 218421, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: Ti.UI.ShortcutItem has lot of issues", "creator": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "SDK: 9.0.3.GA\r\nCLI: 8.0.0", "closedSprints": [ { "id": 1201, "state": "closed", "name": "2020 Sprint 14", "startDate": "2020-07-06T15:40:00.000Z", "endDate": "2020-07-17T15:40:00.000Z", "completeDate": "2020-07-20T22:16:28.367Z", "originBoardId": 114 }, { "id": 1199, "state": "closed", "name": "2020 Sprint 13", "startDate": "2020-06-19T16:41:04.099Z", "endDate": "2020-07-02T16:41:00.000Z", "completeDate": "2020-07-02T15:37:12.455Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "455949", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Issue 3 can be fixed like this: https://github.com/appcelerator/titanium_mobile/pull/11798\r\n\r\nIt would be nicer to have ShortcutManager and not just the items. Then you could expose the other parts (like the maxLimit, catch errors, get existing shortcuts)", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-06-27T14:47:24.000+0000", "updated": "2020-06-27T14:47:24.000+0000" }, { "id": "455950", "author": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Using try-catch is not an ideal fix, rather checking about maximum allowed shortcuts is.", "updateAuthor": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-06-27T14:58:55.000+0000", "updated": "2020-06-27T14:58:55.000+0000" }, { "id": "455951", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Tried that: max returned 10 for me but I was only able to create 5! Not sure why there was a difference. That's why I went with the try/catch one", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-06-27T15:01:09.000+0000", "updated": "2020-06-27T15:01:09.000+0000" }, { "id": "455952", "author": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Perhaps that's because the count is a sum of STATIC & DYNAMIC shortcuts. It is recommended on [Android Docs|https://developer.android.com/guide/topics/ui/shortcuts/best-practices] to use only upto 4 shortcuts due to the device's launcher's restrictions.\r\n\r\nMaybe we should log a warning not to create more than 4 shortcuts as it's also not visually appealing.", "updateAuthor": { "name": "prashant_saini", "key": "prashant_saini", "displayName": "Prashant Saini", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-06-27T15:18:23.000+0000", "updated": "2020-06-27T15:19:27.000+0000" }, { "id": "455961", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This will be fixed by https://github.com/appcelerator/titanium_mobile/pull/11759", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-06-29T22:27:21.000+0000", "updated": "2020-06-29T22:27:21.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }