diff options
6 files changed, 44 insertions, 20 deletions
diff --git a/packages/DocumentsUI/res/color/item_doc_grid_overlay.xml b/packages/DocumentsUI/res/color/item_doc_grid_overlay.xml index 6959c65e2d3a..6dcbb38cb950 100644 --- a/packages/DocumentsUI/res/color/item_doc_grid_overlay.xml +++ b/packages/DocumentsUI/res/color/item_doc_grid_overlay.xml @@ -17,7 +17,8 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_activated="true" - android:color="?android:attr/colorControlHighlight" /> + android:color="?android:attr/colorAccent" + android:alpha="0.1" /> <item android:state_enabled="false" android:color="?android:attr/colorBackground" diff --git a/packages/DocumentsUI/res/values/attrs.xml b/packages/DocumentsUI/res/values/attrs.xml new file mode 100644 index 000000000000..0afc3a2e4d8b --- /dev/null +++ b/packages/DocumentsUI/res/values/attrs.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2015 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> + <declare-styleable name="DocumentsBaseTheme"> + <attr name="colorActionMode" format="color"/> + </declare-styleable> +</resources> diff --git a/packages/DocumentsUI/res/values/colors.xml b/packages/DocumentsUI/res/values/colors.xml index 6002dde5040a..cb6957dd3463 100644 --- a/packages/DocumentsUI/res/values/colors.xml +++ b/packages/DocumentsUI/res/values/colors.xml @@ -19,18 +19,20 @@ <color name="material_grey_300">#ffeeeeee</color> <color name="material_grey_600">#ff757575</color> <color name="material_grey_800">#ff424242</color> - <color name="material_blue_700">#ff1976d2</color> - <color name="material_blue_500">#ff2196f3</color> <color name="primary_dark">@*android:color/material_blue_grey_900</color> <color name="primary">@*android:color/material_blue_grey_800</color> <color name="accent">@*android:color/material_deep_teal_500</color> + <color name="platform_blue_100">#ffd0d9ff</color> + <color name="platform_blue_500">#ff5677fc</color> + <color name="platform_blue_700">#ff455ede</color> + <color name="platform_blue_a100">#ffa6baff</color> + <color name="platform_blue_a200">#ffff5177</color> + <color name="directory_background">@color/material_grey_300</color> <color name="item_doc_grid_background">#FFFFFFFF</color> <color name="item_doc_grid_protect_background">#88000000</color> - <color name="status_bar_background">@color/material_blue_700</color> - <color name="action_mode_status_bar_background">@color/material_grey_800</color> <color name="band_select_background">#88ffffff</color> <color name="band_select_border">#44000000</color> </resources> diff --git a/packages/DocumentsUI/res/values/styles.xml b/packages/DocumentsUI/res/values/styles.xml index e67f956112ce..8301816edaea 100644 --- a/packages/DocumentsUI/res/values/styles.xml +++ b/packages/DocumentsUI/res/values/styles.xml @@ -28,6 +28,7 @@ <item name="android:colorPrimaryDark">@color/primary_dark</item> <item name="android:colorPrimary">@color/primary</item> <item name="android:colorAccent">@color/accent</item> + <item name="colorActionMode">@color/material_grey_800</item> <item name="android:listDivider">@*android:drawable/list_divider_material</item> @@ -43,6 +44,7 @@ <item name="actionBarWidgetTheme">@null</item> <item name="actionBarTheme">@style/ActionBarTheme</item> <item name="actionBarPopupTheme">@style/ActionBarPopupTheme</item> + <item name="colorActionMode">@color/material_grey_800</item> <item name="android:listDivider">@*android:drawable/list_divider_material</item> @@ -68,16 +70,21 @@ </style> <style name="AlertDialogTheme" parent="@android:style/Theme.Material.Light.Dialog.Alert"> - <item name="android:colorAccent">@color/material_blue_700</item> + <item name="android:colorAccent">@color/platform_blue_700</item> </style> <style name="FilesTheme" parent="@style/DocumentsBaseTheme.FullScreen"> - <item name="android:colorPrimaryDark">@color/material_blue_700</item> - <item name="android:colorPrimary">@color/material_blue_500</item> - <item name="android:colorAccent">@color/material_blue_700</item> - <item name="android:actionModeStyle">@style/ActionModeStyle</item> + <item name="android:colorPrimaryDark">@color/platform_blue_700</item> + <item name="android:colorPrimary">@color/platform_blue_500</item> + <item name="android:colorAccent">@color/platform_blue_700</item> + <item name="android:actionModeStyle">@style/FilesActionModeStyle</item> + <item name="colorActionMode">@color/platform_blue_700</item> <item name="android:alertDialogTheme">@style/AlertDialogTheme</item> </style> + <style name="FilesActionModeStyle" parent="@android:style/Widget.Material.Light.ActionMode"> + <item name="android:background">@color/platform_blue_100</item> + </style> + </resources> diff --git a/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java b/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java index cfd4ecb96b59..046f3df3b5d4 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java +++ b/packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java @@ -637,27 +637,25 @@ public class DirectoryFragment extends Fragment { @Override public void onSelectionChanged() { mModel.getSelection(mSelected); + TypedValue color = new TypedValue(); if (mSelected.size() > 0) { if (DEBUG) Log.d(TAG, "Maybe starting action mode."); if (mActionMode == null) { if (DEBUG) Log.d(TAG, "Yeah. Starting action mode."); mActionMode = getActivity().startActionMode(this); - getActivity().getWindow().setStatusBarColor( - getResources().getColor(R.color.action_mode_status_bar_background)); } + getActivity().getTheme().resolveAttribute( + R.attr.colorActionMode, color, true); updateActionMenu(); } else { if (DEBUG) Log.d(TAG, "Finishing action mode."); if (mActionMode != null) { mActionMode.finish(); } - // Obtain the original status bar color from the theme, and restore it. - TypedValue color = new TypedValue(); getActivity().getTheme().resolveAttribute( android.R.attr.colorPrimaryDark, color, true); - getActivity().getWindow().setStatusBarColor(color.data); - } + getActivity().getWindow().setStatusBarColor(color.data); if (mActionMode != null) { mActionMode.setTitle(TextUtils.formatSelectedCount(mSelected.size())); diff --git a/packages/DocumentsUI/src/com/android/documentsui/FilesActivity.java b/packages/DocumentsUI/src/com/android/documentsui/FilesActivity.java index 8f9025a1cdeb..450def799a1a 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/FilesActivity.java +++ b/packages/DocumentsUI/src/com/android/documentsui/FilesActivity.java @@ -90,10 +90,6 @@ public class FilesActivity extends BaseActivity { mClipper = new DocumentClipper(this); mDrawer = DrawerController.create(this); - if (mDrawer.isPresent()) { - setTheme(R.style.DocumentsNonDialogTheme); - } - RootsFragment.show(getFragmentManager(), null); if (!mState.restored) { |