{ "id": "151060", "key": "TIMOB-19486", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": [], "resolution": null, "resolutiondate": null, "created": "2015-09-09T21:45:00.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "cb-tooling" ], "versions": [], "issuelinks": [ { "id": "50674", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "151494", "key": "TISTUD-7727", "fields": { "summary": "Studio: Make Icon in tiapp.xml work", "status": { "description": "This issue is being actively worked on at the moment by the assignee.", "name": "In Progress", "id": "3", "statusCategory": { "id": 4, "key": "indeterminate", "colorName": "yellow", "name": "In Progress" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } }, { "id": "48982", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "151153", "key": "TIMOB-19509", "fields": { "summary": "DefaultIcon.png needs to support platform specific versions", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } }, { "id": "48931", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "151029", "key": "TIMOB-19477", "fields": { "summary": "Add support for DefaultIcon.png to generate missing app icons/artwork", "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": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-08-29T17:42:19.000+0000", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" }, { "id": "10207", "name": "Tooling" } ], "description": "If any of the app icons are missing, then search for {{/platforms/android/DefaultIcon.png}} and {{/DefaultIcon.png}} and us it to generate missing app icons.\r\n\r\nYou simply need to the base Builder object's {{generateAppIcons()}} method:\r\n\r\n{code}\r\nvar missingIcons = [\r\n {\r\n description: 'Resources//appicon.png - Used for iPhone', // some meaningful description... iOS build dynamically generates this\r\n file: '/path/to/dest.png', // MUST be a png and MUST have an extension\r\n width: 100, // whatever is required\r\n height: 100, // should match width\r\n required: true // when DefaultIcon.png isn't big enough, true will trigger an error and false will skip the icon\r\n }\r\n];\r\n\r\nthis.generateAppIcons(missingIcons, function (err) {\r\n // err is either true if there was an error or undefined if it was successful\r\n});\r\n{code}", "attachment": [ { "id": "58309", "filename": "DefaultIcon.png", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-02-24T09:32:31.000+0000", "size": 91321, "mimeType": "image/png" }, { "id": "58329", "filename": "platform.zip", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-02-25T03:17:23.000+0000", "size": 45707, "mimeType": "application/zip" } ], "flagged": false, "summary": "Android: Generate missing app icons based on DefaultIcon.png", "creator": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "environment": null, "comment": { "comments": [ { "id": "373125", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "PRs: \r\nhttps://github.com/appcelerator/titanium_mobile/pull/7588\r\nhttps://github.com/appcelerator/alloy/pull/763", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2015-12-16T19:05:46.000+0000", "updated": "2016-02-29T21:23:49.000+0000" }, { "id": "377740", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "h4. Test case A Titanium CLI:\r\nBrand new project, replace DefaultIcon.png with the one attached in ticket. *ti create*, *ti build -p android*\r\n\r\nh4. Expected Result:\r\nBuild success. On home screen you should see the app icon to be the same as the one attached on ticket. Also, in build->android->bin->assets->res, you will find the corresponding icon in each drawable folder, with these respective sizes:\r\n||folder||icon size||\r\n|drawable-hdpi|72x72|\r\n|drawable-ldpi|36x36|\r\n|drawable-mdpi|48x48|\r\n|drawable-xhdpi|96x96|\r\n|drawable-xxhdpi|144x144|\r\n|drawable-xxxhdpi|192x192|\r\n", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-02-24T08:56:22.000+0000", "updated": "2016-02-25T03:11:54.000+0000" }, { "id": "377839", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "h4. Test case B:\r\nScenario where DefaultIcon.png exists, and ALL icons described [here|http://docs.appcelerator.com/platform/latest/#!/guide/Icons_and_Splash_Screens-section-29004897_IconsandSplashScreens-LauncherIcon] exists, but are different from DefaultIcon.png. (This is the situation when a user decide to IGNORE the DefaultIcon.png and have his very own other icons). \r\n1. *ti create*\r\n2. unzip attached zip into root of project\r\n3. *ti build -p android*\r\n\r\nh4. Expected Result:\r\nBuild success. User's icons (those in the zip file) should be prioritized over the use of DefaultIcon.png. ", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-02-25T03:16:39.000+0000", "updated": "2016-02-26T07:35:39.000+0000" }, { "id": "377841", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~fmiao] [~cbarber] some critical questions i need to ask here:\r\n\r\n1. Before this implementation, Android takes *resources/android/appicon.png* and stretch/shrink it during build for the respective resolutions. It is not actually necessary to disect it into folders and individual files. So would doing this here be redundant when we can just point it towards a high res DefaultIcon.png instead? If you do intend to just point it towards the DefaultIcon.png, take note of this statement in the guide:\r\n{quote}By default, a newly created Titanium application uses the Resources/android/appicon.png file. The filename must match the name specified in the icon element in your tiapp.xml file.{quote}\r\n\r\n2. Before this implementation. ti developers can control which icon to use for whichever resolution, by putting them in this folder: *platform/android/res/drawable-\\** Chris didn't you say something about how the platform folder shouldn't be used at all?\r\n\r\n3. Feon, for Test case A and B, it doesn't work when using appc. I suppose it's something to do with alloy. But we should address issue #1 and #2 before fixing this on alloy.\r\n\r\n4. Another small bug is, once i build the project once, if i change the DefaultIcon.png to a different image, and build again (without doing *ti clean*), the app icon isn't updated. Also, to address issue #1 and #2 first before looking at this.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-02-25T03:30:49.000+0000", "updated": "2016-02-25T03:34:51.000+0000" }, { "id": "377917", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "1. Android will perform scaling/resizing of images if density specific versions are not provided. We can use a single large appicon, and let Android do the work, but I'm not sure how Android's scaling rules work or it is a good practice, and also the result maybe sub-optimal. \r\n\r\n2. {{/platform/android/res/drawable*}} has been the place for developers to place their density specific versions of the appicon.\r\n\r\n3 & 4. Works for me. Do you see the updated icons under {{/build/android/res/drawable*}}?", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2016-02-25T19:19:14.000+0000", "updated": "2016-02-25T19:19:14.000+0000" }, { "id": "377939", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "1. How confident are we that our scaling rules is better than Android's, or that our results is more optimal? We are pretty much doing the same thing. I guess it's fine as long as the outcome is the same. and we don't create more bugs or issue by introducing this.\r\n\r\n2. Ya. This question is more for [~cbarber].\r\n\r\n3 & 4. I'll test it again\r\n", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-02-26T00:06:45.000+0000", "updated": "2016-02-26T00:06:45.000+0000" }, { "id": "377969", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "OK 1 and 2 is fine now.\r\n\r\nI retried 3. and yes it's behaving correctly. I was misled because *appc new* uses a template whereby there already exists various res icons in platform/android, that's why my changes to DefaultIcon.png has no effect. Can we also include a PR to remove the platform folder in the template used by appc new? And remove assets/android/appicon.png if possible? ", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-02-26T07:27:53.000+0000", "updated": "2016-02-26T07:27:53.000+0000" }, { "id": "377970", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "h4. Test case C:\r\nScenario where DefaultIcon-android.png exists, and the icons described [here|http://docs.appcelerator.com/platform/latest/#!/guide/Icons_and_Splash_Screens-section-29004897_IconsandSplashScreens-LauncherIcon] don't exists, but is different from DefaultIcon.png.\r\n1. *ti create*\r\n2. Include a DefaultIcon-android.png that looks different from DefaultIcon.png in root.\r\n3. *ti build -p android*\r\n\r\nh4. Expected Result:\r\nBuild success. DefaultIcon-android.png should be prioritized over the use of DefaultIcon.png. ", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-02-26T07:37:32.000+0000", "updated": "2016-02-26T07:37:32.000+0000" }, { "id": "377971", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "CR and FT passed. [~fmiao] just consider the removal of platform/android/res/* app icons in the template for *appc new* and we can merge this PR.\r\n\r\nAbove test cases can also be done using appc and the behavior and expected results should be the same.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-02-26T07:39:02.000+0000", "updated": "2016-02-26T07:39:15.000+0000" }, { "id": "378228", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PRs merged", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-03-01T04:28:41.000+0000", "updated": "2016-03-01T04:28:41.000+0000" }, { "id": "378237", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Need another PR to address the need to rebuild everytime because of generating the icons. Need mechanism to check if there's any need to generate icons.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-03-01T07:16:20.000+0000", "updated": "2016-03-01T07:16:20.000+0000" }, { "id": "378439", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~fmiao] Tried to verify whether the missing icons are regenerated whenever DefaultIcon.png changes. However, I discovered a strange bug. Looks like the icon is fickle. Every time I build, the icon switches between 2 different images.\r\n\r\nh4. Steps to reproduce\r\n1. *appc new*\r\n2. replace the DefaultIcon.png with the one attached in ticket\r\n3. *appc run -p android*\r\n4. Repeat 3. Do not clean.\r\n5. Repeat 3. Do not clean.\r\n\r\nh4. Result\r\n3. The app icon appears correctly on the simulator, with the thumbsup.\r\n4. Strangely enough, the app icon changed to the \"alloy\" icon, which can only be found in appicon.png in app/assets/android/\r\n5. Strange again, the app icon changes back to the thumbsup.\r\nAnd icon switches every time we repeat appc run.\r\nAlso take note that, the generated icons (of thumbsup) remains in build/android/bin/assets/res, and still exists there every time we call *appc run*", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-03-02T07:07:47.000+0000", "updated": "2016-03-02T07:08:21.000+0000" }, { "id": "378500", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "The generated files in {{../build/android/res/drawable*}} are wiped out on every alternate build, because they are not changed and fall into the old file watch list. These old files get removed down the build pipeline. Since no density specific images are found the default appicon, {{Resources/android/appicon.png}}, is used. The fix is simple.\r\n\r\nBut chatted with Chris, we think it's less confusing to only generate the missing {{Resources/android/appcion.png}}. If developers want to have different images for different screen densities, they have to do so by putting the files in {{../platform/android/res/drawable-*}}.\r\n\r\n[~cng], [~emerriman] thoughts? \r\n", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2016-03-02T20:18:28.000+0000", "updated": "2016-03-02T20:18:28.000+0000" }, { "id": "378526", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Am I right to say that the conclusion is to not make any changes to the current implementation. It will only be simply, If Resources/android/appicon.png is missing, generate it.\r\n\r\nI'm ok with us not generating the different images for different screen densities. Just that, I really prefer a total parity for all platforms to use DefaultIcon.png. i.e. If i change DefaultIcon.png, all platforms should be using that image. If i want specific platform icons, I'll use DefaultIcon-android, DefaultIcon-ios. If I want density specific images for android, i'll put the files in ../platform/android/res/drawable-*\r\n\r\nCan we do that? I'm fine removing Resources/android/appicon.png from the template and put all dependencies on DefaultIcon.png.\r\n\r\nI also hear Chris that we should discuss cross-platform assets catalogs, and maybe that would change everything discussed here anyway. However, in terms of planning, that wouldn't come too soon, and if the change i propose is a simple one, we can introduce it first.\r\n\r\n[~fmiao][~cbarber] ^", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-03-03T03:25:18.000+0000", "updated": "2016-03-03T03:25:18.000+0000" }, { "id": "378537", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "[~cng] Mostly correct. Just want to clarify that there is no \"generation\". The Android build is going to look for an app icon and copy it to the {{build/android/res/drawable}} directory. Here's the order for finding the app icon:\r\n\r\n# {{/Resources/android/}}\r\n# {{/Resources/}}\r\n# {{/DefaultIcon-android.png}}\r\n# {{/DefaultIcon.png}}\r\n# {{}} above is derived from the {{}} defined in the tiapp.xml, or falls back to \"appicon.png\".\r\n\r\nThere is no resizing. There is no build manifest. There is no hash change tracking. It's super simple.\r\n\r\nThen we need to nuke the appicon: https://github.com/appcelerator/titanium_mobile/blob/master/android/templates/app/default/template/Resources/android/appicon.png.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2016-03-03T05:32:29.000+0000", "updated": "2016-03-03T05:32:29.000+0000" }, { "id": "378539", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Thanks [~cbarber] for the clarification. \r\nIs it also possible that we can consider:\r\n- get rid of the dependency on {{}} in tiapp.xml? like obliterate it from tiapp.xml since there's no parity in this regard with other platforms.\r\n- Hence get rid of the first 2 checks\r\n- also nuke the appicon.png in the templates\r\n\r\nNaturally this would mean some breaking change. But do we agree that this way it'll be cleaner? then it's just a matter of schooling our developers in the next major version bump.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-03-03T05:56:55.000+0000", "updated": "2016-03-03T05:56:55.000+0000" }, { "id": "378541", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "All platforms honor the {{}} in the tiapp.xml, so I wouldn't say there's no parity.\r\n\r\nI think we need to discuss a new asset catalog system to replace the {{}} in the tiapp.xml as well as all the {{appicon.png}}, {{appicon@2x.png}}, etc icons before we start ripping things out. We need a solution to replace everything and it has to be easy to use and powerful.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2016-03-03T06:01:56.000+0000", "updated": "2016-03-03T06:01:56.000+0000" }, { "id": "378542", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "ok gotcha. sounds good to me. Your proposal will do for now. At least for 5.4.0. [~emerriman] any other concerns before [~fmiao]does it this way?\r\n", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-03-03T06:06:44.000+0000", "updated": "2016-03-03T06:06:44.000+0000" }, { "id": "379133", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "PR https://github.com/appcelerator/titanium_mobile/pull/7588 reverted by https://github.com/appcelerator/titanium_mobile/pull/7816.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2016-03-08T07:21:06.000+0000", "updated": "2016-03-08T07:21:06.000+0000" } ], "maxResults": 19, "total": 19, "startAt": 0 } } }