diff options
author | Lucas Dupin <dupin@google.com> | 2019-01-03 17:50:52 -0800 |
---|---|---|
committer | Lucas Dupin <dupin@google.com> | 2019-01-18 13:57:04 -0800 |
commit | 00be88f1fddecd4c477139b3f25b0cb1bf7e15b6 (patch) | |
tree | 5dc9dd47560c6a3fdf7dcfe36965b26657fafa09 /packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java | |
parent | 3d36dd83a9c107b98455a0e00b0a6614f6a8ee1d (diff) |
New pulsing notification layout
Test: wake up with power
Test: look at shelf on lock screen
Test: lock device w/ notifications from home screen
Test: receive notification on AOD
Test: atest KeyguardClockPositionAlgorithmTest
Test: atest NotificationRoundnessManagerTest
Test: atest ScrimControllerTest
Test: atest NotificationContentViewTest
Bug: 111405682
Change-Id: I9b4f2febd56a62256124567bffebc9f5f8255847
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java index 669e6fff525b..bac7844c024b 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java @@ -90,7 +90,7 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe */ private Runnable mContentChangeListener; private Slice mSlice; - private boolean mPulsing; + private boolean mHasHeader; public KeyguardSliceView(Context context) { this(context, null, 0); @@ -150,10 +150,18 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe Dependency.get(ConfigurationController.class).removeCallback(this); } + /** + * Returns whether the current visible slice has a title/header. + */ + public boolean hasHeader() { + return mHasHeader; + } + private void showSlice() { Trace.beginSection("KeyguardSliceView#showSlice"); - if (mPulsing || mSlice == null) { + if (mSlice == null) { mRow.setVisibility(GONE); + mHasHeader = false; if (mContentChangeListener != null) { mContentChangeListener.run(); } @@ -162,7 +170,7 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe ListContent lc = new ListContent(getContext(), mSlice); SliceContent headerContent = lc.getHeader(); - boolean hasHeader = headerContent != null + mHasHeader = headerContent != null && !headerContent.getSliceItem().hasHint(HINT_LIST_ITEM); List<SliceContent> subItems = new ArrayList<>(); for (int i = 0; i < lc.getRowItems().size(); i++) { @@ -177,7 +185,7 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe mClickActions.clear(); final int subItemsCount = subItems.size(); final int blendedColor = getTextColor(); - final int startIndex = hasHeader ? 1 : 0; // First item is header; skip it + final int startIndex = mHasHeader ? 1 : 0; // First item is header; skip it mRow.setVisibility(subItemsCount > 0 ? VISIBLE : GONE); for (int i = startIndex; i < subItemsCount; i++) { RowContent rc = (RowContent) subItems.get(i); @@ -189,7 +197,7 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe button = new KeyguardSliceButton(mContext); button.setTextColor(blendedColor); button.setTag(itemTag); - final int viewIndex = i - (hasHeader ? 1 : 0); + final int viewIndex = i - (mHasHeader ? 1 : 0); mRow.addView(button, viewIndex); } @@ -234,18 +242,6 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe Trace.endSection(); } - public void setPulsing(boolean pulsing, boolean animate) { - mPulsing = pulsing; - LayoutTransition transition = getLayoutTransition(); - if (!animate) { - setLayoutTransition(null); - } - showSlice(); - if (!animate) { - setLayoutTransition(transition); - } - } - public void setDarkAmount(float darkAmount) { mDarkAmount = darkAmount; mRow.setDarkAmount(darkAmount); |