{ "id": "133537", "key": "TIMOB-17363", "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": "20115", "name": "Release 7.3.0", "archived": false, "released": true, "releaseDate": "2018-08-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-05-17T10:26:05.000+0000", "created": "2014-07-22T16:26:31.000+0000", "epic": { "id": 134539, "key": "TIMOB-17487", "name": "Android: Support Android-L Functionality", "summary": "Android: Support Android 5.0 Functionality", "color": { "key": "color_7" }, "done": false }, "priority": { "name": "Low", "id": "4" }, "labels": [ "android", "android-l", "demo_app", "maskedimage" ], "versions": [], "issuelinks": [ { "id": "56452", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "110674", "key": "TIMOB-12966", "fields": { "summary": "TiAPI: Define API for cross-platform maskedimage component", "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": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } }, { "id": "39843", "type": { "id": "10122", "name": "Gantt: start-finish", "inward": "is triggered by", "outward": "is triggering" }, "outwardIssue": { "id": "134640", "key": "TIDOC-1834", "fields": { "summary": "Android Drawable Tinting", "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": "Medium", "id": "3" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-06-27T13:39:11.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": "*Original Request:*\r\nAs of Android 5.0 (aka: Android L) you can define bitmaps as an alpha mask and tint them using a color resource. You create these assets only once and color each instance to match your theme. This is done via a Java {{Drawable}} class' {{setTint()}}, {{setTintList()}}, and {{setTintMode()}} method.\r\nhttps://developer.android.com/reference/android/graphics/drawable/Drawable.html#setTint(int)\r\n\r\n*Proposed Solution:*\r\nThis should be implemented via our existing {{Ti.UI.MaskedImage}} feature which is currently iOS only. This way we have parity between platforms.\r\nhttps://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.MaskedImage\r\n\r\nThe concept is exactly the same. You apply a color or image to a grayscaled mask and specify the PorterDuff compositing mode.\r\nhttps://developer.android.com/reference/android/graphics/PorterDuff.Mode.html\r\n\r\nInstead of using Android 5.0's tinting APIs, we should use Android's {{Drawable}} and {{Canvas}} classes instead which support tinting/masking in all Android OS versions. _(The new tinting methods are there out of convenience for a pre-existing feature.)_\r\n\r\n*Note:*\r\nThis feature would also provide an alternate solution for developers who want to display an ImageView with rounded borders. Since rounded borders have known hardware acceleration bugs on Google's end, an alternative solution is to use a MaskedImage with a circular mask instead. This is how it's usually done by native Android developers anyways.\r\n", "attachment": [ { "id": "65091", "filename": "MaskedImageTest.zip", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-28T04:29:26.000+0000", "size": 101730, "mimeType": "application/zip" }, { "id": "65093", "filename": "MaskedImageTest-Android.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-28T04:55:52.000+0000", "size": 184767, "mimeType": "image/png" }, { "id": "65092", "filename": "MaskedImageTest-iOS.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-28T04:46:21.000+0000", "size": 70508, "mimeType": "image/png" }, { "id": "65099", "filename": "Screenshot1.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-30T22:51:59.000+0000", "size": 398009, "mimeType": "image/png" }, { "id": "65100", "filename": "Screenshot2.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-30T22:51:59.000+0000", "size": 465803, "mimeType": "image/png" }, { "id": "65101", "filename": "Screenshot3.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-30T22:51:59.000+0000", "size": 388504, "mimeType": "image/png" }, { "id": "65102", "filename": "Screenshot4.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-30T22:51:59.000+0000", "size": 174490, "mimeType": "image/png" }, { "id": "65103", "filename": "Screenshot5.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-30T22:52:00.000+0000", "size": 420857, "mimeType": "image/png" }, { "id": "65104", "filename": "Screenshot6.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-30T22:51:59.000+0000", "size": 505431, "mimeType": "image/png" }, { "id": "65105", "filename": "Screenshot7.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-30T22:51:59.000+0000", "size": 402294, "mimeType": "image/png" }, { "id": "65106", "filename": "Screenshot8.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-30T22:51:59.000+0000", "size": 203860, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: Add \"Ti.UI.MaskedImage\" support", "creator": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1021, "state": "closed", "name": "2018 Sprint 08 SDK", "startDate": "2018-04-08T17:57:36.122Z", "endDate": "2018-04-22T17:57:00.000Z", "completeDate": "2018-04-22T22:51:19.120Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "436603", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Android L's (aka: Android 5.0) drawable tinting is mostly intended as an image masking feature. We don't need to use its new tinting methods. Masking can be done on all Android OS versions via...\r\nhttps://developer.android.com/reference/android/graphics/PorterDuff.Mode.html\r\n\r\nI think this should be implement via Titanium's existing {{Ti.UI.MaskedImage}}, which is currently iOS only.\r\nhttps://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.MaskedImage\r\n\r\nSide Note:\r\nOur {{Ti.UI.Button}} already supports a {{tintColor}} property. So, a button which uses a grayscaled {{backgroundImage}} with a {{tintColor}} already supports this feature.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-07T01:48:14.000+0000", "updated": "2018-04-07T02:07:27.000+0000" }, { "id": "436978", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Also note that Android's Java \"Drawable\" class does not support using a ColorFilter and Tint at the same time. Calling {{Drawable.setColorFilter()}} disables tint and vice-versa...\r\n[Drawable.html#setColorFilter()|https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setColorFilter(int,%20android.graphics.PorterDuff.Mode)]\r\n[Drawable.html#setTint()|https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setTint(int)]\r\n\r\nOn Android, Titanium's \"tintColor\" feature is implemented via the Java {{Drawable.setColorFilter()}} API. So, like I said above, we already support this feature, but we need to avoid Google's new tinting APIs since they conflict with their color-filter APIs. Implementing MaskedImage support is still the way to go.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-18T18:23:47.000+0000", "updated": "2018-04-18T18:23:47.000+0000" }, { "id": "437158", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/10013", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-26T05:38:39.000+0000", "updated": "2018-04-26T05:38:39.000+0000" }, { "id": "437193", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Added Titanium test project: [^MaskedImageTest.zip] \r\n\r\nNote:\r\nThe zip's images \"MaskCamera.png\" and \"MaskCircleLock.png\" came from the Android SDK. All other contained images were made by Axway (I created all other mask PNGs).", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-28T04:29:59.000+0000", "updated": "2018-04-28T04:41:40.000+0000" }, { "id": "438760", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "body": "*Closing ticket.*\r\nThe feature is present in SDK:\r\n\r\n{noformat}\r\n7.3.0.v20180626174550\r\n{noformat}", "updateAuthor": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "created": "2018-06-27T13:38:54.000+0000", "updated": "2018-06-27T13:38:54.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }