summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/popup
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2017-06-06 15:42:32 -0700
committerTony Wickham <twickham@google.com>2017-06-06 16:34:20 -0700
commit90038ebab21ce22eb2bdaf72b0dddfcaa81dcd4e (patch)
tree13fe4379cd80c8980bfb1485d49b837625c7211e /src/com/android/launcher3/popup
parent561e53577b150d2f4a8d4c45931bd763f9fbd5ac (diff)
downloadandroid_packages_apps_Trebuchet-90038ebab21ce22eb2bdaf72b0dddfcaa81dcd4e.tar.gz
android_packages_apps_Trebuchet-90038ebab21ce22eb2bdaf72b0dddfcaa81dcd4e.tar.bz2
android_packages_apps_Trebuchet-90038ebab21ce22eb2bdaf72b0dddfcaa81dcd4e.zip
Add support for popup dark theme
Bug: 62380473 Change-Id: Ib22e9b82841bf10b7f139638f268f0a878e3c6b9
Diffstat (limited to 'src/com/android/launcher3/popup')
-rw-r--r--src/com/android/launcher3/popup/PopupContainerWithArrow.java15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
index fa4caab8b..131abbad9 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);