[TIMOB-11539] Android: Action bar logo changes when action item is expanded
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-10-30T22:51:51.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | 2012 Sprint 22 API, 2012 Sprint 22 |
Components | Android |
Labels | api, triage |
Reporter | Arthur Evans |
Assignee | Ping Wang |
Created | 2012-10-19T02:27:00.000+0000 |
Updated | 2013-11-07T18:30:09.000+0000 |
Description
If the user specifies a custom applogo and creates an expandable action item, the logo changes when the item is expanded.
Given an android manifest like this:
<android xmlns:android="http://schemas.android.com/apk/res/android">
<tool-api-level>14</tool-api-level>
<manifest android:installLocation="auto">
<uses-sdk targetSdkVersion="14"/>
<application android:logo="@drawable/applogo" android:theme="@android:style/Theme.Holo">
</application>
</manifest>
</android>
The applogo image must exist in platforms/android/res/drawable/applogo.png and/or the appropriate density-specific drawables- folders. The icon must be different from the default titanium app icon. An unmistakably ugly one is attached for your testing pleasure.
Run the sample code below:
var win = Ti.UI.createWindow({fullscreen: false, backgroundColor: 'red'});
win.activity.onCreateOptionsMenu = function(e) {
var item = e.menu.add({title: 'Expand'});
item.showAsAction = Ti.Android.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW;
var collapseActionButton = Ti.UI.createButton({
title: 'Collapse'
});
collapseActionButton.addEventListener('click', function() {
item.collapseActionView();
});
item.actionView = collapseActionButton;
item.on('expand', function() {
alert('Expanded menu item!');
});
item.on('collapse', function() {
alert('Collapsed menu item!');
});
item.on('click', function() {
alert('clicked!');
});
}
win.open();
Note that when the action item is expanded, the custom applogo disappears, replaced by the standard app icon (the Up affordance is also displayed, which is correct).
Attachments
File | Date | Size |
---|---|---|
applogo.png | 2012-10-19T02:38:15.000+0000 | 5574 |
Might possibly be related.
This may actually be the right behavior. From re-reading the Android docs, the "app logo" can be wider than the "app icon", so what may be happening here is that the app logo is being collapsed to the app icon when the action bar needs more space. I think someone who understands this code should take a look at this and the linked issue to make sure we're doing the correct thing.
Tested using a native Android project with action bar. It has the same behavior as described in the ticket. So this is a native Android behavior. Mark the ticket as invalid.
As per Arthur Evans and Ping Wang comments, the ticket seems to be invalid. So, closing the issue.