From a747d2e2230ee7f186b36d6a2f619658ecfe074f Mon Sep 17 00:00:00 2001 From: Ben Kwa Date: Mon, 24 Aug 2015 10:15:56 -0700 Subject: [PATCH] Switch DocumentsUI over to use AppCompat themes. Switches from Material to AppCompat themes in order to start using Snackbar. Also, factor the common bits out of DocumentsNonDialogTheme and FilesTheme, and make the theme names clearer. BUG=23518578 Change-Id: I94a00e910469c57315823ae9df33024f2c7360ee --- packages/DocumentsUI/Android.mk | 22 +++++++++-- .../DocumentsUI/res/layout/fixed_layout.xml | 3 +- .../DocumentsUI/res/values-sw720dp/styles.xml | 2 +- packages/DocumentsUI/res/values/styles.xml | 39 ++++++++----------- 4 files changed, 38 insertions(+), 28 deletions(-) diff --git a/packages/DocumentsUI/Android.mk b/packages/DocumentsUI/Android.mk index 3430bb4797172..c21c5cc5e61f0 100644 --- a/packages/DocumentsUI/Android.mk +++ b/packages/DocumentsUI/Android.mk @@ -5,9 +5,25 @@ LOCAL_MODULE_TAGS := optional LOCAL_SRC_FILES := $(call all-java-files-under, src) -LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4 \ - android-support-v7-recyclerview \ - guava +LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4 +# The design lib requires that the client package use appcompat themes. +LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-appcompat +# Supplies material design components, e.g. Snackbar. +LOCAL_STATIC_JAVA_LIBRARIES += android-support-design +LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-recyclerview +LOCAL_STATIC_JAVA_LIBRARIES += guava + +LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res +# Not quite sure why it is necessary to explicitly pull in resources from the +# appcompat lib, but the demo code indicates it's necessary (see +# development/samples/Support7Demos/Android.mk) +LOCAL_RESOURCE_DIR += frameworks/support/v7/appcompat/res +LOCAL_RESOURCE_DIR += frameworks/support/design/res + +# Again, required to pull in appcompat resources. See abovementioned demo code. +LOCAL_AAPT_FLAGS := --auto-add-overlay +LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.appcompat +LOCAL_AAPT_FLAGS += --extra-packages android.support.design LOCAL_PACKAGE_NAME := DocumentsUI LOCAL_CERTIFICATE := platform diff --git a/packages/DocumentsUI/res/layout/fixed_layout.xml b/packages/DocumentsUI/res/layout/fixed_layout.xml index 221de1300edfe..9769f26339f8e 100644 --- a/packages/DocumentsUI/res/layout/fixed_layout.xml +++ b/packages/DocumentsUI/res/layout/fixed_layout.xml @@ -25,7 +25,8 @@ android:layout_height="?android:attr/actionBarSize" android:background="?android:attr/colorPrimary" android:elevation="8dp" - android:theme="?android:attr/actionBarTheme"> + android:theme="?actionBarTheme" + android:popupTheme="?actionBarPopupTheme"> - - + + @@ -63,21 +65,12 @@ @color/material_blue_700 -