31

In the Google I/O 2012 Android App an actionbar logo is used instead of the normal app icon. In the open source project I could find the image which is 340x72 and present only in this dimension. I searched if there is some specified size for using a logo in the actionbar, but I did not find anything. Do you know something about this?

Malachi
  • 3,205
  • 4
  • 29
  • 46
David
  • 3,971
  • 1
  • 26
  • 65

1 Answers1

60

I looked into the resources of the YouTube app, since that seems to be the only official Google app (besides I/O) that uses an action bar logo at the moment.

It contains three drawables for the logo:

  • drawable-mdpi/ic_logo_wide.png (75 x 32 px)
  • drawable-hdpi/ic_logo_wide.png (112 x 48 px)
  • drawable-xhdpi/ic_logo_wide.png (149 x 64 px)

According to Iconography from the Android design guidelines, those images' heights match the specification for the action bar icons, which is 32 x 32 dp.

  • 32 dp = 32 px (MDPI)
  • 32 dp * 1.5 = 48 px (HDPI)
  • 32 dp * 2 = 64 px (XHDPI)

You'll notice that the 72 px (XHDPI) from the I/O app don't show up. I guess, they just wanted to increase the logo's height a bit.

If a drawable is only provided in XHDPI, Android scales it down, which is a little less performant than providing the images in the proper sizes. I guess, this was just accepted by the developers of the I/O app.

Matthias Robbers
  • 15,689
  • 6
  • 63
  • 73
  • 3
    But they should point this in the documentation, you don't believe? – David Mar 25 '13 at 15:27
  • Would not be a miss. On the other hand, it is clear that any height value between **32 dp** (action bar icon) and **48 dp** (launcher icon) will fit well. – Matthias Robbers Mar 26 '13 at 19:23
  • But there is not clear what happens with the width. There are actionbar items that appear only in case of enough space, if the logo is to width, could there be a problem with this? – David Mar 27 '13 at 11:13
  • I don't know. I suppose it pushes everything away except the overflow button. That would be a pretty wide logo, though. – Matthias Robbers Mar 27 '13 at 12:37
  • 6
    Note to self :) 32 dp * 3 = 96 px (XXHDPI) – Wärting Jun 05 '13 at 09:04
  • 5
    And 32 dp * 4 = 128 px (XXXHDPI) – ol_v_er Jan 22 '14 at 18:15
  • Why does my Logo appear in the middle of my acitonbar. using AppCompat for backwards compatibility and having the worst time getting my actionbar looking nice. AppCompat is the worst, I just want it left aligned. :( – tantonj Mar 18 '15 at 21:06
  • @tantonj Try setting showtitle to enabled and displaying "" as title. – Michiel Apr 16 '15 at 12:49
  • 4
    Second note to self :) 186 x 96 (xxhdpi) , 223 x 128 (xxxhdpi) – priyankvex Feb 12 '16 at 14:05