diff options
| author | 2014-06-10 17:40:42 +0200 | |
|---|---|---|
| committer | 2014-06-10 17:40:42 +0200 | |
| commit | 2f0df8ae038dbb873bf2e11e1e13c75cf95b0198 (patch) | |
| tree | 53972cde517b41c41eca828188471844b94d1070 | |
| parent | 7d447726e2cb9fae80db417012039828daab8fe7 (diff) | |
Fixed several bugs with redaction.
The Notification row was in most cases directly referring to
the private layout which lead to numerous bugs.
Bug: 15107339
Bug: 15536865
Bug: 15181880
Change-Id: Id1021eb853d67db168c9471d7dacbe5265c4ba2f
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java | 20 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java | 4 |
2 files changed, 17 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java index 530b32f6c4e4..5bad60205dc6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java @@ -209,7 +209,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { } public int getMaxExpandHeight() { - return mMaxExpandHeight; + return mShowingPublic ? mRowMinHeight : mMaxExpandHeight; } /** @@ -221,30 +221,35 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { @Override public boolean isContentExpandable() { - return mPrivateLayout.isContentExpandable(); + NotificationContentView showingLayout = getShowingLayout(); + return showingLayout.isContentExpandable(); } @Override public void setActualHeight(int height, boolean notifyListeners) { mPrivateLayout.setActualHeight(height); + mPublicLayout.setActualHeight(height); invalidate(); super.setActualHeight(height, notifyListeners); } @Override public int getMaxHeight() { - return mPrivateLayout.getMaxHeight(); + NotificationContentView showingLayout = getShowingLayout(); + return showingLayout.getMaxHeight(); } @Override public int getMinHeight() { - return mPrivateLayout.getMinHeight(); + NotificationContentView showingLayout = getShowingLayout(); + return showingLayout.getMinHeight(); } @Override public void setClipTopAmount(int clipTopAmount) { super.setClipTopAmount(clipTopAmount); mPrivateLayout.setClipTopAmount(clipTopAmount); + mPublicLayout.setClipTopAmount(clipTopAmount); } public boolean isBelowSpeedBump() { @@ -256,11 +261,16 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { } public void notifyContentUpdated() { + mPublicLayout.notifyContentUpdated(); mPrivateLayout.notifyContentUpdated(); } public boolean isShowingLayoutLayouted() { - View showingLayout = mShowingPublic ? mPublicLayout : mPrivateLayout; + NotificationContentView showingLayout = getShowingLayout(); return showingLayout.getWidth() != 0; } + + private NotificationContentView getShowingLayout() { + return mShowingPublic ? mPublicLayout : mPrivateLayout; + } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java index f9baecbf6e69..5cde9792aa00 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java @@ -106,7 +106,7 @@ public class NotificationContentView extends FrameLayout { private void selectLayout() { if (mActualHeight <= mSmallHeight || mExpandedChild == null) { - if (mContractedChild.getVisibility() != View.VISIBLE) { + if (mContractedChild != null && mContractedChild.getVisibility() != View.VISIBLE) { mContractedChild.setVisibility(View.VISIBLE); } if (mExpandedChild != null && mExpandedChild.getVisibility() != View.INVISIBLE) { @@ -116,7 +116,7 @@ public class NotificationContentView extends FrameLayout { if (mExpandedChild.getVisibility() != View.VISIBLE) { mExpandedChild.setVisibility(View.VISIBLE); } - if (mContractedChild.getVisibility() != View.INVISIBLE) { + if (mContractedChild != null && mContractedChild.getVisibility() != View.INVISIBLE) { mContractedChild.setVisibility(View.INVISIBLE); } } |