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 258253 b28b502e4aca
parent 258252 8be55cae236f
child 258254 edf4fa83d569
push id4628
push userryanvm@gmail.com
push date2015-04-03 20:32 +0000
treeherdermozilla-beta@e4566e5991e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche, sledru
bugs1132751
milestone38.0
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
@@ -76,16 +76,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 -->