summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2017-06-26 10:48:41 -0700
committerTony Wickham <twickham@google.com>2017-06-26 17:50:29 +0000
commit093c3ac7c3e265bda0b9dbd29138ced28126e14e (patch)
treedf6931db4af2589b8e7579493a35f2cf44b13e80
parent03a38a669cc01123858c309c5536c0c8d86bb831 (diff)
downloadandroid_packages_apps_Trebuchet-093c3ac7c3e265bda0b9dbd29138ced28126e14e.tar.gz
android_packages_apps_Trebuchet-093c3ac7c3e265bda0b9dbd29138ced28126e14e.tar.bz2
android_packages_apps_Trebuchet-093c3ac7c3e265bda0b9dbd29138ced28126e14e.zip
Add dark widgets theme
Bug: 62907264 Change-Id: I9831e071eab9a746d1aacab7d023371cc4a631ef
-rw-r--r--res/layout/widgets_bottom_sheet.xml3
-rw-r--r--res/layout/widgets_view.xml2
-rw-r--r--res/values-v26/styles.xml4
-rw-r--r--res/values/attrs.xml1
-rw-r--r--res/values/styles.xml4
-rw-r--r--src/com/android/launcher3/widget/WidgetsBottomSheet.java3
6 files changed, 13 insertions, 4 deletions
diff --git a/res/layout/widgets_bottom_sheet.xml b/res/layout/widgets_bottom_sheet.xml
index f1370f0c4..e8c6961f4 100644
--- a/res/layout/widgets_bottom_sheet.xml
+++ b/res/layout/widgets_bottom_sheet.xml
@@ -22,7 +22,8 @@
android:paddingTop="28dp"
android:background="?android:attr/colorPrimary"
android:elevation="@dimen/deep_shortcuts_elevation"
- android:layout_gravity="bottom">
+ android:layout_gravity="bottom"
+ android:theme="?attr/widgetsTheme">
<TextView
style="@style/TextTitle"
diff --git a/res/layout/widgets_view.xml b/res/layout/widgets_view.xml
index 47b068385..558556ad8 100644
--- a/res/layout/widgets_view.xml
+++ b/res/layout/widgets_view.xml
@@ -24,7 +24,7 @@
android:layout_height="match_parent"
android:descendantFocusability="afterDescendants"
launcher:revealBackground="@drawable/round_rect_primary"
- android:theme="@style/WidgetContainerTheme">
+ android:theme="?attr/widgetsTheme">
<View
android:id="@+id/reveal_view"
diff --git a/res/values-v26/styles.xml b/res/values-v26/styles.xml
index cb184094d..fd6fc4d50 100644
--- a/res/values-v26/styles.xml
+++ b/res/values-v26/styles.xml
@@ -21,6 +21,10 @@
<style name="WidgetContainerTheme" parent="@android:style/Theme.DeviceDefault.Settings">
<item name="android:colorEdgeEffect">?android:attr/textColorSecondary</item>
</style>
+ <style name="WidgetContainerTheme.Dark" parent="LauncherThemeDark">
+ <item name="android:colorEdgeEffect">?android:attr/textColorSecondary</item>
+ <item name="android:colorPrimaryDark">#616161</item> <!-- Gray 700 -->
+ </style>
<!-- From O and above, we show a dark nav bar in all-apps -->
<style name="AllAppsNavBarProtection">
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 27992ceb6..fc95002d8 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -30,6 +30,7 @@
<attr name="workspaceAmbientShadowColor" format="color"/>
<attr name="workspaceKeyShadowColor" format="color" />
<attr name="workspaceStatusBarScrim" format="reference" />
+ <attr name="widgetsTheme" format="reference" />
<!-- BubbleTextView specific attributes. -->
<declare-styleable name="BubbleTextView">
diff --git a/res/values/styles.xml b/res/values/styles.xml
index b982136da..bc12bb688 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -40,6 +40,7 @@
<item name="workspaceAmbientShadowColor">#33000000</item>
<item name="workspaceKeyShadowColor">#44000000</item>
<item name="workspaceStatusBarScrim">@drawable/workspace_bg</item>
+ <item name="widgetsTheme">@style/WidgetContainerTheme</item>
</style>
<style name="LauncherTheme" parent="@style/BaseLauncherThemeWithCustomAttrs"></style>
@@ -64,6 +65,7 @@
<item name="popupColorPrimary">?android:attr/colorPrimary</item>
<item name="popupColorSecondary">#424242</item> <!-- Gray 800 -->
<item name="popupColorTertiary">#757575</item> <!-- Gray 600 -->
+ <item name="widgetsTheme">@style/WidgetContainerTheme.Dark</item>
<item name="isMainColorDark">true</item>
</style>
@@ -85,6 +87,8 @@
<item name="android:textColorSecondary">?android:attr/textColorSecondaryInverse</item>
</style>
+ <style name="WidgetContainerTheme.Dark" />
+
<style name="FastScrollerPopup" >
<item name="android:layout_width">wrap_content</item>
<item name="android:minWidth">@dimen/fastscroll_popup_width</item>
diff --git a/src/com/android/launcher3/widget/WidgetsBottomSheet.java b/src/com/android/launcher3/widget/WidgetsBottomSheet.java
index cea58b994..4055c3f17 100644
--- a/src/com/android/launcher3/widget/WidgetsBottomSheet.java
+++ b/src/com/android/launcher3/widget/WidgetsBottomSheet.java
@@ -23,7 +23,6 @@ import android.content.Context;
import android.graphics.Rect;
import android.support.v4.view.animation.FastOutSlowInInterpolator;
import android.util.AttributeSet;
-import android.view.ContextThemeWrapper;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
@@ -77,7 +76,7 @@ public class WidgetsBottomSheet extends AbstractFloatingView implements Insettab
}
public WidgetsBottomSheet(Context context, AttributeSet attrs, int defStyleAttr) {
- super(new ContextThemeWrapper(context, R.style.WidgetContainerTheme), attrs, defStyleAttr);
+ super(context, attrs, defStyleAttr);
setWillNotDraw(false);
mLauncher = Launcher.getLauncher(context);
mOpenCloseAnimator = LauncherAnimUtils.ofPropertyValuesHolder(this);