{ "id": "176312", "key": "TIMOB-28558", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "21249", "name": "Release 10.2.0", "archived": false, "released": false } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2021-10-28T21:59:55.000+0000", "created": "2021-10-15T23:41:44.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "android", "button", "iOS", "image", "mask", "parity" ], "versions": [], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-10-28T21:59:55.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" }, { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "*Summary:*\r\nWe should add a new boolean \"imageIsMask\" property to {{Ti.UI.Button}}. When set {{true}}, the \"image\" assigned to the button will be tinted based on the \"tintColor\" or the default theme color. When set {{false}}, the \"image\" will be displayed as-is.\r\n\r\n*Current Behavior:*\r\nOn iOS, the button's \"image\" is always masked.\r\nOn Android, the button's \"image\" is always displayed as-is and is never masked.\r\n\r\nThis feature allows for parity between Android and iOS.\r\n\r\n*Note:*\r\nWe may want to make a breaking-change on Android to have it default to masking the \"image\" by default like iOS. This would also match Google's material design. Especially since the Java {{MaterialButton}} masks its icon by default and Titanium is not currently leveraging this feature.\r\n\r\n*Example:*\r\n{code:javascript}\r\nconst window = Ti.UI.createWindow({ layout: \"vertical\" });\r\nwindow.add(Ti.UI.createButton({\r\n\ttitle: \" imageIsMask true\",\r\n\timage: OS_IOS ? \"controls.png\" : \"controls@3x.png\",\r\n\timageIsMask: true,\r\n\ttop: 80,\r\n}));\r\nwindow.add(Ti.UI.createButton({\r\n\ttitle: \" imageIsMask true (Green)\",\r\n\timage: OS_IOS ? \"controls.png\" : \"controls@3x.png\",\r\n\timageIsMask: true,\r\n\ttintColor: \"green\",\r\n\ttop: 20,\r\n}));\r\nwindow.add(Ti.UI.createButton({\r\n\ttitle: \" imageIsMask false\",\r\n\timage: \"RedLogo.png\",\r\n\timageIsMask: false,\r\n\ttop: 20,\r\n}));\r\nwindow.open();\r\n{code}\r\n\r\n !Button-Android-Light.png|thumbnail! !Button-Android-Dark.png|thumbnail! !Button-iOS-Light.png|thumbnail! \r\n", "attachment": [ { "id": "68008", "filename": "Button-Android-Dark.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-10-16T00:26:11.000+0000", "size": 446990, "mimeType": "image/png" }, { "id": "68007", "filename": "Button-Android-Light.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-10-16T00:26:10.000+0000", "size": 444035, "mimeType": "image/png" }, { "id": "68009", "filename": "Button-iOS-Light.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-10-16T00:26:11.000+0000", "size": 909100, "mimeType": "image/png" }, { "id": "68010", "filename": "controls.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-10-16T00:26:45.000+0000", "size": 15850, "mimeType": "image/png" }, { "id": "68011", "filename": "controls@2x.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-10-16T00:26:45.000+0000", "size": 16447, "mimeType": "image/png" }, { "id": "68012", "filename": "controls@3x.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-10-16T00:26:45.000+0000", "size": 17184, "mimeType": "image/png" }, { "id": "68013", "filename": "RedLogo.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-10-16T00:26:45.000+0000", "size": 24011, "mimeType": "image/png" } ], "flagged": false, "summary": "TiAPI: Add property \"imageIsMask\" to Ti.UI.Button", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "459105", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/13125", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-10-16T01:40:33.000+0000", "updated": "2021-10-16T01:40:33.000+0000" }, { "id": "459142", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The old code (before the above PR's changes) used to check if a \"res/drawable\" image existed before grabbing it from \"assets\". This allowed higher DPI images to be supported such as xxxhdpi. We need to restore this old behavior.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-10-27T21:17:22.000+0000", "updated": "2021-10-27T21:17:22.000+0000" }, { "id": "459143", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/13148", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-10-27T21:29:26.000+0000", "updated": "2021-10-27T21:29:26.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }