{ "id": "113088", "key": "ALOY-628", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "15402", "description": "Alloy 1.2.0, concurrent with SDK 3.1.0", "name": "Alloy 1.2.0", "archived": false, "released": true, "releaseDate": "2013-08-15" }, { "id": "15477", "description": "Alloy 1.1.2", "name": "Alloy 1.1.2", "archived": false, "released": true, "releaseDate": "2013-05-02" }, { "id": "15406", "description": "2013 Sprint 09", "name": "2013 Sprint 09", "archived": true, "released": true, "releaseDate": "2013-05-06" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-04-23T03:21:00.000+0000", "created": "2013-04-18T22:29:03.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "15476", "description": "Alloy 1.1.1", "name": "Alloy 1.1.1", "archived": false, "released": true, "releaseDate": "2013-04-19" }, { "id": "14634", "description": "Alloy 1.0.0", "name": "Alloy 1.0.0", "archived": false, "released": true, "releaseDate": "2013-02-19" } ], "issuelinks": [ { "id": "27950", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "113106", "key": "ALOY-629", "fields": { "summary": "app.tss not being applied if set in a platform-specific styles folder", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-05-01T14:56:31.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": "12326", "name": "XML", "description": "View XML and parsing" } ], "description": "h5. Problem description\r\n\r\nPlatform specific styles Themes should have always precedence over other styles during the merge process.\r\n\r\nThis is the correct behavior when using 'app.tss' global style. The one defined in the Theme/styles is being reflected correctly.\r\n\r\nHowever, when using a style file matching a view.xml file, the generic specific-platform style is being used.\r\n\r\nh6.See the first sample code attached - app_APP-TSS.zip\r\nIn this sample, all styles are handled using 'app.tss' files.\r\nThemes merging behave correctly and theme's app.tss settings get the precedence.\r\n\r\n1. Run on Android\r\nResult: blu background and orange view are shown, as defined in themes/dark/styles/app.tss\r\n2. Run on iOS:\r\nResult: purple background and green view are shown, as defined in themes/green/styles/app.tss\r\n\r\n\r\nh6.See the second sample code attached - app_INDEX-TSS.zip\r\nIn this sample, styles are handled using 'index.tss' files and 'app.tss' files.\r\n'index.tss' files defined in specific-platform folders under 'styles//index.tss' get the precedence over the ones defined by the specific-platform Themes folder.\r\n\r\n1. Run on Android\r\nResult: red background, as defined in 'styles/android/index.tss' file (instead of blue as defined in the index.tss theme being used by Android)\r\n\r\n2. Run on iOS\r\nResult: yellow background, as defined in 'styles/ios/index.tss' file (instead of purple as defined in the index.tss theme being used by iOS) \r\n\r\n3. Delete generic specific-platform styles folder and create a generic 'index.tss' file under app/styles. Run the app on both platforms.\r\nResult: Themes 'style/platformSpecific/index.tss' style has precedence as expected and the theme style is applied correctly.", "attachment": [ { "id": "37644", "filename": "app_APP-TSS.zip", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-18T22:29:03.000+0000", "size": 3810353, "mimeType": "application/zip" }, { "id": "37643", "filename": "app_INDEX-TSS.zip", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-18T22:29:03.000+0000", "size": 3811012, "mimeType": "application/zip" } ], "flagged": false, "summary": "When merging .tss styles, platform specific Themes styles are not having priority over platform specific generic styles", "creator": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Alloy 1.1.0 GA, 1.1.1-cr", "comment": { "comments": [ { "id": "248724", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The styles you cite here are actually sorting correctly. How the theme is specified in the config.json does not play into the ordering of the style. A platform-specific theme style would not be one set in the config.json, it would instead be one where the theme was structured like this:\n\n* themes\n** someTheme\n*** styles\n**** android\n***** index.tss\n**** ios\n***** index.tss\n**** index.tss\n\nSo as per the instructions laid out in ALOY-434, this is actually sorting correctly. If you put the index.tss from your example in a platform-specific folder inside the theme it would work as expected.\n\nHaving said all this, you helped identify a small bug that would prevent platform-specific themes from working properly. I will be fixing it in this ticket.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-23T02:24:03.000+0000", "updated": "2013-04-23T02:24:03.000+0000" }, { "id": "248961", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Resolved in this commit: https://github.com/appcelerator/alloy/commit/229697b735459d5844b06488e683f20cb65924d4\r\n\r\nAll platform-specific theme folders would have failed on this check. They work now. So any test app that included a theme with a platform-specific style folder would provide a test that this works.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-24T21:17:30.000+0000", "updated": "2013-04-24T21:18:07.000+0000" }, { "id": "248963", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The advanced/themes test app has been modified to include an ios-specific folder in the green theme. This app compiling and running without error on ios would confirm that the bug in question has been resolved.\r\n\r\n{code}\r\njake app:run dir=advanced/themes\r\n{code}\r\n\r\nhttps://github.com/appcelerator/alloy/tree/master/test/apps/advanced/themes", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-24T21:25:40.000+0000", "updated": "2013-04-25T19:46:34.000+0000" }, { "id": "249398", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Confirmation from community that 1.1.2-alpha has solved this issue: http://developer.appcelerator.com/question/151717/issues-in-using-class-styles-with-alloy-in-latest-alloy-update", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-29T18:46:19.000+0000", "updated": "2013-04-29T18:46:19.000+0000" }, { "id": "249650", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified as fixed with Alloy version 1.1.2-alpha, SDK 3.1.0 GA \niPhone 5 \nAndroid Nexus 4\n\nSample code: https://github.com/appcelerator/alloy/tree/master/test/apps/advanced/themes", "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-01T00:31:29.000+0000", "updated": "2013-05-01T00:31:29.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }