Bug 1369654 - Fix lint: NewApi issues in themes.xml; r?maliu draft
authorTeng-pao Yu <osimpleo@gmail.com>
Wed, 17 May 2017 13:49:10 +0800
changeset 598010 d97b197c3c43656681daab9dbf0a0171e148a531
parent 598009 02040bd72987dbfe456eb59b64816569e41c72fd
child 634398 c8a0649b34bbb897f7525d8a81bd5c36f695be0b
push id65118
push userbmo:osimpleo@gmail.com
push dateWed, 21 Jun 2017 10:10:42 +0000
reviewersmaliu
bugs1369654
milestone56.0a1
Bug 1369654 - Fix lint: NewApi issues in themes.xml; r?maliu MozReview-Commit-ID: LH7xAf5dBD2
mobile/android/app/lint.xml
mobile/android/app/src/main/res/values-v21/themes.xml
mobile/android/app/src/main/res/values/themes.xml
mobile/android/base/resources/values-v17/themes.xml
--- a/mobile/android/app/lint.xml
+++ b/mobile/android/app/lint.xml
@@ -56,17 +56,16 @@
         <ignore path="**/mobile/android/base/java/org/mozilla/gecko/toolbar/TabCounter.java"/>
         <ignore path="**/mobile/android/base/java/org/mozilla/gecko/tabs/TabPanelBackButton.java"/>
         <ignore path="**/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarEditText.java"/>
         <ignore path="**/mobile/android/base/java/org/mozilla/gecko/util/ViewUtil.java"/>
         <ignore path="**/mobile/android/base/java/org/mozilla/gecko/IntentHelper.java"/>
         <ignore path="**/media/webrtc/trunk/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioEffects.java"/>
         <ignore path="**/media/webrtc/trunk/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java"/>
         <ignore path="src/main/res/values/styles.xml"/>
-        <ignore path="src/main/res/values/themes.xml"/>
     </issue>
 
     <!-- We fixed all "Registered" lint errors. However the current gradle plugin has a bug where
          it ignores @SuppressLint annotations for this check. See CrashReporter class and
          https://code.google.com/p/android/issues/detail?id=204846 -->
     <issue id="Registered" severity="warning" />
 
     <!-- WHEN YOU FIX A LINT WARNING, ADD IT TO THIS LIST.
--- a/mobile/android/app/src/main/res/values-v21/themes.xml
+++ b/mobile/android/app/src/main/res/values-v21/themes.xml
@@ -31,9 +31,19 @@
         <item name="android:listViewStyle">@style/Widget.ListView</item>
         <item name="android:spinnerDropDownItemStyle">@style/Widget.DropDownItem.Spinner</item>
         <item name="android:spinnerItemStyle">@style/Widget.TextView.SpinnerItem</item>
         <item name="menuItemSwitcherLayoutStyle">@style/Widget.MenuItemSwitcherLayout</item>
         <item name="menuItemDefaultStyle">@style/Widget.MenuItemDefault</item>
         <item name="menuItemSecondaryActionBarStyle">@style/Widget.MenuItemSecondaryActionBar</item>
     </style>
 
+    <style name="OverlayActivity.V21" parent="OverlayActivity.Base">
+        <!-- Set the app's title bar color in the recent app switcher.
+
+             Note: We'd prefer not to show up in the recent app switcher (bug 1137928). -->
+        <item name="android:colorPrimary">@color/text_and_tabs_tray_grey</item>
+        <!-- We display the overlay on top of other Activities so show their status bar. -->
+        <item name="android:statusBarColor">@android:color/transparent</item>
+    </style>
+    <style name="OverlayActivity" parent="OverlayActivity.V21"/>
+
 </resources>
--- a/mobile/android/app/src/main/res/values/themes.xml
+++ b/mobile/android/app/src/main/res/values/themes.xml
@@ -100,29 +100,23 @@
         <item name="menuItemActionBarStyle">@style/Widget.MenuItemActionBar</item>
         <item name="menuItemActionModeStyle">@style/GeckoActionBar.Button</item>
         <item name="topSitesGridItemViewStyle">@style/Widget.TopSitesGridItemView</item>
         <item name="topSitesGridViewStyle">@style/Widget.TopSitesGridView</item>
         <item name="topSitesThumbnailViewStyle">@style/Widget.TopSitesThumbnailView</item>
     </style>
 
     <!-- Make an activity appear like an overlay. -->
-    <style name="OverlayActivity" parent="Gecko">
+    <style name="OverlayActivity.Base" parent="Gecko">
         <item name="android:windowBackground">@android:color/transparent</item>
         <item name="android:windowNoTitle">true</item>
         <item name="android:windowIsTranslucent">true</item>
         <item name="android:backgroundDimEnabled">true</item>
-
-        <!-- Set the app's title bar color in the recent app switcher.
-
-             Note: We'd prefer not to show up in the recent app switcher (bug 1137928). -->
-        <item name="android:colorPrimary">@color/text_and_tabs_tray_grey</item>
-        <!-- We display the overlay on top of other Activities so show their status bar. -->
-        <item name="android:statusBarColor">@android:color/transparent</item>
     </style>
+    <style name="OverlayActivity" parent="OverlayActivity.Base"/>
 
     <!--
         Themes for CustomTabsActivity. Since CustomTabsActivity usually be used by 3-rd party apps,
         to create separated themes to keep look and feel be consistent with ordinary Android app.
         And ensure changes to CustomTabsActivity won't effect GeckoApp.
     -->
 
     <style name="GeckoCustomTabs" parent="Theme.AppCompat.Light.NoActionBar">
@@ -135,14 +129,14 @@
     <style name="Bookmark" parent="Theme.AppCompat.Light.DialogWhenLarge"/>
     <style name="Bookmark.Gecko" parent="Gecko">
         <item name="toolbarStyle">@style/BookmarkToolbarStyle</item>
         <item name="colorAccent">@color/fennec_ui_orange</item>
         <item name="colorControlNormal">@color/disabled_grey</item>
 
         <item name="android:textColorHint">@color/tabs_tray_icon_grey</item>
     </style>
-    <style name="BookmarkToolbarStyle" parent="@style/Widget.AppCompat.Toolbar">
+    <style name="BookmarkToolbarStyle.Base" parent="@style/Widget.AppCompat.Toolbar">
         <item name="android:paddingRight">5dp</item>
-        <item name="android:paddingEnd">5dp</item>
     </style>
+    <style name="BookmarkToolbarStyle" parent="BookmarkToolbarStyle.Base"/>
 
 </resources>
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/resources/values-v17/themes.xml
@@ -0,0 +1,13 @@
+<?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>
+
+    <style name="BookmarkToolbarStyle.V17" parent="BookmarkToolbarStyle.Base">
+        <item name="android:paddingEnd">5dp</item>
+    </style>
+    <style name="BookmarkToolbarStyle" parent="BookmarkToolbarStyle.V17"/>
+
+</resources>