{ "id": "113188", "key": "TIMOB-13642", "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": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-10-02T18:44:46.000+0000", "created": "2013-04-22T13:43:21.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "android", "image", "parity" ], "versions": [], "issuelinks": [ { "id": "56762", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "162769", "key": "TIMOB-23809", "fields": { "summary": "iOS: Relative images paths are not relative to Resources dir, not current JS file", "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": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "56760", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "128177", "key": "TIMOB-16742", "fields": { "summary": "Android: Inconsistency in the handling of leading '/' of ImageView", "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": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-10-02T18:45:03.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": "*Summary:*\r\nThe {{image}} and {{backgroundImage}} properties require a leading slash '/' on Android when loading an image file from the \"Resources\" directory or else it will fail to load. iOS and Windows do not require the leading slash, although they will accept it too. Android should be changed to be consistent with iOS and Windows.\r\n\r\nFor example, if you have an image file in the following location in a Classic app...\r\n{{./Resources/assets/images/Test.png}}\r\n\r\nOn Android, you have to load the above image file like this...\r\n{code:javascript}\r\nvar imageView = Ti.UI.createImageView({\r\n\timage: \"/images/Test.png\",\r\n});\r\n{code}\r\n\r\nOn iOS and Windows, you can load the image with or without the leading slash...\r\n{code:javascript}\r\nvar imageView = Ti.UI.createImageView({\r\n\timage: \"images/Test.png\", // This works.\r\n//\timage: \"/images/Test.png\", // This also works.\r\n});\r\n{code}\r\n\r\nChanging Android to support both would make it less confusing for developers who work on the iOS side first.\r\n\r\n*Note:*\r\nThis is not an issue when loading files via {{Ti.Filesystem.getFile()}}. Accessing files via a relative path works in this case. This is an issue with accessing files via relative paths (ie: no leading slash).\r\n\r\n----\r\n*Original Bug Report:*\r\nAs can be seen here (http://developer.appcelerator.com/question/148590/alloy-android-not-getting-images) to load images on android using alloy we need to use a forward slash \\(/\\) before the image name, I know it's not a big work for us, but we don't need it using default appcelerator.", "attachment": [], "flagged": false, "summary": "Android: Remove need for leading slash '/' to load images", "creator": { "name": "cleison.ezoom", "key": "cleison.ezoom", "displayName": "Ezoom Agency", "active": true, "timeZone": "America/Sao_Paulo" }, "subtasks": [], "reporter": { "name": "cleison.ezoom", "key": "cleison.ezoom", "displayName": "Ezoom Agency", "active": true, "timeZone": "America/Sao_Paulo" }, "environment": null, "closedSprints": [ { "id": 1078, "state": "closed", "name": "2018 Sprint 20 SDK", "startDate": "2018-09-23T16:57:58.349Z", "endDate": "2018-10-07T16:57:00.000Z", "completeDate": "2018-10-07T23:31:40.476Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "248905", "author": { "name": "cleison.ezoom", "key": "cleison.ezoom", "displayName": "Ezoom Agency", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "actually I mean remove \"/images/\" because when we build for iOS we use \"image.png\" but for android we need \"/images/image.png\" which is really boring", "updateAuthor": { "name": "cleison.ezoom", "key": "cleison.ezoom", "displayName": "Ezoom Agency", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2013-04-24T14:30:41.000+0000", "updated": "2013-04-24T14:30:41.000+0000" }, { "id": "441268", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/10304", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-09-01T01:47:07.000+0000", "updated": "2018-09-01T01:47:07.000+0000" }, { "id": "441588", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-09-14T20:32:30.000+0000", "updated": "2018-09-14T20:32:30.000+0000" }, { "id": "442222", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "Closing as well since FR and CR passed.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2018-10-02T18:45:03.000+0000", "updated": "2018-10-02T18:45:03.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }