Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2759] Android: menu icons with "app://" paths do not fetch resource images

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T02:00:00.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M04
ComponentsAndroid
Labelsandroid, defect, release-1.6.0, reported-1.5.1, rplist
ReporterBill Dawson
AssigneeBill Dawson
Created2011-04-15T03:28:49.000+0000
Updated2011-04-17T02:00:00.000+0000

Description

cf helpdesk http://developer.appcelerator.com/helpdesk/view/60941">http://developer.appcelerator.com/helpdesk/view/60941
cf related #2627

To reproduce:

app.js

Titanium.UI.setBackgroundColor('#000');
Titanium.UI.createWindow({  
    title:'Test',
    backgroundColor:'#fff',
    fullscreen: true,
    exitOnClose: true,
    url: 'win.js'
}).open();

Then make this win.js:

var win = Ti.UI.currentWindow;
Ti.Android.currentActivity.onCreateOptionsMenu = function(e) {
    var m1 = e.menu.add({
        itemId : 1,
        groupId : 0,
        order : 0,
        title: 'I am a menu item'
    });
    m1.setIcon("app://images/test.png");
};

Then ...

  • Create Resources/android/images/medium
  • Copy KS_nav_ui.png to Resources/android/images/medium/test.png

Run the app. When the blank window comes up, press the emulator/phone menu button. You should see a menu item with an icon on it, but you will only see text on the menu item.

Comments

  1. Bill Dawson 2011-04-15

    (from [8b2fd0e423d2fb5b7df3c72e88c92d3363d5a5cc]) [#2759 state:fixed-in-qa] Make sure app:// path resource drawables can be loaded by loadDrawable if url has not already been resolved https://github.com/appcelerator/titanium_mobile/commit/8b2fd0e423d2fb5b7df3c72e88c92d3363d5a5cc"> https://github.com/appcelerator/titanium_mobile/commit/8b2fd0e423d2...

  2. Thomas Huelbert 2011-04-15

    Hey Bill - using Titanium SDK version: 1.6.0 (01/10/11 08:25 3452f06), I am failing with
    I/TiFileHlpr( 336): (main) [7216,11921] app://images/test.png not found. emulator and device.
    I confirmed I have the image at Resources/android/images/medium/KS_nav_ui.png and that I have any density set to true in tiapp.xml. Am I missing another step?

  3. Don Thorp 2011-04-15

    Thomas "app://images/test.png" != "Resources/android/images/medium/KS_nav_ui.png" it would match

    "app://images/test.png" == " Resources/android/images/medium/test.png"

  4. Thomas Huelbert 2011-04-15

    yup, should have noticed that. G2 (2.2) G1 (1.6) sim 2.1.

JSON Source