Bug 1411654 - Part 5c: Work through ResourceUnused lint issues. r=mcomella
authorNick Alexander <nalexander@mozilla.com>
Tue, 14 Nov 2017 19:20:16 -0800
changeset 453622 55776829a744ec20be08d29083c4b39b9519b9b4
parent 453621 c5bf85d56fedf600363dda3b077fdf950ba60688
child 453623 cfad693be9185ae858a29a715b3e5a6d2d3d6fbf
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella
bugs1411654
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1411654 - Part 5c: Work through ResourceUnused lint issues. r=mcomella MozReview-Commit-ID: 82rgLEEMQzG
mobile/android/app/src/main/res/values-v11/themes.xml
mobile/android/app/src/main/res/values-v13/search_styles.xml
mobile/android/app/src/main/res/values-v16/search_styles.xml
mobile/android/app/src/main/res/values/themes.xml
mobile/android/app/src/photon/res/values-v11/styles.xml
mobile/android/app/src/photon/res/values-v16/styles.xml
mobile/android/app/src/photon/res/values/styles.xml
mobile/android/base/java/org/mozilla/gecko/util/UnusedResourcesUtil.java
--- a/mobile/android/app/src/main/res/values-v11/themes.xml
+++ b/mobile/android/app/src/main/res/values-v11/themes.xml
@@ -10,25 +10,16 @@
         in other res/values-XXX/themes.xml.
     -->
     <style name="GeckoBase" parent="Theme.AppCompat.Light.DarkActionBar">
         <item name="android:windowContentOverlay">@null</item>
         <item name="windowActionBar">false</item>
         <item name="windowNoTitle">true</item>
     </style>
 
-    <style name="GeckoDialogBase" parent="@android:style/Theme.Holo.Light.Dialog">
-        <item name="android:windowContentOverlay">@null</item>
-        <item name="android:windowActionBar">false</item>
-        <item name="android:windowNoTitle">true</item>
-        <item name="android:windowBackground">@android:color/transparent</item>
-    </style>
-
-    <style name="GeckoTitleDialogBase" parent="@android:style/Theme.Holo.Light.Dialog" />
-
     <!--
         Activity based themes for API 11+. This theme completely replaces
         GeckoAppBase from res/values/themes.xml on API 11+ devices.
     -->
     <style name="GeckoAppBase" parent="Gecko">
         <item name="android:actionButtonStyle">@style/GeckoActionBar.Button</item>
         <item name="android:actionModeCopyDrawable">@drawable/ab_copy</item>
         <item name="android:actionModeCutDrawable">@drawable/ab_cut</item>
deleted file mode 100644
--- a/mobile/android/app/src/main/res/values-v13/search_styles.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<!-- 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/. -->
-
-<resources>
-
-    <!-- Base application theme. -->
-    <style name="AppTheme" parent="@android:style/Theme.Holo.Light.NoActionBar">
-        <item name="android:windowBackground">@color/toolbar_grey</item>
-        <item name="android:colorBackground">@color/toolbar_grey</item>
-    </style>
-
-    <style name="SettingsTheme" parent="@android:style/Theme.Holo.Light"/>
-
-</resources>
deleted file mode 100644
--- a/mobile/android/app/src/main/res/values-v16/search_styles.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<!-- 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/. -->
-
-<resources>
-
-    <style name="TextAppearance.EmptyView.Title" parent="@android:style/TextAppearance.Small">
-        <item name="android:textColor">@color/text_and_tabs_tray_grey</item>
-        <item name="android:textSize">20sp</item>
-        <item name="android:fontFamily">sans-serif-light</item>
-    </style>
-
-    <style name="TextAppearance.EmptyView.Message" parent="@android:style/TextAppearance.Small">
-        <item name="android:textColor">@color/placeholder_grey</item>
-        <item name="android:textSize">16sp</item>
-        <item name="android:lineSpacingExtra">4sp</item>
-    </style>
-
-</resources>
--- a/mobile/android/app/src/main/res/values/themes.xml
+++ b/mobile/android/app/src/main/res/values/themes.xml
@@ -1,32 +1,26 @@
 <?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/. -->
 
-<resources>
+<resources
+    xmlns:tools="http://schemas.android.com/tools">
 
     <!--
         Base application theme. This could be overridden by GeckoBaseTheme
         in other res/values-XXX/themes.xml.
     -->
     <style name="GeckoBase" parent="Theme.AppCompat.Light.DarkActionBar">
         <item name="windowNoTitle">true</item>
         <item name="windowActionBar">false</item>
         <item name="android:windowContentOverlay">@null</item>
     </style>
 
-    <style name="GeckoDialogBase" parent="@android:style/Theme.Dialog">
-        <item name="android:windowNoTitle">true</item>
-        <item name="android:windowContentOverlay">@null</item>
-    </style>
-
-    <style name="GeckoTitleDialogBase" parent="@android:style/Theme.Dialog" />
-
     <style name="Gecko.Preferences">
         <item name="windowActionBar">true</item>
         <item name="windowNoTitle">false</item>
         <item name="actionBarTheme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
         <item name="actionBarStyle">@style/PreferencesActionBar</item>
     </style>
 
     <!--
@@ -68,20 +62,16 @@
         <item name="android:textAppearanceMediumInverse">@style/TextAppearance.Medium.Inverse</item>
         <item name="android:textAppearanceSmallInverse">@style/TextAppearance.Small.Inverse</item>
 
         <item name="colorAccent">@color/action_accent</item>
 
         <item name="actionBarTheme">@style/GeckoActionBar</item>
     </style>
 
-    <style name="Gecko.Dialog" parent="GeckoDialogBase"/>
-
-    <style name="Gecko.TitleDialog" parent="GeckoTitleDialogBase"/>
-
     <!--
         Activity based themes, dependent on API level. This theme is replaced
         by GeckoAppBase from res/values-vXX/themes.xml on newer devices.
     -->
     <style name="GeckoAppBase" parent="Gecko">
         <item name="android:buttonStyle">@style/Widget.Button</item>
         <item name="android:dropDownItemStyle">@style/Widget.DropDownItem</item>
         <item name="android:editTextStyle">@style/Widget.EditText</item>
@@ -121,17 +111,18 @@
 
     <style name="GeckoCustomTabs" parent="Theme.AppCompat.Light.NoActionBar">
         <item name="menuItemActionBarStyle">@style/Widget.MenuItemActionBar</item>
         <item name="menuItemDefaultStyle">@style/Widget.MenuItemCustomTabs</item>
         <item name="windowActionModeOverlay">true</item>
     </style>
 
     <!-- Bookmark full-page dialog theme -->
-    <style name="Bookmark" parent="Theme.AppCompat.Light.DialogWhenLarge"/>
+    <style name="Bookmark" parent="Theme.AppCompat.Light.DialogWhenLarge"
+           tools:ignore="UnusedResources" />
     <style name="Bookmark.Gecko" parent="Gecko">
         <item name="toolbarStyle">@style/BookmarkToolbarStyle</item>
         <item name="colorAccent">@color/fennec_ui_accent</item>
         <item name="colorControlNormal">@color/disabled_grey</item>
 
         <item name="android:textColorHint">@color/tabs_tray_icon_grey</item>
     </style>
     <style name="BookmarkToolbarStyle.Base" parent="@style/Widget.AppCompat.Toolbar">
--- a/mobile/android/app/src/photon/res/values-v11/styles.xml
+++ b/mobile/android/app/src/photon/res/values-v11/styles.xml
@@ -1,15 +1,16 @@
 <?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/. -->
 
-<resources xmlns:android="http://schemas.android.com/apk/res/android">
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+           xmlns:tools="http://schemas.android.com/tools">
 
     <!--
         Only overriden styles for Honeycomb/Ice cream sandwich are specified here.
         Please refer to values/styles.xml for default styles.
     -->
 
     <!--
         Base application styles. This could be overridden in other res/values-XXX/themes.xml.
@@ -21,19 +22,16 @@
     <style name="Widget.BaseEditText" parent="android:style/Widget.Holo.Light.EditText" />
 
     <style name="Widget.BaseListView" parent="android:style/Widget.Holo.ListView" />
 
     <style name="Widget.BaseGridView" parent="android:style/Widget.Holo.GridView" />
 
     <style name="Widget.BaseTextView" parent="android:style/Widget.Holo.Light.TextView" />
 
-    <style name="Widget.ProgressBar.Horizontal" parent="android:style/Widget.Holo.ProgressBar.Horizontal" />
-
-
     <!--
         Application styles. All customizations that are not specific
         to a particular API level can go here.
     -->
     <style name="Widget.ListItem">
         <item name="android:textColor">@color/select_item_multichoice</item>
         <item name="android:minHeight">?android:attr/listPreferredItemHeight</item>
         <item name="android:textAppearance">?android:attr/textAppearanceLarge</item>
@@ -42,28 +40,16 @@
         <item name="android:paddingRight">7dip</item>
         <item name="android:checkMark">?android:attr/listChoiceIndicatorMultiple</item>
         <item name="android:ellipsize">marquee</item>
     </style>
 
     <!-- ActionBar -->
     <style name="ActionBar" parent="android:style/Widget.Holo.ActionBar" />
 
-    <!-- TabsLayout ActionBar -->
-    <style name="ActionBar.TabsLayout">
-        <item name="android:visibility">gone</item>
-    </style>
-
-    <!-- DropDown List View -->
-    <style name="DropDownListView" parent="@android:style/Widget.Holo.ListView.DropDown">
-        <item name="android:listSelector">@drawable/action_bar_button</item>
-        <item name="android:divider">@color/toolbar_divider_grey</item>
-        <item name="android:dividerHeight">@dimen/page_row_divider_height</item>
-    </style>
-
     <!-- Spinner DropDown Item -->
     <style name="Widget.DropDownItem.Spinner" parent="@android:style/Widget.Holo.Light.DropDownItem.Spinner">
         <item name="android:textColor">#FF000000</item>
     </style>
 
     <style name="Widget.Spinner" parent="android:style/Widget.Holo.Light.Spinner">
         <item name="android:minWidth">@dimen/doorhanger_input_width</item>
     </style>
@@ -103,14 +89,15 @@
         <item name="android:layout_marginTop">16dp</item>
         <item name="android:layout_marginBottom">16dp</item>
     </style>
 
     <style name="TabInput"></style>
 
     <style name="TabInput.TabWidget" parent="android:style/Widget.Holo.Light.TabWidget" />
 
-    <style name="TabInput.Tab" parent="android:style/Widget.Holo.Light.Tab">
+    <style name="TabInput.Tab" parent="android:style/Widget.Holo.Light.Tab"
+           tools:ignore="UnusedResources">
         <item name="android:minHeight">@dimen/menu_item_row_height</item>
         <item name="android:textAllCaps">true</item>
     </style>
 
 </resources>
--- a/mobile/android/app/src/photon/res/values-v16/styles.xml
+++ b/mobile/android/app/src/photon/res/values-v16/styles.xml
@@ -9,24 +9,16 @@
     <style name="TextAppearance.EmptyMessage" parent="TextAppearance.Large">
         <item name="android:fontFamily">sans-serif-light</item>
     </style>
 
     <style name="TextAppearance.Widget.Home.ItemTitle" parent="TextAppearance.Medium">
         <item name="android:fontFamily">sans-serif-light</item>
     </style>
 
-    <style name="TextAppearance.FirstrunTextLight">
-        <item name="android:fontFamily">sans-serif-light</item>
-    </style>
-
-    <style name="TextAppearance.FirstrunTextRegular">
-        <item name="android:fontFamily">sans-serif</item>
-    </style>
-
     <style name="TextAppearance.UrlBar.Title" parent="TextAppearance.Small">
         <item name="android:textSize">16sp</item>
     </style>
 
     <style name="TextAppearance.SearchSuggestion" parent="TextAppearance.Small">
         <item name="android:fontFamily">sans-serif-light</item>
     </style>
 </resources>
--- a/mobile/android/app/src/photon/res/values/styles.xml
+++ b/mobile/android/app/src/photon/res/values/styles.xml
@@ -20,18 +20,16 @@
     <style name="Widget.BaseEditText" parent="android:style/Widget.EditText"/>
 
     <style name="Widget.BaseListView" parent="android:style/Widget.ListView"/>
 
     <style name="Widget.BaseGridView" parent="android:style/Widget.GridView"/>
 
     <style name="Widget.BaseTextView" parent="android:style/Widget.TextView"/>
 
-    <style name="Widget.ProgressBar.Horizontal" parent="android:style/Widget.ProgressBar.Horizontal"/>
-
     <!--
         Application styles. All customizations that are not specific
         to a particular API level can go here.
     -->
     <style name="Widget.Button" parent="Widget.BaseButton">
         <item name="android:textAppearance">@style/TextAppearance.Widget.Button</item>
     </style>
 
@@ -60,20 +58,16 @@
 
     <style name="Widget.GridView" parent="Widget.BaseGridView">
         <item name="android:verticalSpacing">0dip</item>
         <item name="android:horizontalSpacing">0dip</item>
         <item name="android:cacheColorHint">@android:color/transparent</item>
         <item name="android:listSelector">@drawable/action_bar_button</item>
     </style>
 
-    <style name="Widget.Home.HomeList">
-        <item name="android:scrollbarStyle">outsideOverlay</item>
-    </style>
-
     <style name="Widget.ListItem">
         <item name="android:minHeight">?android:attr/listPreferredItemHeight</item>
         <item name="android:textAppearance">?android:attr/textAppearanceLargeInverse</item>
         <item name="android:gravity">center_vertical</item>
         <item name="android:paddingLeft">12dip</item>
         <item name="android:paddingStart">12dip</item>
         <item name="android:paddingRight">7dip</item>
         <item name="android:paddingEnd">7dip</item>
@@ -211,22 +205,16 @@
 
     <style name="Widget.BookmarksListView" parent="Widget.HomeListView"/>
 
     <style name="Widget.TopSitesThumbnailView">
       <item name="android:padding">0dip</item>
       <item name="android:scaleType">centerCrop</item>
     </style>
 
-    <style name="Widget.TopSitesGridItemPin">
-      <item name="android:minWidth">30dip</item>
-      <item name="android:minHeight">30dip</item>
-      <item name="android:padding">0dip</item>
-    </style>
-
     <style name="Widget.TopSitesGridItemTitle">
       <item name="android:textColor">@color/top_sites_grid_item_title</item>
       <item name="android:textSize">12sp</item>
       <item name="android:paddingTop">5dip</item>
       <item name="android:gravity">left|start</item>
     </style>
 
     <style name="Widget.HomeListView" parent="Widget.ListView">
@@ -290,17 +278,18 @@
         <item name="android:layout_weight">1</item>
         <item name="android:minHeight">48dp</item>
         <item name="android:textSize">14sp</item>
     </style>
 
     <!--
         We are overriding the snackbar message style to guarantee a consistent style across Android versions (bug 1217416).
     -->
-    <style name="TextAppearance.Design.Snackbar.Message" parent="android:TextAppearance" tools:override="true">
+    <style name="TextAppearance.Design.Snackbar.Message" parent="android:TextAppearance" tools:override="true"
+           tools:ignore="UnusedResources">
         <item name="android:textSize">@dimen/design_snackbar_text_size</item>
         <item name="android:textColor">@android:color/white</item>
     </style>
 
     <!--
         TextAppearance
         Note: Gecko uses light theme as default, while Android uses dark.
         If Android convention has to be followd, the list of colors specified 
@@ -365,17 +354,18 @@
         <item name="android:textStyle">italic</item>
     </style>
 
     <style name="TextAppearance.Micro">
         <item name="android:textSize">12sp</item>
         <item name="android:textColor">?android:attr/textColorTertiary</item>
     </style>
 
-    <style name="TextAppearance.Micro.Inverse">
+    <style name="TextAppearance.Micro.Inverse"
+           tools:ignore="UnusedResources">
         <item name="android:textColor">?android:attr/textColorTertiaryInverse</item>
         <item name="android:textColorHint">?android:attr/textColorHintInverse</item>
         <item name="android:textColorHighlight">@color/text_color_highlight_inverse</item>
         <item name="android:textColorLink">?android:attr/textColorLink</item>
     </style>
 
     <style name="TextAppearance.Widget" />
 
@@ -395,17 +385,18 @@
         <item name="android:textColor">@color/primary_text</item>
     </style>
 
     <style name="TextAppearance.Widget.HomePagerTabMenuStrip" parent="TextAppearance.Small">
         <item name="android:textColor">?android:attr/textColorHint</item>
         <item name="android:textSize">14sp</item>
     </style>
 
-    <style name="TextAppearance.Widget.Home" />
+    <style name="TextAppearance.Widget.Home"
+           tools:ignore="UnusedResources" />
 
     <style name="TextAppearance.Widget.Home.Header" parent="TextAppearance.Small">
         <item name="android:textColor">@color/disabled_grey</item>
         <item name="android:textSize">12sp</item>
     </style>
 
     <style name="TextAppearance.Widget.Home.ItemTitle" parent="TextAppearance">
         <item name="android:textSize">16sp</item>
@@ -431,17 +422,18 @@
     <style name="TextAppearance.DoorHanger.Medium.Bold">
         <item name="android:fontFamily">sans-serif-medium</item>
     </style>
 
     <style name="TextAppearance.DoorHanger.Medium.Light">
         <item name="android:fontFamily">sans-serif-light</item>
     </style>
 
-    <style name="TextAppearance.DoorHanger.Small">
+    <style name="TextAppearance.DoorHanger.Small"
+           tools:ignore="UnusedResources">
         <item name="android:textSize">14sp</item>
     </style>
 
     <style name="TextAppearance.UrlBar.Title" parent="TextAppearance.Small">
         <item name="android:textSize">16sp</item>
     </style>
 
     <style name="TextAppearance.SearchSuggestion" parent="TextAppearance.Small"/>
@@ -522,40 +514,31 @@
         <item name="android:layout_marginRight">4dp</item>
     </style>
 
     <style name="TabsListItemFavicon">
         <item name="android:layout_marginLeft">10dp</item>
         <item name="android:layout_marginRight">6dp</item>
     </style>
 
-    <style name="Widget.RemoteTabsItemView" parent="Widget.TwoLinePageRow"/>
-
     <style name="Widget.RemoteTabsClientView" parent="Widget.TwoLinePageRow">
         <item name="android:background">@color/about_page_header_grey</item>
     </style>
 
-    <style name="Widget.RemoteTabsListView" parent="Widget.HomeListView">
-        <item name="android:childDivider">@color/toolbar_divider_grey</item>
-    </style>
-
-    <style name="Widget.HistoryListView" parent="Widget.HomeListView">
-        <item name="android:childDivider">@color/toolbar_divider_grey</item>
-        <item name="android:drawSelectorOnTop">true</item>
-    </style>
-
     <!-- TabsLayout Row -->
-    <style name="TabLayoutItemTextAppearance">
+    <style name="TabLayoutItemTextAppearance"
+           tools:ignore="UnusedResources">
         <item name="android:textColor">#FFFFFFFF</item>
         <item name="android:singleLine">true</item>
         <item name="android:ellipsize">middle</item>
     </style>
 
     <!-- TabsLayout RemoteTabs Row Url -->
-    <style name="TabLayoutItemTextAppearance.Url">
+    <style name="TabLayoutItemTextAppearance.Url"
+           tools:ignore="UnusedResources">
         <item name="android:textColor">#FFA4A7A9</item>
     </style>
 
     <!-- Find bar -->
     <style name="FindBar">
         <item name="android:background">@color/text_and_tabs_tray_grey</item>
         <item name="android:paddingLeft">3dip</item>
         <item name="android:paddingStart">3dip</item>
@@ -732,17 +715,18 @@
 
     <style name="TabInput"></style>
 
     <style name="TabInput.TabWidget">
         <item name="android:divider">@drawable/divider_vertical</item>
         <item name="android:background">@drawable/tab_indicator_background</item>
     </style>
 
-    <style name="TabInput.Tab">
+    <style name="TabInput.Tab"
+           tools:ignore="UnusedResources">
         <item name="android:background">@drawable/tabs_strip_indicator</item>
         <item name="android:gravity">center</item>
         <item name="android:minHeight">@dimen/menu_item_row_height</item>
     </style>
 
     <style name="TextAppearance.FirstrunLight"/>
     <style name="TextAppearance.FirstrunRegular"/>
 
@@ -793,17 +777,18 @@
     </style>
 
     <style name="RemoteTabsPanelItem.TextAppearance.Header">
         <item name="android:textColor">@color/placeholder_active_grey</item>
         <item name="android:textSize">20sp</item>
         <item name="android:layout_marginBottom">8dp</item>
     </style>
 
-    <style name="RemoteTabsPanelItem.TextAppearance.Linkified">
+    <style name="RemoteTabsPanelItem.TextAppearance.Linkified"
+           tools:ignore="UnusedResources">
         <item name="android:clickable">true</item>
         <item name="android:focusable">true</item>
         <item name="android:textColor">#0092DB</item>
     </style>
 
     <style name="RemoteTabsPanelItem.Button">
         <item name="android:background">@drawable/remote_tabs_setup_button_background</item>
         <item name="android:textColor">#FFFFFF</item>
@@ -815,28 +800,27 @@
         <item name="android:paddingStart">8dp</item>
         <item name="android:paddingRight">8dp</item>
         <item name="android:paddingEnd">8dp</item>
 
         <!-- AppCompat sets Button text to all caps so we override that here. -->
         <item name="textAllCaps">false</item>
     </style>
 
-    <style name="TabQueueActivity" parent="android:style/Theme.NoDisplay" />
-
     <style name="ActivityStreamContextMenuText">
         <item name="android:textSize">16sp</item>
     </style>
 
     <!-- We use this style to provide our own divider that has an inset on the left side -->
     <style name="ActivityStreamContextMenuStyle">
         <item name="android:listDivider">@drawable/as_contextmenu_divider</item>
     </style>
 
-    <style name="ActivityStreamButton" parent="Widget.AppCompat.Button.Colored">
+    <style name="ActivityStreamButton" parent="Widget.AppCompat.Button.Colored"
+           tools:ignore="UnusedResources">
         <item name="colorButtonNormal">@color/link_blue</item>
         <item name="android:textColor">@android:color/white</item>
     </style>
 
     <!-- centerInside will downscale larger icons to fit or center smaller favicons and allow us to draw a colored
          border around them. When changing these values, consider favicons downloaded from the internet and
          those provided by suggested sites, including suggested sites from distributions. -->
     <style name="ActivityStreamFaviconView">
--- a/mobile/android/base/java/org/mozilla/gecko/util/UnusedResourcesUtil.java
+++ b/mobile/android/base/java/org/mozilla/gecko/util/UnusedResourcesUtil.java
@@ -96,9 +96,13 @@ final class UnusedResourcesUtil {
     // not needed while Activity Stream is part of the HomePager
     public static final int[] TEMPORARY_UNUSED_ACTIVITY_STREAM = {
             R.string.activity_stream_topsites
     };
 
     public static final int[] USED_IN_PAGE_ACTION = {
             R.drawable.add_to_homescreen
     };
+
+    public static final int[] USED_IN_LEANPLUM_EXPANDABLE_LIST_ACTIVITY = {
+            R.style.Widget_ExpandableListView,
+    };
 }