diff options
author | 2019-03-14 14:47:53 +0800 | |
---|---|---|
committer | 2019-03-25 16:10:10 +0800 | |
commit | 09571b245fefd0221a63b50be9f80bbe1c1505cc (patch) | |
tree | f35a28d362b8a7572141688211b9dbd8714b4a26 | |
parent | 19a67e20145249f60eba2b16ef4422f3c52f8e24 (diff) |
Polish UI and refactor theme color resources(3/N)
1. Polish UI and layout
2. Refator res to keep minimal color res
Fix: 123402575
Fix: 123401766
Fix: 123377063
Fix: 124829487
Fix: 128321455
Fix: 127803865
Fix: 123402076
Fix: 126925741
Fix: 124829834
Test: visual
Test: atest DocumentsUITests
Change-Id: I73a9c2a825c40d94db3dfe5ce61d0e18ab6cbd31
55 files changed, 182 insertions, 324 deletions
diff --git a/res/color/item_action_icon.xml b/res/color/item_action_icon.xml index 2f0497889..5de0cb678 100644 --- a/res/color/item_action_icon.xml +++ b/res/color/item_action_icon.xml @@ -17,6 +17,6 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" android:alpha="@dimen/root_icon_disabled_alpha" - android:color="@color/root_icon_color" /> - <item android:color="@color/root_icon_color" /> + android:color="?android:colorControlNormal" /> + <item android:color="?android:colorControlNormal" /> </selector> diff --git a/res/color/item_details.xml b/res/color/item_details.xml index 2915eaa72..970e55d76 100644 --- a/res/color/item_details.xml +++ b/res/color/item_details.xml @@ -17,5 +17,5 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="true" - android:color="@color/item_doc_details" /> + android:color="?android:textColorSecondary" /> </selector> diff --git a/res/color/item_doc_grid_border.xml b/res/color/item_doc_grid_border.xml index 592d07634..b535aedc3 100644 --- a/res/color/item_doc_grid_border.xml +++ b/res/color/item_doc_grid_border.xml @@ -18,10 +18,10 @@ <item android:state_focused="true" android:state_selected="false" - android:color="?android:attr/colorAccent"/> + android:color="?android:attr/colorPrimary"/> <item android:state_selected="true" - android:color="?android:attr/colorAccent"/> + android:color="?android:attr/colorPrimary"/> <item android:color="@android:color/transparent"/> </selector> diff --git a/res/color/item_doc_grid_tint.xml b/res/color/item_doc_grid_tint.xml index 23392ca48..2c48e9658 100644 --- a/res/color/item_doc_grid_tint.xml +++ b/res/color/item_doc_grid_tint.xml @@ -17,7 +17,7 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_activated="true" - android:color="@color/item_grid_tint" + android:color="?android:colorPrimary" android:alpha=".15" /> <item android:color="@android:color/transparent" /> diff --git a/res/color/item_root_icon.xml b/res/color/item_root_icon.xml index 0a3d12c82..456d1b4a2 100644 --- a/res/color/item_root_icon.xml +++ b/res/color/item_root_icon.xml @@ -17,7 +17,7 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_activated="false" - android:color="@color/root_icon_color" /> + android:color="?android:colorControlNormal" /> <item android:state_activated="true" android:color="?android:colorControlActivated" /> diff --git a/res/color/item_root_secondary_text.xml b/res/color/item_root_secondary_text.xml index 198542bf4..44086ef88 100644 --- a/res/color/item_root_secondary_text.xml +++ b/res/color/item_root_secondary_text.xml @@ -16,8 +16,8 @@ --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_focused="true" android:state_activated="true" android:color="?android:colorAccent" /> - <item android:state_focused="false" android:state_activated="true" android:color="?android:colorAccent" /> + <item android:state_focused="true" android:state_activated="true" android:color="?android:colorPrimary" /> + <item android:state_focused="false" android:state_activated="true" android:color="?android:colorPrimary" /> <item android:state_enabled="false" android:alpha="0.5" android:color="?android:textColorSecondary" /> <item android:color="?android:textColorSecondary" /> </selector> diff --git a/res/color/search_chip_background_color.xml b/res/color/search_chip_background_color.xml index 17b895a14..c94d155a5 100644 --- a/res/color/search_chip_background_color.xml +++ b/res/color/search_chip_background_color.xml @@ -16,7 +16,7 @@ --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_selected="true" android:color="@color/chip_selected_background_color"/> + <item android:state_selected="true" android:color="?android:attr/colorSecondary"/> <item android:state_enabled="true" android:color="?android:attr/colorBackground"/> <item android:state_enabled="false" android:color="@color/chip_background_disable_color"/> </selector>
\ No newline at end of file diff --git a/res/color/search_chip_ripple_color.xml b/res/color/search_chip_ripple_color.xml index acfb86655..985b6cc7d 100644 --- a/res/color/search_chip_ripple_color.xml +++ b/res/color/search_chip_ripple_color.xml @@ -18,21 +18,21 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- Selected. --> <item android:state_pressed="true" android:state_selected="true" - android:alpha="0.16" android:color="@color/chip_ripple_color"/> + android:alpha="0.16" android:color="?android:colorPrimary"/> <item android:state_focused="true" android:state_hovered="true" android:state_selected="true" - android:alpha="0.16" android:color="@color/chip_ripple_color"/> + android:alpha="0.16" android:color="?android:colorPrimary"/> <item android:state_focused="true" android:state_selected="true" - android:alpha="0.12" android:color="@color/chip_ripple_color"/> + android:alpha="0.12" android:color="?android:colorPrimary"/> <item android:state_hovered="true" android:state_selected="true" - android:alpha="0.04" android:color="@color/chip_ripple_color"/> + android:alpha="0.04" android:color="?android:colorPrimary"/> <item android:state_selected="true" - android:alpha="0.00" android:color="@color/chip_ripple_color"/> + android:alpha="0.00" android:color="?android:colorPrimary"/> <!-- Unselected. --> - <item android:state_pressed="true" android:alpha="0.16" android:color="@color/text_hint"/> + <item android:state_pressed="true" android:alpha="0.16" android:color="?android:textColorSecondary"/> <item android:state_focused="true" android:state_hovered="true" - android:alpha="0.16" android:color="@color/text_hint"/> - <item android:state_focused="true" android:alpha="0.12" android:color="@color/text_hint"/> - <item android:state_hovered="true" android:alpha="0.04" android:color="@color/text_hint"/> - <item android:alpha="0.00" android:color="@color/text_hint"/> + android:alpha="0.16" android:color="?android:textColorSecondary"/> + <item android:state_focused="true" android:alpha="0.12" android:color="?android:textColorSecondary"/> + <item android:state_hovered="true" android:alpha="0.04" android:color="?android:textColorSecondary"/> + <item android:alpha="0.00" android:color="?android:textColorSecondary"/> </selector>
\ No newline at end of file diff --git a/res/color/search_chip_stroke_color.xml b/res/color/search_chip_stroke_color.xml index a92670e70..be169354e 100644 --- a/res/color/search_chip_stroke_color.xml +++ b/res/color/search_chip_stroke_color.xml @@ -18,6 +18,6 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_selected="true" android:color="@android:color/transparent"/> <item android:state_pressed="true" android:color="@android:color/transparent"/> - <item android:state_enabled="true" android:color="@color/hairline"/> + <item android:state_enabled="true" android:color="?android:strokeColor"/> <item android:state_enabled="false" android:color="@android:color/transparent"/> </selector>
\ No newline at end of file diff --git a/res/color/search_chip_text_color.xml b/res/color/search_chip_text_color.xml index b18675210..0457ba25a 100644 --- a/res/color/search_chip_text_color.xml +++ b/res/color/search_chip_text_color.xml @@ -16,7 +16,7 @@ --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_selected="true" android:color="?attr/colorAccent"/> - <item android:state_enabled="true" android:color="?attr/colorOnSurface"/> - <item android:state_enabled="false" android:color="@color/text_hint"/> + <item android:state_selected="true" android:color="?android:colorPrimary"/> + <item android:state_enabled="true" android:color="?android:textColorSecondary"/> + <item android:state_enabled="false" android:color="?android:textColorSecondary" android:alpha="0.3"/> </selector>
\ No newline at end of file diff --git a/res/drawable-ldrtl/roots_list_border.xml b/res/drawable-ldrtl/roots_list_border.xml index c8e845702..7f3387a9d 100644 --- a/res/drawable-ldrtl/roots_list_border.xml +++ b/res/drawable-ldrtl/roots_list_border.xml @@ -21,6 +21,6 @@ <shape android:shape="rectangle"> <stroke android:width="1dp" - android:color="@color/drawer_border" /> + android:color="?android:strokeColor"/> </shape> </inset>
\ No newline at end of file diff --git a/res/drawable-night/grid_item_background.xml b/res/drawable-night/grid_item_background.xml deleted file mode 100644 index 1767d401c..000000000 --- a/res/drawable-night/grid_item_background.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2016 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. ---> - -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:drawable="@color/item_doc_background_selected" - android:state_selected="true" /> - <item android:drawable="@color/item_hover_color" - android:state_drag_hovered="true" /> - <item android:drawable="@color/item_doc_background" - android:state_selected="false" /> -</selector>
\ No newline at end of file diff --git a/res/drawable/grid_item_background.xml b/res/drawable/grid_item_background.xml index 76649f182..9c4e644a8 100644 --- a/res/drawable/grid_item_background.xml +++ b/res/drawable/grid_item_background.xml @@ -15,10 +15,13 @@ --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:drawable="@color/item_doc_background_selected" - android:state_selected="true" /> - <item android:drawable="@color/item_hover_color" - android:state_drag_hovered="true" /> - <item android:drawable="@color/item_doc_background" - android:state_selected="false" /> + <item android:state_selected="true"> + <color android:color="?android:colorSecondary"/> + </item> + <item android:state_drag_hovered="true"> + <color android:color="?android:strokeColor"/> + </item> + <item android:state_selected="false"> + <color android:color="?android:colorBackground"/> + </item> </selector>
\ No newline at end of file diff --git a/res/drawable/ic_arrow_back.xml b/res/drawable/ic_arrow_back.xml index 10b59095e..1a9993033 100644 --- a/res/drawable/ic_arrow_back.xml +++ b/res/drawable/ic_arrow_back.xml @@ -20,6 +20,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> <path - android:fillColor="?android:textColorPrimary" + android:fillColor="?android:colorControlNormal" android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/> </vector>
\ No newline at end of file diff --git a/res/drawable/ic_check.xml b/res/drawable/ic_check.xml index fd378eeb0..a6df08a93 100644 --- a/res/drawable/ic_check.xml +++ b/res/drawable/ic_check.xml @@ -18,7 +18,7 @@ Copyright (C) 2018 The Android Open Source Project android:height="24dp" android:viewportWidth="24.0" android:viewportHeight="24.0" - android:tint="?attr/colorAccent"> + android:tint="?android:attr/colorPrimary"> <path android:fillColor="@android:color/white" android:pathData="vM9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/> diff --git a/res/drawable/ic_check_circle.xml b/res/drawable/ic_check_circle.xml index 62a4e34b4..13b45bd8e 100644 --- a/res/drawable/ic_check_circle.xml +++ b/res/drawable/ic_check_circle.xml @@ -19,6 +19,6 @@ Copyright (C) 2016 The Android Open Source Project android:viewportWidth="24.0" android:viewportHeight="24.0"> <path - android:fillColor="?android:attr/colorAccent" + android:fillColor="?android:attr/colorPrimary" android:pathData="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10,-4.48 10,-10S17.52 2 12 2zm-2 15l-5,-5 1.41,-1.41L10 14.17l7.59,-7.59L19 8l-9 9z"/> </vector> diff --git a/res/drawable/ic_eject.xml b/res/drawable/ic_eject.xml index b94daebe7..0e1b36f33 100644 --- a/res/drawable/ic_eject.xml +++ b/res/drawable/ic_eject.xml @@ -19,6 +19,6 @@ Copyright (C) 2016 The Android Open Source Project android:viewportWidth="24.0" android:viewportHeight="24.0"> <path - android:fillColor="@color/root_icon_color" + android:fillColor="#5F6368" android:pathData="M5 17h14v2H5zm7-12L5.33 15h13.34z"/> </vector>
\ No newline at end of file diff --git a/res/drawable/ic_exit_to_app.xml b/res/drawable/ic_exit_to_app.xml index 808ca86ee..b597def5b 100644 --- a/res/drawable/ic_exit_to_app.xml +++ b/res/drawable/ic_exit_to_app.xml @@ -19,6 +19,6 @@ Copyright (C) 2018 The Android Open Source Project android:viewportWidth="24.0" android:viewportHeight="24.0"> <path - android:fillColor="?android:textColorPrimary" + android:fillColor="#5F6368" android:pathData="M10.09 15.59L11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/> </vector> diff --git a/res/drawable/ic_root_download.xml b/res/drawable/ic_root_download.xml index 5f156a4f9..56c7ea7f0 100644 --- a/res/drawable/ic_root_download.xml +++ b/res/drawable/ic_root_download.xml @@ -20,6 +20,6 @@ android:viewportHeight="24" android:viewportWidth="24"> <path - android:fillColor="@color/root_icon_color" + android:fillColor="#5F6368" android:pathData="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z" /> </vector> diff --git a/res/drawable/ic_root_recent.xml b/res/drawable/ic_root_recent.xml index f45d01ff0..cbc33407e 100644 --- a/res/drawable/ic_root_recent.xml +++ b/res/drawable/ic_root_recent.xml @@ -21,11 +21,11 @@ android:viewportHeight="24"> <path - android:fillColor="@color/root_icon_color" + android:fillColor="#5F6368" android:pathData="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" /> <path - android:fillColor="@color/root_icon_color" + android:fillColor="#5F6368" android:pathData="M12.5 7H11v6l5.25 3.15 .75 -1.23-4.5-2.67z" /> </vector>
\ No newline at end of file diff --git a/res/drawable/ic_root_smartphone.xml b/res/drawable/ic_root_smartphone.xml index 956ea29dd..ad647ffd1 100644 --- a/res/drawable/ic_root_smartphone.xml +++ b/res/drawable/ic_root_smartphone.xml @@ -19,6 +19,6 @@ Copyright (C) 2015 The Android Open Source Project android:viewportWidth="24.0" android:viewportHeight="24.0"> <path - android:fillColor="@color/root_icon_color" + android:fillColor="#5F6368" android:pathData="M17 1.01L7 1c-1.1 0,-2 .9,-2 2v18c0 1.1.9 2 2 2h10c1.1 0 2,-.9 2,-2V3c0,-1.1,-.9,-1.99,-2,-1.99zM17 19H7V5h10v14z"/> </vector> diff --git a/res/drawable/ic_sd_storage.xml b/res/drawable/ic_sd_storage.xml index f711a5f86..8d9e4a671 100644 --- a/res/drawable/ic_sd_storage.xml +++ b/res/drawable/ic_sd_storage.xml @@ -19,6 +19,6 @@ Copyright (C) 2015 The Android Open Source Project android:viewportWidth="24.0" android:viewportHeight="24.0"> <path - android:fillColor="@color/root_icon_color" + android:fillColor="#5F6368" android:pathData="M18 2h-8L4.02 8 4 20c0 1.1.9 2 2 2h12c1.1 0 2,-.9 2,-2V4c0,-1.1,-.9,-2,-2,-2zm-6 6h-2V4h2v4zm3 0h-2V4h2v4zm3 0h-2V4h2v4z"/> </vector> diff --git a/res/drawable/list_item_background.xml b/res/drawable/list_item_background.xml index 3b42f9b66..afbeecd27 100644 --- a/res/drawable/list_item_background.xml +++ b/res/drawable/list_item_background.xml @@ -15,13 +15,17 @@ --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:drawable="@color/item_doc_background_selected" - android:state_focused="true" /> - <item android:drawable="@color/item_doc_background_selected" - android:state_selected="true" /> - <item android:drawable="@color/item_hover_color" - android:state_drag_hovered="true" /> - <item android:drawable="@color/app_background_color" - android:state_selected="false" - android:state_focused="false"/> + <item android:state_focused="true" > + <color android:color="?android:colorSecondary"/> + </item> + <item android:state_selected="true"> + <color android:color="?android:colorSecondary"/> + </item> + <item android:state_drag_hovered="true"> + <color android:color="?android:strokeColor"/> + </item> + <item android:state_selected="false" + android:state_focused="false"> + <color android:color="@color/app_background_color"/> + </item> </selector>
\ No newline at end of file diff --git a/res/drawable/menu_dropdown_panel.xml b/res/drawable/menu_dropdown_panel.xml index bde535e8b..f750f0d5a 100644 --- a/res/drawable/menu_dropdown_panel.xml +++ b/res/drawable/menu_dropdown_panel.xml @@ -20,7 +20,7 @@ <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" - android:tint="?android:attr/colorBackground"> + android:tint="?android:attr/colorBackgroundFloating"> <stroke android:width="2dp" android:color="#3C4043" /> <solid android:color="#5F6368" /> <corners @@ -35,7 +35,7 @@ <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" - android:tint="?android:attr/colorBackground"> + android:tint="?android:attr/colorBackgroundFloating"> <corners android:topRightRadius="@dimen/material_round_radius" android:topLeftRadius="@dimen/material_round_radius" diff --git a/res/drawable/root_item_background.xml b/res/drawable/root_item_background.xml index c0ec6e821..6eca486eb 100644 --- a/res/drawable/root_item_background.xml +++ b/res/drawable/root_item_background.xml @@ -20,13 +20,13 @@ android:color="?android:attr/colorControlHighlight"> <item android:id="@android:id/mask" - android:drawable="@drawable/root_list_selector_mask"/> + android:drawable="@drawable/root_list_selector"/> <item> <selector> - <item - app:state_highlighted="true" - android:drawable="@color/item_hover_color"/> + <item app:state_highlighted="true"> + <color android:color="?android:attr/colorControlHighlight"/> + </item> <item app:state_highlighted="false" android:drawable="@android:color/transparent"/> diff --git a/res/drawable/root_list_selector.xml b/res/drawable/root_list_selector.xml index 50c851a7f..911c2edc5 100644 --- a/res/drawable/root_list_selector.xml +++ b/res/drawable/root_list_selector.xml @@ -25,6 +25,6 @@ android:bottomLeftRadius="2dp" android:bottomRightRadius="2dp"/> <solid - android:color="?android:attr/colorControlHighlight"/> + android:color="?android:attr/colorSecondary"/> </shape> </inset>
\ No newline at end of file diff --git a/res/drawable/root_list_selector_mask.xml b/res/drawable/root_list_selector_mask.xml deleted file mode 100644 index 381c95d64..000000000 --- a/res/drawable/root_list_selector_mask.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2016 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. ---> -<inset xmlns:android="http://schemas.android.com/apk/res/android" - android:inset="8dp"> - <shape - xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle"> - <corners - android:topLeftRadius="2dp" - android:topRightRadius="2dp" - android:bottomLeftRadius="2dp" - android:bottomRightRadius="2dp"/> - <solid - android:color="@android:color/white"/> - </shape> -</inset>
\ No newline at end of file diff --git a/res/drawable/text_cursor.xml b/res/drawable/text_cursor.xml deleted file mode 100644 index e5a606af2..000000000 --- a/res/drawable/text_cursor.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2017 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. ---> -<shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle" > - <size android:width="1dp" /> - <solid android:color="@color/text_hint"/> -</shape>
\ No newline at end of file diff --git a/res/layout/apps_item.xml b/res/layout/apps_item.xml index 20e4fea13..91d94a3f4 100644 --- a/res/layout/apps_item.xml +++ b/res/layout/apps_item.xml @@ -40,8 +40,7 @@ android:layout_height="wrap_content" android:layout_marginStart="@dimen/apps_row_item_text_margin_horizontal" android:layout_marginEnd="@dimen/apps_row_item_text_margin_horizontal" - android:textSize="12sp" - android:textColor="?android:textColorPrimary" + android:textAppearance="@style/AppsItemText" android:maxLines="1" android:ellipsize="end" android:gravity="center"/> @@ -53,6 +52,6 @@ android:layout_marginTop="@dimen/apps_row_exit_icon_margin_top" android:scaleType="centerInside" android:src="@drawable/ic_exit_to_app" - android:tint="@color/item_action_icon"/> + android:tint="?android:textColorSecondary"/> </LinearLayout>
\ No newline at end of file diff --git a/res/layout/directory_header.xml b/res/layout/directory_header.xml index e671bd288..602055bf5 100644 --- a/res/layout/directory_header.xml +++ b/res/layout/directory_header.xml @@ -49,8 +49,7 @@ android:id="@+id/sub_menu" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="end|center_vertical" - android:theme="@style/SubMenuStyle"/> + android:layout_gravity="end|center_vertical"/> </LinearLayout> diff --git a/res/layout/drawer_layout.xml b/res/layout/drawer_layout.xml index 6752fde40..0b8aff47a 100644 --- a/res/layout/drawer_layout.xml +++ b/res/layout/drawer_layout.xml @@ -88,8 +88,8 @@ android:layout_height="?android:attr/actionBarSize" android:background="?android:attr/colorBackground" android:elevation="0dp" - android:theme="?actionBarTheme" - android:popupTheme="?actionBarPopupTheme" /> + app:titleTextAppearance="@style/DrawerMenuTitle" + app:titleTextColor="?android:colorPrimary"/> <FrameLayout android:id="@+id/container_roots" diff --git a/res/layout/inspector_header.xml b/res/layout/inspector_header.xml index 937f9138d..94a092790 100644 --- a/res/layout/inspector_header.xml +++ b/res/layout/inspector_header.xml @@ -24,6 +24,6 @@ android:layout_height="match_parent" android:scaleType="fitCenter" android:alpha="0.0" - android:background="?attr/gridItemColor" /> + android:background="?android:colorBackgroundFloating" /> </RelativeLayout> diff --git a/res/layout/item_dir_grid.xml b/res/layout/item_dir_grid.xml index b33cfc0b8..06948f60a 100644 --- a/res/layout/item_dir_grid.xml +++ b/res/layout/item_dir_grid.xml @@ -38,7 +38,7 @@ android:duplicateParentState="true" app:cardElevation="0dp" app:strokeWidth="1dp" - app:strokeColor="@color/hairline"> + app:strokeColor="?android:strokeColor"> <!-- The height is 48px. paddingTop (9dp) + @dimen/check_icon_size (30dp) + paddingBottom (9dp) --> diff --git a/res/layout/item_doc_grid.xml b/res/layout/item_doc_grid.xml index 359519501..cd7d37f73 100644 --- a/res/layout/item_doc_grid.xml +++ b/res/layout/item_doc_grid.xml @@ -37,7 +37,7 @@ android:duplicateParentState="true" app:cardElevation="0dp" app:strokeWidth="1dp" - app:strokeColor="@color/hairline"> + app:strokeColor="?android:strokeColor"> <RelativeLayout android:layout_width="match_parent" diff --git a/res/layout/item_doc_list.xml b/res/layout/item_doc_list.xml index 818f44d55..c485edb05 100644 --- a/res/layout/item_doc_list.xml +++ b/res/layout/item_doc_list.xml @@ -142,7 +142,7 @@ android:layout_height="@dimen/check_icon_size" android:layout_gravity="center" android:scaleType="fitCenter" - android:tint="?android:attr/textColorPrimary" + android:tint="?android:attr/colorControlNormal" android:src="@drawable/ic_zoom_out"/> </FrameLayout> diff --git a/res/layout/item_root.xml b/res/layout/item_root.xml index 7a36d7fd2..439eaff6b 100644 --- a/res/layout/item_root.xml +++ b/res/layout/item_root.xml @@ -18,15 +18,15 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" - android:minHeight="48dp" - android:paddingStart="25dp" + android:minHeight="52dp" + android:paddingStart="24dp" android:gravity="center_vertical" android:orientation="horizontal" android:baselineAligned="false" android:background="@drawable/root_item_background"> <FrameLayout - android:layout_width="@dimen/icon_size" + android:layout_width="wrap_content" android:layout_height="@dimen/icon_size" android:duplicateParentState="true"> @@ -43,7 +43,7 @@ <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingStart="7dp" + android:paddingStart="16dp" android:paddingTop="8dp" android:paddingBottom="8dp" android:orientation="vertical" @@ -82,7 +82,7 @@ <ImageView android:id="@+id/action_icon" android:focusable="false" - android:layout_width="@dimen/root_icon_size" + android:layout_width="@dimen/root_action_icon_size" android:layout_height="match_parent" android:layout_gravity="center" android:scaleType="centerInside"/> diff --git a/res/layout/search_chip_item.xml b/res/layout/search_chip_item.xml index 0028922b7..94103acf3 100644 --- a/res/layout/search_chip_item.xml +++ b/res/layout/search_chip_item.xml @@ -21,10 +21,11 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="@dimen/search_chip_spacing" + android:textAppearance="@style/SearchChipText" android:textColor="@color/search_chip_text_color" app:checkedIcon="@drawable/ic_check" app:chipBackgroundColor="@color/search_chip_background_color" - app:chipCornerRadius="8dp" + app:chipCornerRadius="@dimen/search_chip_radius" app:chipStrokeColor="@color/search_chip_stroke_color" app:chipStrokeWidth="1dp" app:iconStartPadding="@dimen/search_chip_icon_padding" diff --git a/res/values-night/colors.xml b/res/values-night/colors.xml index 90d616b72..36c092201 100644 --- a/res/values-night/colors.xml +++ b/res/values-night/colors.xml @@ -14,25 +14,10 @@ limitations under the License. --> <resources> - <color name="accent">#64B5F6</color> - <color name="primary">#64B5F6</color> - <color name="secondary">#3D64B5F6</color> - <color name="hairline">#455A64</color> - <color name="app_background_color">#202124</color> + <color name="background_floating">#3C4043</color> - <color name="root_icon_color">#9AA0A6</color> - - <color name="chip_selected_background_color">#FF3D4657</color> - <color name="chip_ripple_color">#FF5195EA</color> - - <color name="item_doc_background">#ff3c4043</color> - <color name="item_doc_background_disabled">#fff1f3f4</color> - <color name="item_doc_background_selected">#4d2297f0</color> - <color name="item_grid_tint">#ff0e70e8</color> - <color name="item_hover_color">#ff5f6368</color> - - <color name="text_hint">#fff8f9fa</color> - <color name="text_handle">#ff3ce4fa</color> - <color name="text_primary">#EEEEEE</color> + <color name="primary">#8AB4F8</color> + <color name="secondary">#3D8AB4F8</color> + <color name="hairline">#5F6368</color> </resources> diff --git a/res/values-night/styles.xml b/res/values-night/styles.xml index e7bc1d300..b5fa036c6 100644 --- a/res/values-night/styles.xml +++ b/res/values-night/styles.xml @@ -15,16 +15,8 @@ --> <resources xmlns:android="http://schemas.android.com/apk/res/android"> - <style name="CardViewStyle" parent="@style/Widget.MaterialComponents.CardView"> - <item name="android:colorBackgroundFloating">@drawable/grid_item_background</item> - <item name="cardPreventCornerOverlap">false</item> - <item name="cardCornerRadius">@dimen/grid_item_radius</item> - <item name="cardElevation">@dimen/grid_item_elevation</item> - </style> - <style name="BottomSheetDialogStyle" parent="@style/Theme.MaterialComponents.BottomSheetDialog"> - <item name="colorBackgroundFloating">@drawable/grid_item_background</item> - <item name="android:textColorPrimary">?android:textColorPrimaryInverse</item> + <item name="android:colorBackground">@color/app_background_color</item> <item name="android:statusBarColor">@android:color/transparent</item> <item name="android:windowIsFloating">false</item> <item name="bottomSheetStyle">@style/BottomSheet</item> diff --git a/res/values-night/themes.xml b/res/values-night/themes.xml index add52e4a5..18fd59bf2 100644 --- a/res/values-night/themes.xml +++ b/res/values-night/themes.xml @@ -23,18 +23,18 @@ <item name="android:actionModeCloseDrawable">@drawable/ic_action_clear</item> <!-- Color section --> - <item name="android:colorAccent">@color/accent</item> + <item name="android:colorAccent">@color/primary</item> <item name="android:colorBackground">@color/app_background_color</item> - <item name="android:colorBackgroundFloating">@color/item_doc_background</item> + <item name="android:colorBackgroundFloating">@color/background_floating</item> <item name="android:colorControlHighlight">@color/ripple_material_dark</item> - <item name="android:colorControlActivated">@color/root_activated_color</item> + <item name="android:colorControlActivated">@color/primary</item> <item name="android:colorPrimary">@color/primary</item> <item name="android:colorSecondary">@color/secondary</item> + <item name="android:strokeColor">@color/hairline</item> <!-- System | Widget section --> <item name="android:listDivider">@drawable/list_divider</item> <item name="android:statusBarColor">?android:attr/colorBackground</item> - <item name="android:navigationBarColor">?android:colorBackground</item> <item name="android:windowBackground">?android:attr/colorBackground</item> <item name="android:windowLightStatusBar">false</item> <item name="android:windowLightNavigationBar">false</item> @@ -50,16 +50,13 @@ <item name="windowActionModeOverlay">true</item> <!-- For material design widget, chips, buttons, not support attr--> - <item name="colorAccent">@color/accent</item> <item name="colorPrimary">@color/primary</item> - <item name="colorSecondary">@color/secondary</item> <item name="gridItemTint">@color/item_doc_grid_tint</item> - <item name="gridItemColor">@color/item_doc_background</item> - <item name="gridItemSelectedColor">@color/item_doc_background_selected</item> - <item name="gridItemDisableColor">@color/item_doc_background_disabled</item> + <item name="actionBarTheme">@style/ActionBarTheme</item> <item name="actionModeStyle">@style/ActionModeStyle</item> + <item name="actionOverflowButtonStyle">@style/OverflowButtonStyle</item> <item name="actionOverflowMenuStyle">@style/OverflowMenuStyle</item> <item name="bottomSheetDialogTheme">@style/BottomSheetDialogStyle</item> <item name="materialButtonStyle">@style/MaterialButton</item> @@ -67,7 +64,5 @@ <item name="materialCardViewStyle">@style/CardViewStyle</item> <item name="queryBackground">@color/menu_search_background</item> <item name="snackbarButtonStyle">@style/SnackbarButtonStyle</item> - <item name="textHandleColor">@color/text_handle</item> - <item name="textCursorColor">@color/text_hint</item> </style> </resources> diff --git a/res/values/attrs.xml b/res/values/attrs.xml index e5ea8fd7f..de29725cb 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -59,13 +59,8 @@ <attr name="android:windowLightNavigationBar" /> </declare-styleable> - <declare-styleable name="TextHandleView"> - <attr name="textHandleColor" format="reference" /> - <attr name="textCursorColor" format="reference" /> - </declare-styleable> - <declare-styleable name="SwipeRefresh"> - <attr name="android:colorAccent" /> + <attr name="android:colorPrimary" /> </declare-styleable> <declare-styleable name="MaterialButtons"> diff --git a/res/values/colors.xml b/res/values/colors.xml index 699178ff9..a5bcf4ccd 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -20,43 +20,24 @@ app background (e.g. the drawer overlay). --> <color name="app_background_color">@android:color/white</color> - <color name="drawer_border">#ffd4d4d4</color> - <color name="menu_search_background">@android:color/transparent</color> - - <color name="accent">#1E88E5</color> - <color name="primary">#1E88E5</color> - <color name="secondary">#E3F2FD</color> - <color name="hairline">#90A4AE</color> - - <color name="text_handle">#ffcdf5fa</color> - <color name="text_hint">#ff80868b</color> + <color name="background_floating">@android:color/white</color> - <color name="band_select_background">#88ffffff</color> - <color name="band_select_border">#44000000</color> - - <color name="root_icon_color">#5F6368</color> - <color name="root_activated_color">#ff127beb</color> - - <color name="item_hover_color">#ffe0e0e0</color> - - <color name="tool_bar_gradient_max">#7f000000</color> + <color name="primary">#1E88E5</color> <!-- Blue 600 --> + <color name="secondary">#E3F2FD</color> <!-- Blue 50 --> + <color name="hairline">#E0E0E0</color> <!-- Gray 300 --> - <!-- TODO: Would be nice to move this to a color-set, but not sure how to support animation --> - <color name="item_doc_details">?android:attr/textColorSecondary</color> - <color name="item_doc_background">@android:color/white</color> - <color name="item_doc_background_disabled">#fff4f4f4</color> - <color name="item_doc_background_selected">#4d3367d6</color> - <color name="item_grid_tint">#ff127beb</color> + <color name="chip_background_disable_color">#fff1f3f4</color> + <color name="menu_search_background">@android:color/transparent</color> <color name="item_breadcrumb_background_hovered">#1affffff</color> <color name="item_drag_shadow_background">@android:color/white</color> <color name="item_drag_shadow_container_background">@android:color/transparent</color> + <color name="tool_bar_gradient_max">#7f000000</color> + + <color name="band_select_background">#88ffffff</color> + <color name="band_select_border">#44000000</color> <color name="downloads_icon_background">#ff4688f2</color> <color name="app_icon_background">#ff4688f2</color> <color name="shortcut_foreground">#ff3367d6</color> <color name="shortcut_background">#fff5f5f5</color> - - <color name="chip_background_disable_color">#fff1f3f4</color> - <color name="chip_selected_background_color">#FFE8F0FE</color> - <color name="chip_ripple_color">#FF4285f4</color> </resources> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 9575ec28f..19ca226d2 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -24,6 +24,7 @@ <dimen name="root_icon_size">24dp</dimen> <dimen name="root_icon_margin">0dp</dimen> <dimen name="root_spacer_padding">0dp</dimen> + <dimen name="root_action_icon_size">18dp</dimen> <dimen name="root_icon_disabled_alpha">?android:attr/disabledAlpha</dimen> <dimen name="check_icon_size">30dp</dimen> <dimen name="zoom_icon_size">22dp</dimen> @@ -87,6 +88,7 @@ <dimen name="search_chip_group_margin">8dp</dimen> <dimen name="search_chip_spacing">8dp</dimen> <dimen name="search_chip_icon_padding">4dp</dimen> + <dimen name="search_chip_radius">16dp</dimen> <dimen name="dialog_content_padding_top">18dp</dimen> <dimen name="dialog_content_padding_bottom">24dp</dimen> diff --git a/res/values/overlayable.xml b/res/values/overlayable.xml index 34a9f2e43..c0074ab58 100644 --- a/res/values/overlayable.xml +++ b/res/values/overlayable.xml @@ -25,8 +25,13 @@ <item type="style" name="DocumentsTheme"/> <!-- END THEME / STYLE --> + <!-- START COLOR --> + <item type="color" name="primary"/> + <!-- END COLOR --> + <!-- START DIMEN --> <item type="dimen" name="grid_item_radius"/> + <item type="dimen" name="search_chip_radius"/> <!-- END DIMEN --> <!-- START DRAWABLE --> @@ -34,16 +39,22 @@ <item type="drawable" name="ic_root_download"/> <item type="drawable" name="ic_sd_storage"/> <item type="drawable" name="root_list_selector"/> - <item type="drawable" name="root_list_selector_mask"/> <!-- END DRAWABLE --> - <!-- START CONFIG --> + <!-- START BOOLEAN CONFIG --> <item type="bool" name="config_button_all_caps"/> + <item type="bool" name="config_default_show_device_root"/> + <item type="bool" name="feature_default_root_in_browse"/> <item type="bool" name="is_launcher_enabled"/> + <!-- END BOOLEAN CONFIG --> + + <!-- START STRING CONFIG --> + <item type="string" name="config_fontFamily"/> + <item type="string" name="config_fontFamilyMedium"/> <item type="string" name="default_root_uri"/> <item type="string" name="preferred_root_package"/> <item type="string" name="trusted_quick_viewer_package"/> - <!-- END CONFIG --> + <!-- END STRING CONFIG --> </policy> <!-- END VENDOR CUSTOMIZATION --> diff --git a/res/values/strings_font.xml b/res/values/strings_font.xml index 581aac6f4..4279ef119 100644 --- a/res/values/strings_font.xml +++ b/res/values/strings_font.xml @@ -16,13 +16,9 @@ <resources> - <!-- Name of a font family to use for headlines. If empty, falls back to platform default --> - <string name="config_headlineFontFamily" translatable="false">sans-serif</string> - <!-- Name of a font family to use for headlines. Defaults to sans-serif-light --> - <string name="config_headlineFontFamilyLight" translatable="false">sans-serif</string> - <!-- Allows setting custom fontFeatureSettings on specific text. --> - <!--<string name="config_headlineFontFeatureSettings" translatable="false">ss03</string>--> - <!-- Name of the font family used for headlines. --> - <string name="config_headlineFontFamilyMedium" translatable="false">sans-serif-medium</string> + <!-- Name of a font family. If empty, falls back to platform default --> + <string name="config_fontFamily" translatable="false">sans-serif</string> + <!-- Name of the font family medium. --> + <string name="config_fontFamilyMedium" translatable="false">sans-serif-medium</string> </resources> diff --git a/res/values/styles.xml b/res/values/styles.xml index 65e5b19d1..a160660e2 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -15,6 +15,9 @@ --> <resources xmlns:android="http://schemas.android.com/apk/res/android"> + <style name="ActionBarTheme" parent="@style/ThemeOverlay.AppCompat.ActionBar"> + <item name="colorControlNormal">?android:textColorSecondary</item> + </style> <style name="ActionModeStyle" parent="Widget.AppCompat.ActionMode"> <!-- attr "height" was used by support lib should not in overlay scope --> @@ -23,7 +26,7 @@ </style> <style name="CardViewStyle" parent="@style/Widget.MaterialComponents.CardView"> - <item name="cardBackgroundColor">@color/item_doc_background</item> + <item name="cardBackgroundColor">@color/app_background_color</item> <item name="cardPreventCornerOverlap">false</item> <item name="cardCornerRadius">@dimen/grid_item_radius</item> <item name="cardElevation">@dimen/grid_item_elevation</item> @@ -36,12 +39,11 @@ </style> <style name="SnackbarButtonStyle" parent="@style/Widget.AppCompat.Button.Borderless"> - <item name="android:textColor">@color/accent</item> + <item name="android:textColor">?android:colorPrimary</item> </style> - <style name="BottomSheetDialogStyle" parent="@style/Theme.MaterialComponents.BottomSheetDialog"> - <item name="android:colorBackground">@android:color/white</item> - <item name="android:textColorPrimary">?android:textColorPrimaryInverse</item> + <style name="BottomSheetDialogStyle" parent="@Theme.MaterialComponents.Light.BottomSheetDialog"> + <item name="android:colorBackground">@color/app_background_color</item> <item name="android:windowLightNavigationBar">true</item> <item name="android:statusBarColor">@android:color/transparent</item> <item name="android:navigationBarColor">?android:attr/colorBackground</item> @@ -54,16 +56,16 @@ <item name="android:background">@drawable/bottom_sheet_dialog_background</item> </style> + <style name="OverflowButtonStyle" parent="@style/Widget.AppCompat.ActionButton.Overflow"> + <item name="android:tint">?android:colorControlNormal</item> + </style> + <style name="OverflowMenuStyle" parent="@style/Widget.AppCompat.PopupMenu.Overflow"> <item name="android:popupBackground">@drawable/menu_dropdown_panel</item> <item name="android:dropDownWidth">wrap_content</item> <item name="android:overlapAnchor">false</item> </style> - <style name="SubMenuStyle"> - <item name="android:textColorSecondary">?android:attr/textColorPrimary</item> - </style> - <style name="MaterialButton" parent="@style/Widget.MaterialComponents.Button.UnelevatedButton"> <item name="android:textAppearance">@style/MaterialButtonTextAppearance</item> </style> diff --git a/res/values/styles_text.xml b/res/values/styles_text.xml index fe1efff91..c2ac1e43f 100644 --- a/res/values/styles_text.xml +++ b/res/values/styles_text.xml @@ -16,7 +16,7 @@ <resources> <style name="SortTitle" parent="@style/TextAppearance.MaterialComponents.Headline6"> <item name="android:textColor">?android:attr/textColorPrimary</item> - <item name="android:textSize">14sp</item> + <item name="android:textSize">11sp</item> </style> <style name="SortList" parent="@style/TextAppearance.AppCompat.Subhead"> @@ -26,7 +26,18 @@ <style name="SearchBarTitle" parent="@style/TextAppearance.Widget.AppCompat.Toolbar.Subtitle"> <item name="android:textColor">?android:attr/textColorSecondary</item> <item name="android:textSize">@dimen/search_bar_text_size</item> - <item name="fontFamily">@string/config_headlineFontFamily</item> + <item name="fontFamily">@string/config_fontFamily</item> + </style> + + <style name="SearchChipText"> + <item name="android:textSize">14sp</item> + <item name="fontFamily">@string/config_fontFamilyMedium</item> + </style> + + <style name="AppsItemText"> + <item name="android:textColor">?android:attr/textColorSecondary</item> + <item name="android:textSize">12sp</item> + <item name="fontFamily">@string/config_fontFamily</item> </style> <style name="CardPrimaryText" parent="@style/TextAppearance.AppCompat.Subhead"> @@ -34,14 +45,19 @@ <item name="android:textSize">14sp</item> </style> - <style name="DrawerMenuTitle" parent="@android:style/TextAppearance.Material.Title"/> + <style name="DrawerMenuTitle" parent="@android:style/TextAppearance.Material.Title"> + <item name="android:textSize">24sp</item> + <item name="fontFamily">@string/config_fontFamilyMedium</item> + </style> <style name="DrawerMenuPrimary" parent="android:style/TextAppearance.Material.Body2"> + <item name="android:textSize">14sp</item> <item name="android:textColor">@color/item_root_primary_text</item> + <item name="fontFamily">@string/config_fontFamilyMedium</item> </style> <style name="DrawerMenuSecondary" parent="android:style/TextAppearance.Material.Body2"> - <item name="android:textSize">13sp</item> + <item name="android:textSize">12sp</item> <item name="android:textColor">@color/item_root_secondary_text</item> </style> @@ -51,7 +67,7 @@ <style name="MaterialButtonTextAppearance" parent="@style/TextAppearance.MaterialComponents.Button"> <item name="android:textAllCaps">@bool/config_button_all_caps</item> - <item name="fontFamily">@string/config_headlineFontFamilyMedium</item> + <item name="fontFamily">@string/config_fontFamilyMedium</item> </style> </resources>
\ No newline at end of file diff --git a/res/values/themes.xml b/res/values/themes.xml index e94137530..61e32230a 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -23,19 +23,20 @@ <item name="android:actionModeCloseDrawable">@drawable/ic_action_clear</item> <!-- Color section --> - <item name="android:colorAccent">@color/accent</item> + <item name="android:colorAccent">@color/primary</item> <item name="android:colorBackground">@android:color/white</item> - <item name="android:colorBackgroundFloating">@color/item_doc_background</item> + <item name="android:colorBackgroundFloating">@color/background_floating</item> <item name="android:colorControlHighlight">@color/ripple_material_light</item> - <item name="android:colorControlActivated">@color/root_activated_color</item> + <item name="android:colorControlActivated">@color/primary</item> <item name="android:colorPrimary">@color/primary</item> <item name="android:colorSecondary">@color/secondary</item> + <item name="android:strokeColor">@color/hairline</item> <!-- System | Widget section --> <item name="android:listDivider">@drawable/list_divider</item> <item name="android:statusBarColor">?android:colorBackground</item> <item name="android:navigationBarColor">?android:colorBackground</item> - <item name="android:navigationBarDividerColor">@color/drawer_border</item> + <item name="android:navigationBarDividerColor">@color/hairline</item> <item name="android:windowBackground">?android:colorBackground</item> <item name="android:windowLightStatusBar">true</item> <item name="android:windowLightNavigationBar">true</item> @@ -53,25 +54,20 @@ <item name="windowActionModeOverlay">true</item> <!-- For material design widget, chips, buttons, not support attr--> - <item name="colorAccent">@color/accent</item> <item name="colorPrimary">@color/primary</item> - <item name="colorSecondary">@color/secondary</item> <!-- TODO need to solve the error handle in GridItemThumbnail --> <item name="gridItemTint">@color/item_doc_grid_tint</item> - <item name="gridItemColor">@color/item_doc_background</item> - <item name="gridItemSelectedColor">@color/item_doc_background_selected</item> - <item name="gridItemDisableColor">@color/item_doc_background_disabled</item> + <item name="actionBarTheme">@style/ActionBarTheme</item> <item name="actionModeStyle">@style/ActionModeStyle</item> + <item name="actionOverflowButtonStyle">@style/OverflowButtonStyle</item> <item name="actionOverflowMenuStyle">@style/OverflowMenuStyle</item> - <item name="bottomSheetDialogTheme">@style/BottomSheetDialogStyle</item>tem> + <item name="bottomSheetDialogTheme">@style/BottomSheetDialogStyle</item> <item name="materialButtonStyle">@style/MaterialButton</item> <item name="materialButtonOutlinedStyle">@style/MaterialOutlinedButton</item> <item name="materialCardViewStyle">@style/CardViewStyle</item> <item name="queryBackground">@color/menu_search_background</item> <item name="snackbarButtonStyle">@style/SnackbarButtonStyle</item> - <item name="textHandleColor">@color/text_handle</item> - <item name="textCursorColor">@color/text_hint</item> </style> </resources> diff --git a/src/com/android/documentsui/DrawerController.java b/src/com/android/documentsui/DrawerController.java index 8251f9a8e..e5996558b 100644 --- a/src/com/android/documentsui/DrawerController.java +++ b/src/com/android/documentsui/DrawerController.java @@ -18,24 +18,18 @@ package com.android.documentsui; import static com.android.documentsui.base.SharedMinimal.DEBUG; -import androidx.annotation.IntDef; import android.app.Activity; +import android.util.Log; +import android.view.View; + import androidx.annotation.ColorRes; import androidx.appcompat.widget.Toolbar; -import androidx.legacy.app.ActionBarDrawerToggle; import androidx.drawerlayout.widget.DrawerLayout; import androidx.drawerlayout.widget.DrawerLayout.DrawerListener; - -import android.content.res.ColorStateList; -import android.content.res.TypedArray; -import android.util.Log; -import android.view.View; +import androidx.legacy.app.ActionBarDrawerToggle; import com.android.documentsui.base.Display; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - /** * A facade over the various pieces comprising "roots fragment in a Drawer". * @@ -63,14 +57,6 @@ public abstract class DrawerController implements DrawerListener { View drawer = activity.findViewById(R.id.drawer_roots); Toolbar toolbar = (Toolbar) activity.findViewById(R.id.roots_toolbar); - if (toolbar != null) { - final TypedArray ta = activity.obtainStyledAttributes(R.style.DrawerMenuTitle, - R.styleable.DrawerMenuTitle); - final int titleColor = ta.getColor(R.styleable.DrawerMenuTitle_android_textColor, - activity.getTitleColor()); - ta.recycle(); - toolbar.setTitleTextColor(titleColor); - } drawer.getLayoutParams().width = calculateDrawerWidth(activity); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( @@ -144,7 +130,7 @@ public abstract class DrawerController implements DrawerListener { public void setDropTargetHighlight(View v, boolean highlight) { assert (v.getId() == R.id.drawer_edge); - @ColorRes int id = highlight ? R.color.item_doc_background_selected : + @ColorRes int id = highlight ? R.color.secondary : android.R.color.transparent; v.setBackgroundColor(id); } diff --git a/src/com/android/documentsui/dirlist/DocumentsSwipeRefreshLayout.java b/src/com/android/documentsui/dirlist/DocumentsSwipeRefreshLayout.java index dbb1c403a..69daba65a 100644 --- a/src/com/android/documentsui/dirlist/DocumentsSwipeRefreshLayout.java +++ b/src/com/android/documentsui/dirlist/DocumentsSwipeRefreshLayout.java @@ -18,14 +18,13 @@ package com.android.documentsui.dirlist; import android.content.Context; import android.content.res.TypedArray; - -import androidx.annotation.ColorRes; -import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; - import android.util.AttributeSet; import android.util.Log; import android.view.MotionEvent; +import androidx.annotation.ColorRes; +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; + import com.android.documentsui.R; /** @@ -44,11 +43,11 @@ public class DocumentsSwipeRefreshLayout extends SwipeRefreshLayout { super(context, attrs); TypedArray a = context.obtainStyledAttributes(R.styleable.SwipeRefresh); - @ColorRes int colorId = a.getResourceId(R.styleable.SwipeRefresh_android_colorAccent, + @ColorRes int colorId = a.getResourceId(R.styleable.SwipeRefresh_android_colorPrimary, -1); if (colorId == -1) { - Log.w(TAG, "Retrive colorAccent colorId from theme fail, assign R.color.accent"); - colorId = R.color.accent; + Log.w(TAG, "Retrive colorPrimary colorId from theme fail, assign R.color.primary"); + colorId = R.color.primary; } a.recycle(); setColorSchemeResources(colorId); diff --git a/src/com/android/documentsui/files/FilesActivity.java b/src/com/android/documentsui/files/FilesActivity.java index 8457538c2..297a3f3a2 100644 --- a/src/com/android/documentsui/files/FilesActivity.java +++ b/src/com/android/documentsui/files/FilesActivity.java @@ -106,7 +106,7 @@ public class FilesActivity extends BaseActivity implements ActionHandler.Addons mInjector.selectionMgr, mDrawer, this::focusSidebar, - getColor(R.color.accent)); + getColor(R.color.primary)); mInjector.menuManager = new MenuManager( mInjector.features, diff --git a/src/com/android/documentsui/picker/PickActivity.java b/src/com/android/documentsui/picker/PickActivity.java index dc0a16e80..aece47b03 100644 --- a/src/com/android/documentsui/picker/PickActivity.java +++ b/src/com/android/documentsui/picker/PickActivity.java @@ -27,14 +27,14 @@ import android.net.Uri; import android.os.Bundle; import android.os.SystemClock; import android.provider.DocumentsContract; -import androidx.annotation.CallSuper; -import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentManager; - import android.view.KeyEvent; import android.view.Menu; import android.view.MenuItem; +import androidx.annotation.CallSuper; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; + import com.android.documentsui.ActionModeController; import com.android.documentsui.BaseActivity; import com.android.documentsui.DocsSelectionHelper; @@ -104,7 +104,7 @@ public class PickActivity extends BaseActivity implements ActionHandler.Addons { mInjector.selectionMgr, mDrawer, this::focusSidebar, - getColor(R.color.accent)); + getColor(R.color.primary)); mInjector.menuManager = new MenuManager(mSearchManager, mState, new DirectoryDetails(this)); diff --git a/tests/unit/com/android/documentsui/overlay/OverlayableTest.java b/tests/unit/com/android/documentsui/overlay/OverlayableTest.java index 44599bc31..17d437efa 100644 --- a/tests/unit/com/android/documentsui/overlay/OverlayableTest.java +++ b/tests/unit/com/android/documentsui/overlay/OverlayableTest.java @@ -98,13 +98,6 @@ public class OverlayableTest extends ThemeUiTestBase { } @Test - public void testDrawable_icRootListSelectorMask_isDrawable() { - assertThat( - mTargetContext.getResources().getDrawable( - R.drawable.root_list_selector_mask)).isInstanceOf(Drawable.class); - } - - @Test public void testDimen_gridItemRadius_isReasonable() { int MAX_RADIUS = 160; assertThat( diff --git a/tests/unit/com/android/documentsui/ui/DarkThemeUiTest.java b/tests/unit/com/android/documentsui/ui/DarkThemeUiTest.java index cb18dc1e4..20bcbaff2 100644 --- a/tests/unit/com/android/documentsui/ui/DarkThemeUiTest.java +++ b/tests/unit/com/android/documentsui/ui/DarkThemeUiTest.java @@ -18,7 +18,6 @@ package com.android.documentsui.ui; import android.content.Context; import android.content.res.Configuration; -import android.graphics.Color; import androidx.test.InstrumentationRegistry; import androidx.test.filters.SmallTest; @@ -53,12 +52,6 @@ public class DarkThemeUiTest extends ThemeUiTestBase { } @Test - public void themeNightModeEnable_gridItemBackgroundColorShouldBeDark() { - assertTheme(R.styleable.GridItem, R.styleable.GridItem_gridItemColor, - mTheme.getResources().getColor(R.color.item_doc_background, mTheme)); - } - - @Test public void themeNightModeEnable_gridItemTintColorShouldBeThemeable() { assertTheme(R.styleable.GridItem, R.styleable.GridItem_gridItemTint, mTheme.getResources().getColor(R.color.item_doc_grid_tint, mTheme)); @@ -79,7 +72,7 @@ public class DarkThemeUiTest extends ThemeUiTestBase { @Test public void themeNightModeEnable_navigationBarColorShouldBeDark() { assertTheme(R.styleable.SystemWindow, R.styleable.SystemWindow_android_navigationBarColor, - mTheme.getResources().getColor(R.color.app_background_color, mTheme)); + mTheme.getResources().getColor(android.R.color.black, mTheme)); } @Test @@ -95,14 +88,8 @@ public class DarkThemeUiTest extends ThemeUiTestBase { } @Test - public void appCompatThemeNightModeEnable_colorAccentShouldBeThemeable() { - assertTheme(R.styleable.AppCompatTheme, R.styleable.AppCompatTheme_colorAccent, - mTheme.getResources().getColor(R.color.accent, mTheme)); - } - - @Test public void appCompatThemeNightModeEnable_colorPrimaryShouldBeThemeable() { assertTheme(R.styleable.AppCompatTheme, R.styleable.AppCompatTheme_colorPrimary, - mTheme.getResources().getColor(R.color.accent, mTheme)); + mTheme.getResources().getColor(R.color.primary, mTheme)); } }
\ No newline at end of file diff --git a/tests/unit/com/android/documentsui/ui/ThemeUiTest.java b/tests/unit/com/android/documentsui/ui/ThemeUiTest.java index 66f66dc5c..473b6fb8f 100644 --- a/tests/unit/com/android/documentsui/ui/ThemeUiTest.java +++ b/tests/unit/com/android/documentsui/ui/ThemeUiTest.java @@ -49,11 +49,6 @@ public class ThemeUiTest extends ThemeUiTestBase { } @Test - public void themeNightModeDisable_gridItemBackgroundColorShouldBeLight() { - assertTheme(R.styleable.GridItem, R.styleable.GridItem_gridItemColor, Color.WHITE); - } - - @Test public void themeNightModeDisable_gridItemTintColorShouldBeThemeable() { assertTheme(R.styleable.GridItem, R.styleable.GridItem_gridItemTint, mTheme.getResources().getColor(R.color.item_doc_grid_tint, mTheme)); @@ -90,14 +85,8 @@ public class ThemeUiTest extends ThemeUiTestBase { } @Test - public void appCompatThemeNightModeDisable_colorAccentShouldBeThemeable() { - assertTheme(R.styleable.AppCompatTheme, R.styleable.AppCompatTheme_colorAccent, - mTheme.getResources().getColor(R.color.accent, mTheme)); - } - - @Test public void appCompatThemeNightModeDisable_colorPrimaryShouldBeThemeable() { assertTheme(R.styleable.AppCompatTheme, R.styleable.AppCompatTheme_colorPrimary, - mTheme.getResources().getColor(R.color.accent, mTheme)); + mTheme.getResources().getColor(R.color.primary, mTheme)); } } |