diff --git a/res/layout/deep_shortcut.xml b/res/layout/deep_shortcut.xml index 85caba4a0b..4a2ad42254 100644 --- a/res/layout/deep_shortcut.xml +++ b/res/layout/deep_shortcut.xml @@ -18,7 +18,8 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:launcher="http://schemas.android.com/apk/res-auto" android:layout_width="@dimen/bg_popup_item_width" - android:layout_height="@dimen/bg_popup_item_height" > + android:layout_height="@dimen/bg_popup_item_height" + android:theme="@style/PopupItem" > + android:background="?attr/popupColorTertiary" /> diff --git a/res/layout/horizontal_divider.xml b/res/layout/horizontal_divider.xml index 33773ebfac..167f8f5d8c 100644 --- a/res/layout/horizontal_divider.xml +++ b/res/layout/horizontal_divider.xml @@ -2,4 +2,4 @@ \ No newline at end of file + android:background="?attr/popupColorTertiary" /> \ No newline at end of file diff --git a/res/layout/notification.xml b/res/layout/notification.xml index a183c92f7a..085dfa93ce 100644 --- a/res/layout/notification.xml +++ b/res/layout/notification.xml @@ -19,6 +19,7 @@ android:id="@+id/notification_view" android:layout_width="@dimen/bg_popup_item_width" android:layout_height="wrap_content" + android:theme="@style/PopupItem" android:elevation="@dimen/deep_shortcuts_elevation"> diff --git a/res/layout/notification_footer.xml b/res/layout/notification_footer.xml index ed2212be16..86280e0b6d 100644 --- a/res/layout/notification_footer.xml +++ b/res/layout/notification_footer.xml @@ -22,7 +22,7 @@ android:elevation="@dimen/notification_elevation" android:clipChildren="false" android:layout_gravity="center_vertical" - android:background="@color/popup_background_color"> + android:background="?attr/popupColorPrimary"> + android:layout_height="@dimen/bg_popup_item_height" + android:theme="@style/PopupItem" > + android:layout_gravity="start|center_vertical" + android:backgroundTint="?android:attr/textColorTertiary"/> + android:background="?attr/popupColorTertiary" /> diff --git a/res/layout/system_shortcut_icon_only.xml b/res/layout/system_shortcut_icon_only.xml index 2b58b92eed..c59cb53319 100644 --- a/res/layout/system_shortcut_icon_only.xml +++ b/res/layout/system_shortcut_icon_only.xml @@ -16,8 +16,9 @@ + android:tint="?android:attr/textColorHint" + android:padding="@dimen/system_shortcut_header_icon_padding" + android:theme="@style/PopupItem" /> diff --git a/res/layout/system_shortcut_icons.xml b/res/layout/system_shortcut_icons.xml index 676be8e694..db59d4962c 100644 --- a/res/layout/system_shortcut_icons.xml +++ b/res/layout/system_shortcut_icons.xml @@ -21,4 +21,4 @@ android:layout_height="@dimen/system_shortcut_header_height" android:orientation="horizontal" android:gravity="end|center_vertical" - android:background="@color/popup_header_background_color" /> + android:background="?attr/popupColorSecondary" /> diff --git a/res/values-sw720dp/styles.xml b/res/values-sw720dp/styles.xml index bc65a0e9aa..168afec4bb 100644 --- a/res/values-sw720dp/styles.xml +++ b/res/values-sw720dp/styles.xml @@ -27,6 +27,11 @@ true ?android:attr/textColorSecondary @layout/all_apps_search_container + #DDFFFFFF + #FFF + #F5F5F5 + #E0E0E0 + false diff --git a/res/values/attrs.xml b/res/values/attrs.xml index eaadd475a4..b85ba3e6f1 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -20,6 +20,9 @@ + + + diff --git a/res/values/colors.xml b/res/values/colors.xml index 6deffc1393..9ac248a8e6 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -31,12 +31,8 @@ #FFF - #F5F5F5 - #FFF #757575 - #E0E0E0 #1DE9B6 - @android:color/tertiary_text_light #E0E0E0 #FFFFFF diff --git a/res/values/styles.xml b/res/values/styles.xml index f75ca4eeb1..5ef044e981 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -27,12 +27,16 @@ #FF757575 @layout/all_apps_search_container #DDFFFFFF + #FFF + #F5F5F5 + #E0E0E0 false @@ -106,12 +113,8 @@ - - - diff --git a/src/com/android/launcher3/notification/NotificationItemView.java b/src/com/android/launcher3/notification/NotificationItemView.java index 416d546eab..20707aa67e 100644 --- a/src/com/android/launcher3/notification/NotificationItemView.java +++ b/src/com/android/launcher3/notification/NotificationItemView.java @@ -34,6 +34,7 @@ import com.android.launcher3.graphics.IconPalette; import com.android.launcher3.logging.UserEventDispatcher.LogContainerProvider; import com.android.launcher3.popup.PopupItemView; import com.android.launcher3.userevent.nano.LauncherLogProto; +import com.android.launcher3.util.Themes; import java.util.List; @@ -98,7 +99,7 @@ public class NotificationItemView extends PopupItemView implements LogContainerP if (mNotificationHeaderTextColor == Notification.COLOR_DEFAULT) { mNotificationHeaderTextColor = IconPalette.resolveContrastColor(getContext(), palette.dominantColor, - getResources().getColor(R.color.popup_header_background_color)); + Themes.getAttrColor(getContext(), R.attr.popupColorSecondary)); } mHeaderCount.setTextColor(mNotificationHeaderTextColor); } diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java index fa4caab8b9..131abbad92 100644 --- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java +++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java @@ -35,7 +35,6 @@ import android.os.Build; import android.os.Handler; import android.os.Looper; import android.support.annotation.IntDef; -import android.support.v4.content.ContextCompat; import android.util.AttributeSet; import android.view.Gravity; import android.view.LayoutInflater; @@ -75,6 +74,7 @@ import com.android.launcher3.shortcuts.DeepShortcutManager; import com.android.launcher3.shortcuts.DeepShortcutView; import com.android.launcher3.shortcuts.ShortcutsItemView; import com.android.launcher3.util.PackageUserKey; +import com.android.launcher3.util.Themes; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -289,8 +289,7 @@ public class PopupContainerWithArrow extends AbstractFloatingView implements Dra if (shouldUnroundBottomCorners) { roundedCorners &= ~ROUNDED_BOTTOM_CORNERS; } - int backgroundColor = ContextCompat.getColor(getContext(), - R.color.notification_color_beneath); + int backgroundColor = Themes.getAttrColor(mLauncher, R.attr.popupColorTertiary); mNotificationItemView.setBackgroundWithCorners(backgroundColor, roundedCorners); mNotificationItemView.getMainView().setAccessibilityDelegate(mAccessibilityDelegate); @@ -315,9 +314,8 @@ public class PopupContainerWithArrow extends AbstractFloatingView implements Dra addView(item); } } - int backgroundColor = ContextCompat.getColor(getContext(), mNotificationItemView == null - ? R.color.popup_background_color - : R.color.popup_header_background_color); + int backgroundColor = Themes.getAttrColor(mLauncher, mNotificationItemView == null + ? R.attr.popupColorPrimary : R.attr.popupColorSecondary); mShortcutsItemView.setBackgroundWithCorners(backgroundColor, shortcutsItemRoundedCorners); } @@ -544,7 +542,7 @@ public class PopupContainerWithArrow extends AbstractFloatingView implements Dra // since the latter expects the arrow which hasn't been added yet. PopupItemView itemAttachedToArrow = (PopupItemView) (getChildAt(mIsAboveIcon ? getChildCount() - 1 : 0)); - arrowPaint.setColor(ContextCompat.getColor(mLauncher, R.color.popup_background_color)); + arrowPaint.setColor(Themes.getAttrColor(mLauncher, R.attr.popupColorPrimary)); // The corner path effect won't be reflected in the shadow, but shouldn't be noticeable. int radius = getResources().getDimensionPixelSize(R.dimen.popup_arrow_corner_radius); arrowPaint.setPathEffect(new CornerPathEffect(radius)); @@ -671,8 +669,7 @@ public class PopupContainerWithArrow extends AbstractFloatingView implements Dra removeNotification.playSequentially(hideArrow, showArrow); removeNotification.start(); if (mShortcutsItemView != null) { - int backgroundColor = ContextCompat.getColor(getContext(), - R.color.popup_background_color); + int backgroundColor = Themes.getAttrColor(mLauncher, R.attr.popupColorPrimary); // With notifications gone, all corners of shortcuts item should be rounded. mShortcutsItemView.setBackgroundWithCorners(backgroundColor, ROUNDED_TOP_CORNERS | ROUNDED_BOTTOM_CORNERS);