summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/notification/NotificationItemView.java
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2017-02-24 15:08:13 -0800
committerTony Wickham <twickham@google.com>2017-03-02 11:27:16 -0800
commit9407d4ab57a0c3500647f1f5f9a9a44b51d222b4 (patch)
treef71d04a0f8abead00df1762ad83abe8b4e61148c /src/com/android/launcher3/notification/NotificationItemView.java
parentf2db25398a029b6f13afccbec331e35c8007dde6 (diff)
downloadandroid_packages_apps_Trebuchet-9407d4ab57a0c3500647f1f5f9a9a44b51d222b4.tar.gz
android_packages_apps_Trebuchet-9407d4ab57a0c3500647f1f5f9a9a44b51d222b4.tar.bz2
android_packages_apps_Trebuchet-9407d4ab57a0c3500647f1f5f9a9a44b51d222b4.zip
Update notification visuals (part 2)
- Background is now white, and color beneath and divider color updated accordingly (not from color extraction) - Removed overflow text ("+6") and added it to a header ("6 Notifications"). Use "..." instead if there is an overflow. - Even spaced out icons in notification footer between the far right icon and the ellipsis - Remove code to change arrow tint, since it is always white now. This also fixes the issue where it was drawn as a rect. Bug: 35766387 Change-Id: I03bfda4ff029f23dd8b3dd1b72f534ea0e2c0816
Diffstat (limited to 'src/com/android/launcher3/notification/NotificationItemView.java')
-rw-r--r--src/com/android/launcher3/notification/NotificationItemView.java24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/com/android/launcher3/notification/NotificationItemView.java b/src/com/android/launcher3/notification/NotificationItemView.java
index efd9a3b06..a34074271 100644
--- a/src/com/android/launcher3/notification/NotificationItemView.java
+++ b/src/com/android/launcher3/notification/NotificationItemView.java
@@ -19,7 +19,6 @@ package com.android.launcher3.notification;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.Context;
-import android.content.res.ColorStateList;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.MotionEvent;
@@ -30,7 +29,6 @@ import android.widget.FrameLayout;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.R;
import com.android.launcher3.anim.PillHeightRevealOutlineProvider;
-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;
@@ -47,7 +45,7 @@ public class NotificationItemView extends PopupItemView implements LogContainerP
private static final Rect sTempRect = new Rect();
- private View mDivider;
+ private NotificationHeaderView mHeader;
private NotificationMainView mMainView;
private NotificationFooterLayout mFooter;
private SwipeHelper mSwipeHelper;
@@ -68,7 +66,7 @@ public class NotificationItemView extends PopupItemView implements LogContainerP
@Override
protected void onFinishInflate() {
super.onFinishInflate();
- mDivider = findViewById(R.id.divider);
+ mHeader = (NotificationHeaderView) findViewById(R.id.header);
mMainView = (NotificationMainView) findViewById(R.id.main_view);
mFooter = (NotificationFooterLayout) findViewById(R.id.footer);
mSwipeHelper = new SwipeHelper(SwipeHelper.X, mMainView, getContext());
@@ -95,6 +93,10 @@ public class NotificationItemView extends PopupItemView implements LogContainerP
return heightAnimator;
}
+ public void updateHeader(int notificationCount) {
+ mHeader.update(notificationCount);
+ }
+
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
if (mMainView.getNotificationInfo() == null) {
@@ -114,13 +116,6 @@ public class NotificationItemView extends PopupItemView implements LogContainerP
return mSwipeHelper.onTouchEvent(ev) || super.onTouchEvent(ev);
}
- @Override
- protected ColorStateList getAttachedArrowColor() {
- // This NotificationView itself has a different color that is only
- // revealed when dismissing notifications.
- return ColorStateList.valueOf(mFooter.getBackgroundColor());
- }
-
public void applyNotificationInfos(final List<NotificationInfo> notificationInfos) {
if (notificationInfos.isEmpty()) {
return;
@@ -135,13 +130,6 @@ public class NotificationItemView extends PopupItemView implements LogContainerP
mFooter.commitNotificationInfos();
}
- public void applyColors(IconPalette iconPalette) {
- setBackgroundTintList(ColorStateList.valueOf(iconPalette.secondaryColor));
- mDivider.setBackgroundColor(iconPalette.secondaryColor);
- mMainView.applyColors(iconPalette);
- mFooter.applyColors(iconPalette);
- }
-
public void trimNotifications(final List<String> notificationKeys) {
boolean dismissedMainNotification = !notificationKeys.contains(
mMainView.getNotificationInfo().notificationKey);