{ "id": "176323", "key": "TIMOB-28570", "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-29T22:36:01.000+0000", "created": "2021-10-27T21:55:38.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "ActionBar", "android", "icon" ], "versions": [], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-10-29T22:36:05.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\nTitanium does not offer an API to set the home indicator to a custom icon on the ActionBar. This means it's currently limited to a back arrow or the hamburger icon. Ideally, we should add support for a custom icon such as a {{\\[x\\]}} button.\r\n\r\n*To-Do:*\r\nAdd property \"homeAsUpIndicator\" property to {{Ti.Android.ActionBar}}. Have it call the Java [ActionBar.setHomeAsUpIndicator()|https://developer.android.com/reference/android/app/ActionBar#setHomeAsUpIndicator(int)] method. This property should support drawable resource ID (such as a vector drawable) or an image string path.\r\n\r\n*Test:*\r\n# Use below code as the \"app.js\".\r\n# Create folder: {{./platform/android/res/drawable}}\r\n# Copy [^ic_baseline_close_24.xml] to above directory.\r\n# Build and run on Android.\r\n# Verify you see a close {{\\[x\\]}} button in top-left corner of action bar.\r\n\r\n{code:javascript}\r\nconst window = Ti.UI.createWindow();\r\nwindow.activity.onCreate = () => {\r\n\tconst actionBar = window.activity.actionBar;\r\n\tactionBar.displayHomeAsUp = true;\r\n\tactionBar.homeButtonEnabled = true;\r\n\tactionBar.homeAsUpIndicator = Ti.App.Android.R.drawable.ic_baseline_close_24;\r\n\tactionBar.onHomeIconItemSelected = () => {\r\n\t\talert(\"Clicked on ActionBar home icon.\");\r\n\t};\r\n};\r\nwindow.open();\r\n{code}\r\n\r\n*Work-Around:*\r\nUse Titanium's {{Toolbar}} instead via its [navigationIcon|https://titaniumsdk.com/api/titanium/ui/toolbar.html#navigationicon] property. This is the equivalent of the {{ActionBar}}'s home indicator, but takes more effort to implement.\r\n", "attachment": [ { "id": "68022", "filename": "ic_baseline_close_24.xml", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-10-27T21:54:22.000+0000", "size": 420, "mimeType": "text/xml" } ], "flagged": false, "summary": "Android: Add \"homeAsUpIndicator\" custom icon support to ActionBar", "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": "459144", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/13149", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-10-28T05:15:51.000+0000", "updated": "2021-10-28T05:15:51.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }