Closed Bug 1162107 Opened 10 years ago Closed 4 years ago

[meta] Problems with add-on images in native UI

Categories

(Firefox for Android Graveyard :: General, defect)

35 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: Margaret, Unassigned, Mentored)

References

Details

(Keywords: meta, Whiteboard: [mentor project])

We've never really figured out a good solution for add-ons to specify images for our native UI add-on APIs (e.g. pageactions, home panels). We should gather a list of the APIs we have that support images, then we should gather a list of all the different ways add-ons can currently include images. We should figure out what things work and what things are busted, since some things are definitely busted. After that, we should choose a Right Way to do things, update our code to support that, and update our docs to teach developers how to do this.
Depends on: 915424
I started documenting some of these issues here: https://mobile.etherpad.mozilla.org/addon-images
This could be a really good contributor project! There's some investigation needed, and some JS and Java plumbing to work out. Then some testing (possibly using Robocop -- hard to know for sure). Then some documentation. vivek, are you interested in trying to pull together some tickets here and find a path forward?
Mentor: margaret.leibovic, nalexander
Flags: needinfo?(vivekb.balakrishnan)
Whiteboard: [mentor project]
Hi Nick/Margaret, I did some investigation by scanning through the code and I have couple of questions 1) MenuItemInfo icon property is never used. MDN documentation mentions icon option for menu item. So, we should add support for menuItem.setIcon in BrowserApp.addAddonMenuItemToMenu() Imitating Android docs, we can easily support drawable: or resource: Should we support data-uri or an http link here? 2) I don't see any meaningful use-case for jar:// file:// or thumbnail:// Please correct me if I am wrong 3) I do think we should either use Picaso or FaviconCache for most frequent image, say like menu icon or hub panel images. Please correct me if I am wrong. I will try out some other examples and post questions if I have any. BTW, DoorHanger MDN example is misleading [3]. Unless ispostive property is set to true, always the second button is shown i.e only one button is shown. The text talks about this but example is wrong i.e code and output screenshot don't match. [1] https://developer.mozilla.org/en-US/Add-ons/Firefox_for_Android/API/NativeWindow/menu [2] http://developer.android.com/reference/android/view/MenuItem.html#setIcon%28android.graphics.drawable.Drawable%29 [3] https://developer.mozilla.org/en-US/Add-ons/Firefox_for_Android/API/NativeWindow/doorhanger
Flags: needinfo?(vivekb.balakrishnan) → needinfo?(nalexander)
NIing Margaret. Please see the above comment
Flags: needinfo?(margaret.leibovic)
(In reply to Vivek Balakrishnan[:vivek] from comment #3) > BTW, > > DoorHanger MDN example is misleading [3]. Unless ispostive property is set > to true, always the second button is shown i.e only one button is shown. The > text talks about this but example is wrong i.e code and output screenshot > don't match. Chenxia recently changed this, she might be able to help clarify what's going on here. (Leaving NI to get back to the rest of your questions later :)
Flags: needinfo?(liuche)
(In reply to Vivek Balakrishnan[:vivek] from comment #3) > Hi Nick/Margaret, > > I did some investigation by scanning through the code and I have couple of > questions > > 1) MenuItemInfo icon property is never used. MDN documentation mentions icon > option for menu item. So, we should add support for menuItem.setIcon in > BrowserApp.addAddonMenuItemToMenu() > > Imitating Android docs, we can easily support drawable: or resource: > Should we support data-uri or an http link here? I don't think we support icons in add-on menu items anymore. In fact, it looks like we deprecated that add-on API: https://developer.mozilla.org/en-US/Add-ons/Firefox_for_Android/API/NativeWindow/menu/add So I think you should file a bug to clean up the code to remove that icon property. > 2) I don't see any meaningful use-case for jar:// file:// or thumbnail:// > Please correct me if I am wrong I don't think we need to support add-ons using these protocols to pass in images. These are just supported for the other places we use BitmapUtils > 3) I do think we should either use Picaso or FaviconCache for most frequent > image, say like menu icon or hub panel images. Please correct me if I am > wrong. We already use Picasso for loading home panel images, and as I mentioned above, we shouldn't support menu icons.
Flags: needinfo?(vivekb.balakrishnan)
Flags: needinfo?(nalexander)
Flags: needinfo?(margaret.leibovic)
Filed 1215586
Depends on: 1215586
Flags: needinfo?(vivekb.balakrishnan)
Updated the MDN code snippet. Good eye, vivek!
Flags: needinfo?(liuche)
Keywords: meta
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.