This is a regression. Works fine with 3.5.1.GA SDK.
Steps to Reproduce:
1. Create an app for android for actionbar.
var win = Ti.UI.createWindow({
navBarHidden: false
});
var actionBar;
win.addEventListener("open", function() {
if (Ti.Platform.osname === "android") {
if (! win.activity) {
Ti.API.error("Can't access action bar on a lightweight window.");
} else {
actionBar = win.activity.actionBar;
if (actionBar) {
actionBar.icon = "/icon.png";
actionBar.title = "New Title";
actionBar.onHomeIconItemSelected = function() {
Ti.API.info("Home icon clicked!");
};
}
}
}
});
win.open();
2. Build for android device/emulator with latest 4.0.0 SDK.
Actual Result:
1. The actionbar icon is not shown.
2. When built with SDK 3.5.1.GA the actionbar icon is shown as expected.
Expected Result:
1. The actionbar icon should be seen with latest 4.0.0 SDK.
This is a behavior change after our AppCompat update: "In modern Android UIs developers should lean more on a visually distinct color scheme for toolbars than on their application icon. The use of application icon plus title as a standard layout is discouraged on API 21 devices and newer"
Closing as this is a behaviour change according to [~hpham].
Please can we look at re-opening this. Although the guidelines suggest not using the app icon, the use of a menu icon (3 lines) for slide menu is still very much in use. See gmail app for example. As far as I can see this is the only way to achieve this
You have my vote on this one...
It should be possible to use a logo instead of a title. This is indeed a behaviour change and as stated in the docs Google does not recommend using both logo and title. But as it is possible to fix this, this issue should be re-opened.
It's strange decision to ignore very popular case of using icon as menu. For now there is no way to do it with standard Ti API. Please add setHomeAsUpIndicator() method to ActionBar at least. Workaround that can be helpful to someone: 1. actionBar.displayHomeAsUp = true; 2. actionbarextras.setHomeAsUpIcon(icon) from https://github.com/ricardoalcocer/actionbarextras
Android Support Library v23 added a way for fixing this. PR: https://github.com/appcelerator/titanium_mobile/pull/9218
6_2_X: https://github.com/appcelerator/titanium_mobile/pull/9291
FR Passed for backport PR. PR merged.
Verified the fix with 7.0.0.v20170816113226 & 6.2.0.v20170816173122. Closing. Studio Ver: 4.9.1.201707200100 SDK Ver: 6.2.0.v20170816173122, 7.0.0.v20170816113226 OS Ver: 10.12.3 Xcode Ver: Xcode 8.3.3 Appc NPM: 4.2.9 Appc CLI: 6.2.3 Ti CLI Ver: 5.0.14 Alloy Ver: 1.9.13 Node Ver: 6.10.1 Java Ver: 1.8.0_101 Devices: ⇨ google Pixel --- Android 7.1.1 ⇨ google Nexus 5 --- Android 6.0.1 Emulator: Android 4.4.4