Bug 1132751 - Add android:logo to fennec application. r=liuche, a=sledru
authorMichael Comella <michael.l.comella@gmail.com>
Tue, 31 Mar 2015 14:21:53 -0700
changeset 265369 445036402091885f83199764d4ea8385ce5d6c07
parent 265368 4ad0c7cad3bfd44ae240890b18ec65359c2ed637
child 265370 b89b0d2efb602bb0129624966679ddc8c8165f98
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche, sledru
bugs1132751
milestone39.0a2
Bug 1132751 - Add android:logo to fennec application. r=liuche, a=sledru On Android v21, this logo is a padded version of android:icon which, to my knowledge, is only used by the ActionBar, which we only make visible in GeckoPreferences. On < 21, this icon is used via resource alias.
mobile/android/base/AndroidManifest.xml.in
mobile/android/base/resources/drawable-v21/logo.xml
mobile/android/base/resources/drawable/logo.xml
mobile/android/base/resources/values-v11/styles.xml
--- a/mobile/android/base/AndroidManifest.xml.in
+++ b/mobile/android/base/AndroidManifest.xml.in
@@ -81,16 +81,17 @@
     <uses-feature android:name="android.hardware.camera" android:required="false"/>
     <uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
 
     <!-- App requires OpenGL ES 2.0 -->
     <uses-feature android:glEsVersion="0x00020000" android:required="true" />
 
     <application android:label="@string/moz_app_displayname"
                  android:icon="@drawable/icon"
+                 android:logo="@drawable/logo"
                  android:name="org.mozilla.gecko.GeckoApplication"
                  android:hardwareAccelerated="true"
 # The preprocessor does not yet support arbitrary parentheses, so this cannot
 # be parenthesized thus to clarify that the logical AND operator has precedence:
 #   !defined(MOZILLA_OFFICIAL) || (defined(NIGHTLY_BUILD) && defined(MOZ_DEBUG))
 #if !defined(MOZILLA_OFFICIAL) || defined(NIGHTLY_BUILD) && defined(MOZ_DEBUG)
                  android:debuggable="true">
 #else
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/resources/drawable-v21/logo.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+<!-- The action bar scales the application icon to be too large (bug 1132751)
+     so add some padding to prevent it from scaling so much. -->
+<inset
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:drawable="@drawable/icon"
+    android:insetTop="6dp"
+    android:insetBottom="6dp"
+    android:insetLeft="6dp"
+    android:insetRight="6dp"
+    />
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/resources/drawable/logo.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+<!-- Overidden. -->
+<bitmap
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:src="@drawable/icon"/>
--- a/mobile/android/base/resources/values-v11/styles.xml
+++ b/mobile/android/base/resources/values-v11/styles.xml
@@ -43,17 +43,17 @@
         <item name="android:ellipsize">marquee</item>
     </style>
 
     <!-- ActionBar -->
     <style name="ActionBar" parent="android:style/Widget.Holo.ActionBar" />
  
     <!-- GeckoPreferences ActionBar -->
     <style name="ActionBar.GeckoPreferences">
-         <item name="android:displayOptions">showHome|homeAsUp|showTitle</item>
+         <item name="android:displayOptions">showHome|homeAsUp|showTitle|useLogo</item>
     </style>
  
     <!-- TabsLayout ActionBar -->
     <style name="ActionBar.TabsLayout">
          <item name="android:visibility">gone</item>
     </style>
 
     <!-- DropDown List View -->