Bug 1486200 - Apply Photon theme for Date/Time pickers only on API >=23; r=jchen
authorPetru Lingurar <petru.lingurar@softvision.ro>
Wed, 29 Aug 2018 20:00:53 +0000
changeset 433940 6eedde033c219dbd4563bc9e2a5f9902353ec2d6
parent 433939 c7754dbab0b089cc24cd61a3270c598b03d0f6e9
child 433941 b6f8a968931e0b5791f557f95d492d6f750f4e32
child 433950 b946a1ac70e563013202fb7eb6c096de53249eca
push id68493
push userrvandermeulen@mozilla.com
push dateWed, 29 Aug 2018 20:01:56 +0000
treeherderautoland@6eedde033c21 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjchen
bugs1486200
milestone63.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 1486200 - Apply Photon theme for Date/Time pickers only on API >=23; r=jchen Fix Lollipop crashes because of android.content.res.ColorStateList.addFirstIfMissing() The default app theme will be applied for the material Date/Time pickers on API 21 and API 22. After this, on API >=23 they will be Photon themed. Differential Revision: https://phabricator.services.mozilla.com/D4464
mobile/android/app/src/main/res/values-v23/themes.xml
mobile/android/app/src/main/res/values/themes.xml
new file mode 100644
--- /dev/null
+++ b/mobile/android/app/src/main/res/values-v23/themes.xml
@@ -0,0 +1,25 @@
+<?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>
+    <!--
+        Activity based themes for API 23+.
+        This theme completely replaces GeckoAppBase from res/values/themes.xml on API 23+ devices.
+    -->
+    <style name="GeckoAppBase" parent="Gecko">
+        <!-- Following are defaults from res/values/themes.xml#GeckoAppBase -->
+        <item name="android:buttonStyle">@style/Widget.Button</item>
+        <item name="android:dropDownItemStyle">@style/Widget.DropDownItem</item>
+        <item name="android:editTextStyle">@style/Widget.EditText</item>
+        <item name="android:textViewStyle">@style/Widget.TextView</item>
+        <item name="menuItemDefaultStyle">@style/Widget.MenuItemDefault</item>
+
+        <!-- Following are used to apply a Photon theme to date/time pickers only on API >=23 -->
+        <item name="android:timePickerStyle" >@style/PhotonTimePicker</item>
+        <item name="android:datePickerStyle">@style/PhotonDatePicker</item>
+        <item name="android:calendarViewStyle">@style/PhotonCalendarView</item>
+    </style>
+
+</resources>
\ No newline at end of file
--- a/mobile/android/app/src/main/res/values/themes.xml
+++ b/mobile/android/app/src/main/res/values/themes.xml
@@ -87,19 +87,16 @@
         <item name="bookmarksListViewStyle">@style/Widget.BookmarksListView</item>
         <item name="geckoMenuListViewStyle">@style/Widget.GeckoMenuListView</item>
         <item name="homeListViewStyle">@style/Widget.HomeListView</item>
         <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>
-        <item name="android:timePickerStyle" tools:ignore="NewApi">@style/PhotonTimePicker</item>
-        <item name="android:datePickerStyle">@style/PhotonDatePicker</item>
-        <item name="android:calendarViewStyle">@style/PhotonCalendarView</item>
     </style>
 
     <!-- Make an activity appear like an overlay. -->
     <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>