Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7cc80013 authored by Ben Kwa's avatar Ben Kwa
Browse files

Adjust theming for Files mode.

- Bring files mode in line with MD spec platform colors.
- Normalize selection highlight color in grid and table mode.
- Fix status bar and accent colors in portrait mode.

BUG=23797347
BUG=24012021

Change-Id: I3427939b39f3f39f5e04bd4d854166dd6b3881b1
parent 0f7078f0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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"
+20 −0
Original line number Diff line number Diff line
<?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>
+6 −4
Original line number Diff line number Diff line
@@ -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>
+12 −5
Original line number Diff line number Diff line
@@ -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>
+4 −6
Original line number Diff line number Diff line
@@ -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()));
Loading