summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adrian Roos <roosa@google.com> 2017-03-16 15:17:57 -0700
committer Adrian Roos <roosa@google.com> 2017-04-04 13:21:35 -0700
commitd83e9999f73f479da14e716c825da4dbf169b657 (patch)
treece60e9052aedaddd24db83fe24eb5948e9a64cdf
parent2b33162e82ba0c0d4af45c1c73157745a0adc061 (diff)
AOD: update AOD2 views to spec
- Increase notification header size - Dim clock in AOD2 - Hide shelf in AOD2 Bug: 30876804 Test: manual Change-Id: I272ff54bd0dbed0ae4271c922f62304401651fc9
-rw-r--r--core/java/android/app/Notification.java2
-rw-r--r--core/res/res/layout/notification_template_material_ambient.xml6
-rw-r--r--core/res/res/values/dimens.xml3
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java23
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java14
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java9
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java2
9 files changed, 59 insertions, 11 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 4bbc003cfdfa..6c7421f8eb5a 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -3793,9 +3793,9 @@ public class Notification implements Parcelable
// Ambient view does not have these
bindHeaderText(contentView);
bindHeaderChronometerAndTime(contentView);
- bindExpandButton(contentView);
bindProfileBadge(contentView);
}
+ bindExpandButton(contentView);
}
private void bindExpandButton(RemoteViews contentView) {
diff --git a/core/res/res/layout/notification_template_material_ambient.xml b/core/res/res/layout/notification_template_material_ambient.xml
index e2c68b51b733..f3aa0485bbd2 100644
--- a/core/res/res/layout/notification_template_material_ambient.xml
+++ b/core/res/res/layout/notification_template_material_ambient.xml
@@ -20,6 +20,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:tag="ambient"
+ android:paddingStart="@dimen/notification_extra_margin_ambient"
+ android:paddingEnd="@dimen/notification_extra_margin_ambient"
>
<include layout="@layout/notification_template_header" />
@@ -52,7 +54,7 @@
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:textSize="20sp"
- android:textColor="#e6fafafa"
+ android:textColor="#ffffffff"
/>
<TextView android:id="@+id/text"
android:layout_width="match_parent"
@@ -63,7 +65,7 @@
android:gravity="top"
android:visibility="gone"
android:textSize="16sp"
- android:textColor="#ccfafafa"
+ android:textColor="#eeffffff"
android:layout_marginTop="4dp"
/>
</LinearLayout>
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index 112964778053..b82542af521f 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -165,6 +165,9 @@
-->
<dimen name="notification_content_plus_picture_margin_end">72dp</dimen>
+ <!-- The additional margin on the sides of the ambient view. -->
+ <dimen name="notification_extra_margin_ambient">16dp</dimen>
+
<!-- The height of the notification action list -->
<dimen name="notification_action_list_height">56dp</dimen>
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
index 26558377c3cc..80b4da8e2acf 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
@@ -34,9 +34,11 @@ import android.widget.GridLayout;
import android.widget.TextClock;
import android.widget.TextView;
+import com.android.internal.util.ArrayUtils;
import com.android.internal.widget.LockPatternUtils;
import com.android.systemui.ChargingView;
+import java.util.Arrays;
import java.util.Locale;
public class KeyguardStatusView extends GridLayout {
@@ -53,6 +55,10 @@ public class KeyguardStatusView extends GridLayout {
private ViewGroup mClockContainer;
private ChargingView mBatteryDoze;
+ private View[] mVisibleInDoze;
+ private boolean mPulsing;
+ private boolean mDark;
+
private KeyguardUpdateMonitorCallback mInfoCallback = new KeyguardUpdateMonitorCallback() {
@Override
@@ -117,6 +123,7 @@ public class KeyguardStatusView extends GridLayout {
mClockView.setShowCurrentUserTime(true);
mOwnerInfo = (TextView) findViewById(R.id.owner_info);
mBatteryDoze = (ChargingView) findViewById(R.id.battery_doze);
+ mVisibleInDoze = new View[]{mBatteryDoze, mClockView};
boolean shouldMarquee = KeyguardUpdateMonitor.getInstance(mContext).isDeviceInteractive();
setEnableMarquee(shouldMarquee);
@@ -273,14 +280,28 @@ public class KeyguardStatusView extends GridLayout {
}
public void setDark(boolean dark) {
+ mDark = dark;
+
final int N = mClockContainer.getChildCount();
for (int i = 0; i < N; i++) {
View child = mClockContainer.getChildAt(i);
- if (child == mClockView || child == mBatteryDoze) {
+ if (ArrayUtils.contains(mVisibleInDoze, child)) {
continue;
}
child.setAlpha(dark ? 0 : 1);
}
+ updateDozeVisibleViews();
mBatteryDoze.setDark(dark);
}
+
+ public void setPulsing(boolean pulsing) {
+ mPulsing = pulsing;
+ updateDozeVisibleViews();
+ }
+
+ private void updateDozeVisibleViews() {
+ for (View child : mVisibleInDoze) {
+ child.setAlpha(mDark && mPulsing ? 0.5f : 1);
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
index 8da17fa76bd7..a0f2891493e4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
@@ -167,7 +167,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
openedAmount = Math.min(1.0f, openedAmount);
mShelfState.openedAmount = openedAmount;
mShelfState.clipTopAmount = 0;
- mShelfState.alpha = 1.0f;
+ mShelfState.alpha = mAmbientState.isPulsing() ? 0 : 1;
mShelfState.belowSpeedBump = mAmbientState.getSpeedBumpIndex() == 0;
mShelfState.shadowAlpha = 1.0f;
mShelfState.hideSensitive = false;
@@ -602,6 +602,11 @@ public class NotificationShelf extends ActivatableNotificationView implements
}
@Override
+ public boolean hasOverlappingRendering() {
+ return false; // Shelf only uses alpha for transitions where the difference can't be seen.
+ }
+
+ @Override
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft,
int oldTop, int oldRight, int oldBottom) {
updateRelativeOffset();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index c24a2a09f3cb..307a8c7b16dc 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -2472,4 +2472,8 @@ public class NotificationPanelView extends PanelView implements
public void setNoVisibleNotifications(boolean noNotifications) {
mNoVisibleNotifications = noNotifications;
}
+
+ public void setPulsing(boolean pulsing) {
+ mKeyguardStatusView.setPulsing(pulsing);
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index e1fceb63a572..992d63291bcf 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -89,7 +89,6 @@ import android.os.Vibrator;
import android.provider.Settings;
import android.service.notification.NotificationListenerService.RankingMap;
import android.service.notification.StatusBarNotification;
-import android.support.annotation.VisibleForTesting;
import android.util.ArraySet;
import android.util.DisplayMetrics;
import android.util.EventLog;
@@ -241,7 +240,6 @@ import com.android.systemui.RecentsComponent;
import com.android.systemui.SwipeHelper;
import com.android.systemui.SystemUI;
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin.MenuItem;
-import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper;
import com.android.systemui.recents.Recents;
import com.android.systemui.statusbar.policy.RemoteInputView;
import com.android.systemui.statusbar.stack.StackStateAnimator;
@@ -5019,16 +5017,20 @@ public class StatusBar extends SystemUI implements DemoMode,
if (!mHeadsUpManager.getAllEntries().isEmpty()) {
// Only pulse the stack scroller if there's actually something to show.
// Otherwise just show the always-on screen.
- mStackScroller.setPulsing(true);
- mVisualStabilityManager.setPulsing(true);
+ setPulsing(true);
}
}
@Override
public void onPulseFinished() {
callback.onPulseFinished();
- mStackScroller.setPulsing(false);
- mVisualStabilityManager.setPulsing(false);
+ setPulsing(false);
+ }
+
+ private void setPulsing(boolean pulsing) {
+ mStackScroller.setPulsing(pulsing);
+ mNotificationPanel.setPulsing(pulsing);
+ mVisualStabilityManager.setPulsing(pulsing);
}
}, reason);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java
index fe83dc47649e..b2b23a55cd20 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java
@@ -59,6 +59,7 @@ public class AmbientState {
private boolean mPanelTracking;
private boolean mExpansionChanging;
private boolean mPanelFullWidth;
+ private boolean mPulsing;
public AmbientState(Context context) {
reload(context);
@@ -285,6 +286,14 @@ public class AmbientState {
mPanelTracking = panelTracking;
}
+ public boolean isPulsing() {
+ return mPulsing;
+ }
+
+ public void setPulsing(boolean pulsing) {
+ mPulsing = pulsing;
+ }
+
public boolean isPanelTracking() {
return mPanelTracking;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
index 7d2d0df3f0d4..5bead730fcf1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -4060,9 +4060,11 @@ public class NotificationStackScrollLayout extends ViewGroup
return;
}
mPulsing = pulsing;
+ mAmbientState.setPulsing(pulsing);
updateNotificationAnimationStates();
updateContentHeight();
notifyHeightChangeListener(mShelf);
+ requestChildrenUpdate();
}
public void setFadingOut(boolean fadingOut) {