Gallery2: dark theme
* Screenshot: https://imgur.com/a/uDPEWxA
Change-Id: I30e37c261173924b95e1a41d0e1e1f960ad8e9ac
Signed-off-by: Timi <timi.rautamaki@gmail.com>
diff --git a/res/drawable/dropdown_ic_arrow_normal_holo_dark.xml b/res/drawable/dropdown_ic_arrow_normal_holo_dark.xml
index 49788bf..f3dee76 100644
--- a/res/drawable/dropdown_ic_arrow_normal_holo_dark.xml
+++ b/res/drawable/dropdown_ic_arrow_normal_holo_dark.xml
@@ -35,6 +35,6 @@
android:viewportWidth="24.0">
<path
android:fillAlpha="0.54"
- android:fillColor="@color/black"
+ android:fillColor="@color/multiselect_icon_color"
android:pathData="M0,5h24l-12,14L0,5z" />
-</vector>
\ No newline at end of file
+</vector>
diff --git a/res/drawable/multiselect_delete.xml b/res/drawable/multiselect_delete.xml
index b3faf7b..209575e 100644
--- a/res/drawable/multiselect_delete.xml
+++ b/res/drawable/multiselect_delete.xml
@@ -33,7 +33,7 @@
android:viewportWidth="72.0"
android:viewportHeight="72.0">
<path
- android:fillColor="@color/black"
+ android:fillColor="@color/multiselect_icon_color"
android:pathData="M59,10L46.92,10l-2.16,-4L27,6l-2.16,4L13,10a1,1 0,0 0,-1 1v4a1,1 0,0 0,1 1h46a1,1 0,0 0,1 -1L60,11A1,1 0,0 0,59 10ZM16,60a6,6 0,0 0,6 6h28a6,6 0,0 0,6 -6L56,20L16,20v40Z"
android:fillAlpha="0.54"/>
</vector>
diff --git a/res/drawable/multiselect_more.xml b/res/drawable/multiselect_more.xml
index a8a23de..4b59500 100644
--- a/res/drawable/multiselect_more.xml
+++ b/res/drawable/multiselect_more.xml
@@ -33,7 +33,7 @@
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
- android:fillColor="@color/black"
+ android:fillColor="@color/multiselect_icon_color"
android:pathData="M12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2c-1.1,0 -2,0.9 -2,2S10.9,8 12,8zM12,10c-1.1,0 -2,0.9 -2,2c0,1.1 0.9,2 2,2c1.1,0 2,-0.9 2,-2C14,10.9 13.1,10 12,10zM12,16c-1.1,0 -2,0.9 -2,2s0.9,2 2,2c1.1,0 2,-0.9 2,-2S13.1,16 12,16z"
android:fillAlpha="0.54"/>
</vector>
diff --git a/res/drawable/multiselect_share.xml b/res/drawable/multiselect_share.xml
index 5c265c0..6a426b1 100644
--- a/res/drawable/multiselect_share.xml
+++ b/res/drawable/multiselect_share.xml
@@ -33,7 +33,7 @@
android:viewportWidth="72.0"
android:viewportHeight="72.0">
<path
- android:fillColor="@color/black"
+ android:fillColor="@color/multiselect_icon_color"
android:pathData="M54,48c-2.4,0 -4.5,0.9 -6.1,2.4L26.7,38.3c0.2,-0.8 0.3,-1.5 0.3,-2.4c0,-0.8 -0.1,-1.6 -0.3,-2.4l21.2,-12.1c1.6,1.7 3.7,2.6 6.1,2.6c5,0 9,-4 9,-9s-4,-9 -9,-9s-9,4 -9,9c0,0.8 0.1,1.6 0.3,2.3L24.1,29.4C22.5,27.9 20.4,27 18,27c-5,0 -9,4 -9,9s4,9 9,9c2.4,0 4.5,-0.9 6.1,-2.4l21.2,12.1C45.1,55.4 45,56.2 45,57c0,5 4,9 9,9s9,-4 9,-9S59,48 54,48z"
android:fillAlpha="0.54"/>
</vector>
diff --git a/res/drawable/multiselected_back.xml b/res/drawable/multiselected_back.xml
index 0e237bf..37c846a 100644
--- a/res/drawable/multiselected_back.xml
+++ b/res/drawable/multiselected_back.xml
@@ -33,7 +33,7 @@
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
- android:fillColor="@color/black"
+ android:fillColor="@color/multiselect_icon_color"
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8l8,8l1.41,-1.41L7.83,13H20V11z"
android:fillAlpha="0.54"/>
</vector>
diff --git a/res/layout/action_mode.xml b/res/layout/action_mode.xml
index 186ce5b..ff5c60f 100644
--- a/res/layout/action_mode.xml
+++ b/res/layout/action_mode.xml
@@ -33,7 +33,7 @@
style="?android:attr/actionButtonStyle"
android:divider="?android:attr/listDividerAlertDialog"
android:textAppearance="?android:attr/textAppearanceLargePopupMenu"
- android:textColor="@color/black_transparent_4"
+ android:textColor="@color/multiselect_action_text_color"
android:textSize="18sp"
android:singleLine="true"
android:gravity="start|center_vertical"
diff --git a/res/layout/details.xml b/res/layout/details.xml
index 0c3622b..c0e6ab5 100644
--- a/res/layout/details.xml
+++ b/res/layout/details.xml
@@ -19,6 +19,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
- android:textColor="@color/albumset_label_background"
+ android:textColor="@color/details_text_color"
android:gravity="start"
/>
diff --git a/res/layout/popup_list_item.xml b/res/layout/popup_list_item.xml
index a2f7c31..b6c880e 100644
--- a/res/layout/popup_list_item.xml
+++ b/res/layout/popup_list_item.xml
@@ -20,7 +20,7 @@
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLargePopupMenu"
android:textSize="18sp"
- android:textColor="@color/black_transparent_4"
+ android:textColor="@color/primary_text"
android:singleLine="true"
android:gravity="center_vertical"
android:paddingStart="16dp"
diff --git a/res/values-night/colors.xml b/res/values-night/colors.xml
new file mode 100644
index 0000000..303b2f7
--- /dev/null
+++ b/res/values-night/colors.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (c) 2021 The LineageOS 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>
+ <color name="default_background">#212121</color>
+ <color name="primary_text">#DEFFFFFF</color>
+
+ <color name="album_background">@color/default_background</color>
+ <color name="albumlist_label_title">@color/primary_text</color>
+ <color name="albumset_background">@color/default_background</color>
+
+ <color name="details_text_color">@color/primary_text</color>
+
+ <color name="multiselect_action_text_color">@color/primary_text</color>
+ <color name="multiselect_background">@color/primary</color>
+ <color name="multiselect_icon_color">@color/white</color>
+
+ <color name="timeline_title_background_color">@color/default_background</color>
+ <color name="timeline_title_number_text_color">#99FFFFFF</color>
+ <color name="timeline_title_text_color">@color/primary_text</color>
+</resources>
diff --git a/res/values-night/styles.xml b/res/values-night/styles.xml
new file mode 100644
index 0000000..fd28769
--- /dev/null
+++ b/res/values-night/styles.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (c) 2018 The LineageOS 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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <style name="ToolbarPopUpTheme" parent="@android:style/ThemeOverlay.Material" />
+</resources>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 9388e98..e92c22d 100755
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -91,4 +91,8 @@
<color name="navigation_accent_disabled">#747474</color>
<color name="navigation_accent_enabled">@color/white</color>
+
+ <color name="details_text_color">@color/black_transparent_4</color>
+ <color name="multiselect_action_text_color">@color/black_transparent_4</color>
+ <color name="multiselect_icon_color">@color/black</color>
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 788339c..d714830 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -317,7 +317,7 @@
<item name="android:background">@drawable/bg_pressed</item>
</style>
- <style name="AppTheme" parent="Theme.AppCompat.Light">
+ <style name="AppTheme" parent="Theme.AppCompat.DayNight">
<item name="android:windowDisablePreview">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:windowBackground">@android:color/black</item>
@@ -347,7 +347,7 @@
<item name="android:textSize">@dimen/toolbar_title_text_size</item>
</style>
- <style name="ToolbarPopUpTheme" parent="android:Theme.Material.Light" />
+ <style name="ToolbarPopUpTheme" parent="@android:style/ThemeOverlay.Material.Light" />
<!-- Styles -->
<style name="MyOverFlow" parent="@android:style/Widget.Material.ActionButton.Overflow">
diff --git a/src/com/android/gallery3d/ui/PopupList.java b/src/com/android/gallery3d/ui/PopupList.java
index 37c0b87..404aac0 100644
--- a/src/com/android/gallery3d/ui/PopupList.java
+++ b/src/com/android/gallery3d/ui/PopupList.java
@@ -157,7 +157,7 @@
PopupWindow popup = new PopupWindow(mContext, null, android.R.attr.popupMenuStyle);
popup.setOnDismissListener(mOnDismissListener);
popup.setBackgroundDrawable(new ColorDrawable(
- mContext.getResources().getColor(R.color.white)));
+ mContext.getResources().getColor(R.color.default_background)));
// popup.setBackgroundDrawable(mContext.getResources().getDrawable(
// R.drawable.menu_dropdown_panel_holo_dark));