Merge "Further browse spacing fixes to match redlines." into lmp-preview-dev
diff --git a/v17/leanback/res/layout/lb_image_card_view.xml b/v17/leanback/res/layout/lb_image_card_view.xml
index 0a14ff7..f7225e6 100644
--- a/v17/leanback/res/layout/lb_image_card_view.xml
+++ b/v17/leanback/res/layout/lb_image_card_view.xml
@@ -70,6 +70,7 @@
                 android:layout_alignParentRight="true"
                 android:scaleType="fitCenter"
                 android:background="@color/lb_basic_card_info_bg_color"
+                android:visibility="gone"
                 android:contentDescription="@null" />
             <ImageView
                 android:id="@+id/fade_mask"
@@ -79,6 +80,7 @@
                 android:layout_alignParentBottom="true"
                 android:layout_toStartOf="@id/extra_badge"
                 android:scaleType="fitCenter"
+                android:visibility="gone"
                 android:contentDescription="@null" />
         </RelativeLayout>
     </FrameLayout>
diff --git a/v17/leanback/res/values/attrs.xml b/v17/leanback/res/values/attrs.xml
index f31cd96..a0fed63 100644
--- a/v17/leanback/res/values/attrs.xml
+++ b/v17/leanback/res/values/attrs.xml
@@ -169,5 +169,9 @@
         <!-- style for a vertical grid of items -->
         <attr name="itemsVerticalGridStyle" format="reference" />
 
+        <!-- Default colors -->
+        <attr name="defaultBrandColor" format="reference|color" />
+        <attr name="defaultSearchColor" format="reference|color" />
+
     </declare-styleable>
 </resources>
diff --git a/v17/leanback/res/values/colors.xml b/v17/leanback/res/values/colors.xml
index f78d9f3..14ee791 100644
--- a/v17/leanback/res/values/colors.xml
+++ b/v17/leanback/res/values/colors.xml
@@ -44,4 +44,7 @@
     <color name="lb_basic_card_info_bg_color">#FF1B1B1B</color>
     <color name="lb_basic_card_title_text_color">#FFEEEEEE</color>
     <color name="lb_basic_card_content_text_color">#FFEEEEEE</color>
+
+    <color name="lb_default_brand_color">#FF455A64</color>
+    <color name="lb_default_search_color">#FFFFAA3F</color>
 </resources>
diff --git a/v17/leanback/res/values/strings.xml b/v17/leanback/res/values/strings.xml
index 4cd08f2..bad8000 100644
--- a/v17/leanback/res/values/strings.xml
+++ b/v17/leanback/res/values/strings.xml
@@ -14,11 +14,15 @@
 See the License for the specific language governing permissions and
 limitations under the License.
 -->
-<resources>
-    <string name="orb_search_label">Search</string>
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <!-- Image description for the call to search action visible when browsing content [CHAR LIMIT=40] -->
     <string name="orb_search_action">Search Action</string>
+    <!-- Hint showing in the empty search bar [CHAR LIMIT=40] -->
     <string name="lb_search_bar_hint">Search</string>
+    <!-- Hint showing in the empty search bar when using the voice input [CHAR LIMIT=40] -->
     <string name="lb_search_bar_hint_speech">Speak to search</string>
-    <string name="lb_search_bar_hint_with_title">Search %1$s</string>
-    <string name="lb_search_bar_hint_with_title_speech">Speak to search %1$s</string>
-</resources>
\ No newline at end of file
+    <!-- Hint showing in the empty search bar using a provided context (usually the application name) [CHAR LIMIT=40] -->
+    <string name="lb_search_bar_hint_with_title">Search <xliff:g id="search context">%1$s</xliff:g></string>
+    <!-- Hint showing in the empty search bar using a provided context (usually the application name) while in voice input mode [CHAR LIMIT=40] -->
+    <string name="lb_search_bar_hint_with_title_speech">Speak to search <xliff:g id="search context">%1$s</xliff:g></string>
+</resources>
diff --git a/v17/leanback/res/values/themes.xml b/v17/leanback/res/values/themes.xml
index 3024054..a481488 100644
--- a/v17/leanback/res/values/themes.xml
+++ b/v17/leanback/res/values/themes.xml
@@ -49,6 +49,9 @@
         <item name="detailsDescriptionSubtitleStyle">@style/Widget.Leanback.DetailsDescriptionSubtitleStyle</item>
         <item name="detailsDescriptionBodyStyle">@style/Widget.Leanback.DetailsDescriptionBodyStyle</item>
         <item name="detailsActionButtonStyle">@style/Widget.Leanback.DetailsActionButtonStyle</item>
+
+        <item name="defaultBrandColor">@color/lb_default_brand_color</item>
+        <item name="defaultSearchColor">@color/lb_default_search_color</item>
     </style>
 
 </resources>
diff --git a/v17/leanback/src/android/support/v17/leanback/app/BrowseFragment.java b/v17/leanback/src/android/support/v17/leanback/app/BrowseFragment.java
index 05c3749..3230fa0 100644
--- a/v17/leanback/src/android/support/v17/leanback/app/BrowseFragment.java
+++ b/v17/leanback/src/android/support/v17/leanback/app/BrowseFragment.java
@@ -374,7 +374,7 @@
         }
 
         TypedValue outValue = new TypedValue();
-        getActivity().getTheme().resolveAttribute(android.R.attr.colorForeground, outValue, true);
+        getActivity().getTheme().resolveAttribute(R.attr.defaultSearchColor, outValue, true);
         return getResources().getColor(outValue.resourceId);
     }
 
diff --git a/v17/leanback/src/android/support/v17/leanback/app/HeadersFragment.java b/v17/leanback/src/android/support/v17/leanback/app/HeadersFragment.java
index 22c1ec6..03dc03b 100644
--- a/v17/leanback/src/android/support/v17/leanback/app/HeadersFragment.java
+++ b/v17/leanback/src/android/support/v17/leanback/app/HeadersFragment.java
@@ -175,7 +175,7 @@
         }
 
         TypedValue outValue = new TypedValue();
-        getActivity().getTheme().resolveAttribute(android.R.attr.colorBackground, outValue, true);
+        getActivity().getTheme().resolveAttribute(R.attr.defaultBrandColor, outValue, true);
         return getResources().getColor(outValue.resourceId);
     }
 }
diff --git a/v17/leanback/src/android/support/v17/leanback/widget/DetailsOverviewRowPresenter.java b/v17/leanback/src/android/support/v17/leanback/widget/DetailsOverviewRowPresenter.java
index 6b08b29..a8a50f9 100644
--- a/v17/leanback/src/android/support/v17/leanback/widget/DetailsOverviewRowPresenter.java
+++ b/v17/leanback/src/android/support/v17/leanback/widget/DetailsOverviewRowPresenter.java
@@ -222,7 +222,7 @@
 
     private int getDefaultBackgroundColor(Context context) {
         TypedValue outValue = new TypedValue();
-        context.getTheme().resolveAttribute(android.R.attr.colorBackground, outValue, true);
+        context.getTheme().resolveAttribute(R.attr.defaultBrandColor, outValue, true);
         return context.getResources().getColor(outValue.resourceId);
     }
 
diff --git a/v17/leanback/src/android/support/v17/leanback/widget/GridLayoutManager.java b/v17/leanback/src/android/support/v17/leanback/widget/GridLayoutManager.java
index 032098b..ef9c77d 100644
--- a/v17/leanback/src/android/support/v17/leanback/widget/GridLayoutManager.java
+++ b/v17/leanback/src/android/support/v17/leanback/widget/GridLayoutManager.java
@@ -797,12 +797,16 @@
         }
 
         if (mGrid == null) {
-            measureScrapChild(mFocusPosition == NO_POSITION ? 0 : mFocusPosition,
-                    MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
-                    MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
-                    mMeasuredDimension);
-            if (DEBUG) Log.v(TAG, "measured scrap child: " + mMeasuredDimension[0] +
-                    " " + mMeasuredDimension[1]);
+            if (mState.getItemCount() > 0) {
+                measureScrapChild(mFocusPosition == NO_POSITION ? 0 : mFocusPosition,
+                        MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
+                        MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
+                        mMeasuredDimension);
+                if (DEBUG) Log.v(TAG, "measured scrap child: " + mMeasuredDimension[0] +
+                        " " + mMeasuredDimension[1]);
+            } else {
+                mMeasuredDimension[0] = mMeasuredDimension[1] = 0;
+            }
         }
 
         List<Integer>[] rows = mGrid == null ? null :
diff --git a/v7/appcompat/res/values-v11/themes_base.xml b/v7/appcompat/res/values-v11/themes_base.xml
index ddd9d59..0539a1a 100644
--- a/v7/appcompat/res/values-v11/themes_base.xml
+++ b/v7/appcompat/res/values-v11/themes_base.xml
@@ -16,6 +16,20 @@
 
 <resources>
 
+    <!--
+        Theme in the "Theme.Platform.AppCompat" family are designed to be aliases for the default
+        theme on a given platform version. They should not set any styleable attributes. Instead
+        you should create a "Theme.Base" theme which inherits from a "Theme.Platform" theme.
+    -->
+    <eat-comment/>
+    <style name="Theme.Platform.AppCompat" parent="android:Theme.Holo" />
+
+    <style name="Theme.Platform.AppCompat.Light" parent="android:Theme.Holo.Light" />
+
+    <style name="Theme.Platform.AppCompat.Dialog" parent="android:Theme.Holo.Dialog" />
+
+    <style name="Theme.Platform.AppCompat.Light.Dialog" parent="android:Theme.Holo.Light.Dialog" />
+
     <!-- Themes in the "Theme.Base" family vary based on the current platform
           version to provide the correct basis on each device. You probably don't
           want to use them directly in your apps.
@@ -28,7 +42,7 @@
     <eat-comment/>
 
     <!-- Base platform-dependent theme  -->
-    <style name="Theme.Base" parent="android:Theme.Holo">
+    <style name="Theme.Base" parent="Theme.Platform.AppCompat">
         <item name="android:windowNoTitle">true</item>
         <item name="android:windowActionBar">false</item>
 
@@ -46,7 +60,7 @@
     </style>
 
     <!-- Base platform-dependent theme providing a light-themed activity. -->
-    <style name="Theme.Base.Light" parent="android:Theme.Holo.Light">
+    <style name="Theme.Base.Light" parent="Theme.Platform.AppCompat.Light">
         <item name="android:windowNoTitle">true</item>
         <item name="android:windowActionBar">false</item>
 
@@ -63,7 +77,7 @@
         <item name="selectableItemBackground">?android:attr/selectableItemBackground</item>
     </style>
 
-    <style name="Theme.Base.AppCompat.Dialog.FixedSize" parent="android:Theme.Holo.Dialog">
+    <style name="Theme.Base.AppCompat.Dialog.FixedSize" parent="Theme.Platform.AppCompat.Dialog">
         <item name="windowFixedWidthMajor">@dimen/dialog_fixed_width_major</item>
         <item name="windowFixedWidthMinor">@dimen/dialog_fixed_width_minor</item>
         <item name="windowFixedHeightMajor">@dimen/dialog_fixed_height_major</item>
@@ -77,7 +91,7 @@
     </style>
 
     <style name="Theme.Base.AppCompat.Dialog.Light.FixedSize"
-           parent="android:Theme.Holo.Light.Dialog">
+           parent="Theme.Platform.AppCompat.Light.Dialog">
         <item name="windowFixedWidthMajor">@dimen/dialog_fixed_width_major</item>
         <item name="windowFixedWidthMinor">@dimen/dialog_fixed_width_minor</item>
         <item name="windowFixedHeightMajor">@dimen/dialog_fixed_height_major</item>
diff --git a/v7/appcompat/res/values-v14/themes_base.xml b/v7/appcompat/res/values-v14/themes_base.xml
index 3b30074..e182b2e 100644
--- a/v7/appcompat/res/values-v14/themes_base.xml
+++ b/v7/appcompat/res/values-v14/themes_base.xml
@@ -16,6 +16,23 @@
 
 <resources>
 
+    <!--
+        Theme in the "Theme.Platform.AppCompat" family are designed to be aliases for the default
+        theme on a given platform version. They should not set any styleable attributes. Instead
+        you should create a "Theme.Base" theme which inherits from a "Theme.Platform" theme.
+    -->
+    <eat-comment/>
+
+    <style name="Theme.Platform.AppCompat.Light.DarkActionBar"
+           parent="android:Theme.Holo.Light.DarkActionBar" />
+
+    <style name="Theme.Platform.AppCompat.DialogWhenLarge"
+           parent="android:Theme.Holo.DialogWhenLarge" />
+
+    <style name="Theme.Platform.AppCompat.Light.DialogWhenLarge"
+           parent="android:Theme.Holo.Light.DialogWhenLarge" />
+
+
     <!-- Themes in the "Theme.Base" family vary based on the current platform
           version to provide the correct basis on each device. You probably don't
           want to use them directly in your apps.
@@ -28,7 +45,7 @@
     <eat-comment/>
 
     <!-- Base platform-dependent theme providing an action bar in a dark-themed activity. -->
-    <style name="Theme.Base.AppCompat" parent="android:Theme.Holo">
+    <style name="Theme.Base.AppCompat" parent="Theme.Platform.AppCompat">
         <!-- Copy system flag values for our use -->
         <item name="windowActionBar">?android:attr/windowActionBar</item>
         <item name="actionBarSize">?android:attr/actionBarSize</item>
@@ -58,7 +75,7 @@
     </style>
 
     <!-- Base platform-dependent theme providing an action bar in a light-themed activity. -->
-    <style name="Theme.Base.AppCompat.Light" parent="android:Theme.Holo.Light">
+    <style name="Theme.Base.AppCompat.Light" parent="Theme.Platform.AppCompat.Light">
         <!-- Copy system flag values for our use -->
         <item name="windowActionBar">?android:attr/windowActionBar</item>
         <item name="actionBarSize">?android:attr/actionBarSize</item>
@@ -89,7 +106,7 @@
 
     <!-- Base platform-dependent theme providing a dark action bar in a light-themed activity. -->
     <style name="Theme.Base.AppCompat.Light.DarkActionBar"
-           parent="android:Theme.Holo.Light.DarkActionBar">
+           parent="Theme.Platform.AppCompat.Light.DarkActionBar">
         <!-- Copy system flag values for our use -->
         <item name="windowActionBar">?android:attr/windowActionBar</item>
         <item name="actionBarSize">?android:attr/actionBarSize</item>
@@ -132,7 +149,7 @@
     -->
 
     <style name="Theme.Base.AppCompat.DialogWhenLarge.Base"
-           parent="android:Theme.Holo.DialogWhenLarge">
+           parent="Theme.Platform.AppCompat.DialogWhenLarge">
         <!-- Copy system flag values for our use -->
         <item name="windowActionBar">?android:attr/windowActionBar</item>
         <item name="actionBarSize">?android:attr/actionBarSize</item>
@@ -158,7 +175,7 @@
     </style>
 
     <style name="Theme.Base.AppCompat.Light.DialogWhenLarge.Base"
-           parent="android:Theme.Holo.Light.DialogWhenLarge">
+           parent="Theme.Platform.AppCompat.Light.DialogWhenLarge">
         <!-- Copy system flag values for our use -->
         <item name="windowActionBar">?android:attr/windowActionBar</item>
         <item name="actionBarSize">?android:attr/actionBarSize</item>
diff --git a/v7/appcompat/res/values-v21/styles_base.xml b/v7/appcompat/res/values-v21/styles_base.xml
new file mode 100644
index 0000000..d3bef1b
--- /dev/null
+++ b/v7/appcompat/res/values-v21/styles_base.xml
@@ -0,0 +1,241 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+
+    <!-- Like in themes_base.xml, the namespace "*.AppCompat.Base" is used to
+     define base styles for the platform version. The "*.AppCompat"
+     variants are for direct use or use as parent styles by the app. -->
+    <eat-comment/>
+
+    <style name="Widget.AppCompat.Base.ActionBar"
+           parent="android:Widget.Quantum.ActionBar">
+    </style>
+
+    <style name="Widget.AppCompat.Light.Base.ActionBar"
+           parent="android:Widget.Quantum.Light.ActionBar">
+    </style>
+
+    <style name="Widget.AppCompat.Base.ActionBar.Solid"
+           parent="android:Widget.Quantum.ActionBar.Solid">
+    </style>
+
+    <style name="Widget.AppCompat.Light.Base.ActionBar.Solid"
+           parent="android:Widget.Quantum.Light.ActionBar.Solid">
+    </style>
+
+    <style name="Widget.AppCompat.Light.Base.ActionBar.Solid.Inverse"
+           parent="android:Widget.Quantum.Light.ActionBar.Solid">
+    </style>
+
+    <style name="Widget.AppCompat.Base.ActionBar.TabBar"
+           parent="android:Widget.Quantum.ActionBar.TabBar">
+    </style>
+
+    <style name="Widget.AppCompat.Light.Base.ActionBar.TabBar"
+           parent="android:Widget.Quantum.Light.ActionBar.TabBar">
+    </style>
+
+    <style name="Widget.AppCompat.Light.Base.ActionBar.TabBar.Inverse"
+           parent="android:Widget.Quantum.Light.ActionBar.TabBar">
+    </style>
+
+    <style name="Widget.AppCompat.Base.ActionBar.TabView"
+           parent="android:Widget.Quantum.ActionBar.TabView">
+    </style>
+
+    <style name="Widget.AppCompat.Light.Base.ActionBar.TabView"
+           parent="android:Widget.Quantum.Light.ActionBar.TabView">
+    </style>
+
+    <style name="Widget.AppCompat.Light.Base.ActionBar.TabView.Inverse"
+           parent="android:Widget.Quantum.Light.ActionBar.TabView">
+    </style>
+
+    <style name="Widget.AppCompat.Base.ActionBar.TabText"
+           parent="android:Widget.Quantum.ActionBar.TabText">
+    </style>
+
+    <style name="Widget.AppCompat.Light.Base.ActionBar.TabText"
+           parent="android:Widget.Quantum.Light.ActionBar.TabText">
+    </style>
+
+    <style name="Widget.AppCompat.Light.Base.ActionBar.TabText.Inverse"
+           parent="android:Widget.Quantum.Light.ActionBar.TabText">
+    </style>
+
+    <style name="Widget.AppCompat.Light.Base.ActionMode.Inverse"
+           parent="android:Widget.Quantum.Light.ActionMode">
+    </style>
+
+    <style name="TextAppearance.AppCompat.Widget.Base.ActionBar.Menu"
+           parent="android:TextAppearance.Quantum.Widget.ActionBar.Menu">
+    </style>
+
+    <style name="TextAppearance.AppCompat.Widget.Base.ActionBar.Title"
+           parent="android:TextAppearance.Quantum.Widget.ActionBar.Title">
+    </style>
+
+    <style name="TextAppearance.AppCompat.Widget.Base.ActionBar.Subtitle"
+           parent="android:TextAppearance.Quantum.Widget.ActionBar.Subtitle">
+    </style>
+
+
+    <!--
+    TODO Hidden
+    <style name="TextAppearance.AppCompat.Widget.Base.ActionBar.Title.Inverse"
+           parent="android:TextAppearance.Quantum.Widget.ActionBar.Title.Inverse">
+    </style>
+
+    <style name="TextAppearance.AppCompat.Widget.Base.ActionBar.Subtitle.Inverse"
+           parent="android:TextAppearance.Quantum.Widget.ActionBar.Subtitle.Inverse">
+    </style>
+    -->
+
+    <style name="TextAppearance.AppCompat.Widget.Base.ActionMode.Title"
+           parent="android:TextAppearance.Quantum.Widget.ActionMode.Title">
+    </style>
+
+    <style name="TextAppearance.AppCompat.Widget.Base.ActionMode.Subtitle"
+           parent="android:TextAppearance.Quantum.Widget.ActionMode.Subtitle">
+    </style>
+
+    <!--
+    TODO Hidden
+    <style name="TextAppearance.AppCompat.Widget.Base.ActionMode.Title.Inverse"
+           parent="android:TextAppearance.Quantum.Widget.ActionMode.Title.Inverse">
+    </style>
+
+    <style name="TextAppearance.AppCompat.Widget.Base.ActionMode.Subtitle.Inverse"
+           parent="android:TextAppearance.Quantum.Widget.ActionMode.Subtitle.Inverse">
+    </style>
+    -->
+
+    <!-- Action Button Styles -->
+
+    <style name="Widget.AppCompat.Base.ActionButton"
+           parent="android:Widget.Quantum.ActionButton">
+    </style>
+
+    <style name="Widget.AppCompat.Light.Base.ActionButton"
+           parent="android:Widget.Quantum.Light.ActionButton">
+    </style>
+
+    <style name="Widget.AppCompat.Base.ActionButton.CloseMode"
+           parent="android:Widget.Quantum.ActionButton.CloseMode">
+    </style>
+
+    <style name="Widget.AppCompat.Light.Base.ActionButton.CloseMode"
+           parent="android:Widget.Quantum.Light.ActionButton.CloseMode">
+    </style>
+
+    <style name="Widget.AppCompat.Base.ActionButton.Overflow"
+           parent="android:Widget.Quantum.ActionButton.Overflow">
+    </style>
+
+    <style name="Widget.AppCompat.Light.Base.ActionButton.Overflow"
+           parent="android:Widget.Quantum.Light.ActionButton.Overflow">
+    </style>
+
+    <!-- Spinner Widgets -->
+
+    <style name="Widget.AppCompat.Base.ListView.DropDown"
+           parent="android:Widget.Quantum.ListView.DropDown"/>
+
+    <style name="Widget.AppCompat.Light.Base.ListView.DropDown"
+           parent="android:Widget.Quantum.ListView.DropDown"/>
+
+    <style name="Widget.AppCompat.Base.DropDownItem.Spinner"
+           parent="android:Widget.Quantum.DropDownItem.Spinner"/>
+
+    <style name="Widget.AppCompat.Light.Base.DropDownItem.Spinner"
+           parent="android:Widget.Quantum.Light.DropDownItem.Spinner"/>
+
+    <style name="Widget.AppCompat.Base.Spinner"
+           parent="android:Widget.Quantum.Spinner" />
+
+    <style name="Widget.AppCompat.Light.Base.Spinner"
+           parent="android:Widget.Quantum.Light.Spinner"/>
+
+    <style name="Widget.AppCompat.Base.ListView.Menu"
+           parent="android:Widget.ListView.Menu" />
+
+    <!-- Popup Menu -->
+
+    <style name="Widget.AppCompat.Base.ListPopupWindow"
+           parent="android:Widget.Quantum.ListPopupWindow">
+    </style>
+
+    <style name="Widget.AppCompat.Light.Base.ListPopupWindow"
+           parent="android:Widget.Quantum.Light.ListPopupWindow">
+    </style>
+
+    <style name="Widget.AppCompat.Base.PopupMenu" parent="android:Widget.Quantum.PopupMenu">
+    </style>
+
+    <style name="Widget.AppCompat.Light.Base.PopupMenu"
+        parent="android:Widget.Quantum.Light.PopupMenu">
+    </style>
+
+    <style name="TextAppearance.AppCompat.Base.Widget.PopupMenu.Large"
+        parent="android:TextAppearance.Quantum.Widget.PopupMenu.Large">
+    </style>
+
+    <style name="TextAppearance.AppCompat.Base.Widget.PopupMenu.Small"
+        parent="android:TextAppearance.Quantum.Widget.PopupMenu.Small">
+    </style>
+
+    <style name="TextAppearance.AppCompat.Light.Base.Widget.PopupMenu.Large"
+        parent="android:TextAppearance.Quantum.Widget.PopupMenu.Large">
+    </style>
+
+    <style name="TextAppearance.AppCompat.Light.Base.Widget.PopupMenu.Small"
+        parent="android:TextAppearance.Quantum.Widget.PopupMenu.Small">
+    </style>
+
+    <!-- Search View result styles -->
+
+    <style name="TextAppearance.AppCompat.Base.SearchResult.Title"
+           parent="@android:TextAppearance.Quantum.SearchResult.Title">
+    </style>
+
+    <style name="TextAppearance.AppCompat.Base.SearchResult.Subtitle"
+           parent="@android:TextAppearance.Quantum.SearchResult.Subtitle">
+    </style>
+
+    <!--
+        TextAppearance.Quantum.Light.SearchResult.* are private so we extend from the default
+        versions instead (which are exactly the same).
+    -->
+    <style name="TextAppearance.AppCompat.Light.Base.SearchResult.Title"
+           parent="TextAppearance.AppCompat.Base.SearchResult.Title">
+    </style>
+
+    <style name="TextAppearance.AppCompat.Light.Base.SearchResult.Subtitle"
+           parent="TextAppearance.AppCompat.Base.SearchResult.Subtitle">
+    </style>
+
+    <!-- TODO. Needs updating for QP -->
+    <style name="Widget.AppCompat.Base.ActivityChooserView" parent="">
+        <item name="android:gravity">center</item>
+        <item name="android:background">@drawable/abc_ab_share_pack_holo_dark</item>
+        <item name="android:divider">?attr/dividerVertical</item>
+        <item name="android:showDividers">middle</item>
+        <item name="android:dividerPadding">6dip</item>
+    </style>
+
+</resources>
diff --git a/v7/appcompat/res/values-v21/themes_base.xml b/v7/appcompat/res/values-v21/themes_base.xml
new file mode 100644
index 0000000..43a174b
--- /dev/null
+++ b/v7/appcompat/res/values-v21/themes_base.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+
+    <!--
+        Theme in the "Theme.Platform.AppCompat" family are designed to be aliases for the default
+        theme on a given platform version. They should not set any styleable attributes. Instead
+        you should create a "Theme.Base" theme which inherits from a "Theme.Platform" theme.
+    -->
+    <eat-comment/>
+    <style name="Theme.Platform.AppCompat" parent="android:Theme.Quantum" />
+
+    <style name="Theme.Platform.AppCompat.Light" parent="android:Theme.Quantum.Light" />
+
+    <style name="Theme.Platform.AppCompat.Light.DarkActionBar"
+           parent="android:Theme.Quantum.Light.DarkActionBar" />
+
+    <style name="Theme.Platform.AppCompat.DialogWhenLarge"
+           parent="android:Theme.Quantum.DialogWhenLarge" />
+
+    <style name="Theme.Platform.AppCompat.Light.DialogWhenLarge"
+           parent="android:Theme.Quantum.Light.DialogWhenLarge" />
+
+    <style name="Theme.Platform.AppCompat.Dialog"
+           parent="android:Theme.Quantum.Dialog" />
+
+    <style name="Theme.Platform.AppCompat.Light.Dialog"
+           parent="android:Theme.Quantum.Light.Dialog" />
+
+</resources>
diff --git a/v7/appcompat/res/values/themes_base.xml b/v7/appcompat/res/values/themes_base.xml
index c48b57c..f707c3a 100644
--- a/v7/appcompat/res/values/themes_base.xml
+++ b/v7/appcompat/res/values/themes_base.xml
@@ -16,6 +16,23 @@
 
 <resources>
 
+    <!--
+        Theme in the "Theme.Platform.AppCompat" family are designed to be aliases for the default
+        theme on a given platform version. They should not set any styleable attributes. Instead
+        you should create a "Theme.Base" theme which inherits from a "Theme.Platform" theme.
+    -->
+    <eat-comment/>
+    <style name="Theme.Platform.AppCompat" parent="android:Theme" />
+
+    <style name="Theme.Platform.AppCompat.Light" parent="android:Theme.Light" />
+
+    <style name="Theme.Platform.AppCompat.Dialog"
+           parent="android:Theme.Dialog" />
+
+    <style name="Theme.Platform.AppCompat.Light.Dialog"
+           parent="Theme.Platform.AppCompat.Dialog" />
+
+
     <!-- Themes in the "Theme.Base" family vary based on the current platform
          version to provide the correct basis on each device. You probably don't
          want to use them directly in your apps.
@@ -24,10 +41,10 @@
          directly by apps. -->
     <eat-comment/>
 
-    <style name="Theme.Base" parent="android:Theme">
+    <style name="Theme.Base" parent="Theme.Platform.AppCompat">
     </style>
 
-    <style name="Theme.Base.Light" parent="android:Theme.Light">
+    <style name="Theme.Base.Light" parent="Theme.Platform.AppCompat.Light">
     </style>
 
     <!-- Base platform-dependent theme providing an action bar in a dark-themed activity. -->
@@ -206,7 +223,7 @@
            parent="Theme.Base.AppCompat.Light">
     </style>
 
-    <style name="Theme.Base.AppCompat.Dialog.FixedSize" parent="android:Theme.Dialog">
+    <style name="Theme.Base.AppCompat.Dialog.FixedSize" parent="Theme.Platform.AppCompat.Dialog">
         <item name="windowFixedWidthMajor">@dimen/dialog_fixed_width_major</item>
         <item name="windowFixedWidthMinor">@dimen/dialog_fixed_width_minor</item>
         <item name="windowFixedHeightMajor">@dimen/dialog_fixed_height_major</item>
diff --git a/v7/mediarouter/build.gradle b/v7/mediarouter/build.gradle
index 3af0dd4..d4dae83 100644
--- a/v7/mediarouter/build.gradle
+++ b/v7/mediarouter/build.gradle
@@ -40,7 +40,7 @@
 }
 
 android {
-    compileSdkVersion 19
+    compileSdkVersion 'current'
     buildToolsVersion '19.0.3'
 
     sourceSets {