Animate public/private notification layouts
This change move the boolean whether we hide sensitive contents into
AmbientState, which makes it consistent with the other stack states
and allows for a orchestrated transition between public/private
layouts. We need this transition when going into the full shade.
Bug: 16291973
Change-Id: I379a6119b5b73eca900a4a2ba9d5ec95b293e487
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java
index fe2733b..ba3f339 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java
@@ -159,7 +159,7 @@
updateZValuesForState(resultState, algorithmState);
handleDraggedViews(ambientState, resultState, algorithmState);
- updateDimmedActivated(ambientState, resultState, algorithmState);
+ updateDimmedActivatedHideSensitive(ambientState, resultState, algorithmState);
updateClipping(resultState, algorithmState);
updateScrimAmount(resultState, algorithmState, ambientState.getScrimAmount());
updateSpeedBumpState(resultState, algorithmState, ambientState.getSpeedBumpIndex());
@@ -251,12 +251,13 @@
}
/**
- * Updates the dimmed and activated states of the children.
+ * Updates the dimmed, activated and hiding sensitive states of the children.
*/
- private void updateDimmedActivated(AmbientState ambientState, StackScrollState resultState,
- StackScrollAlgorithmState algorithmState) {
+ private void updateDimmedActivatedHideSensitive(AmbientState ambientState,
+ StackScrollState resultState, StackScrollAlgorithmState algorithmState) {
boolean dimmed = ambientState.isDimmed();
boolean dark = ambientState.isDark();
+ boolean hideSensitive = ambientState.isHideSensitive();
View activatedChild = ambientState.getActivatedChild();
int childCount = algorithmState.visibleChildren.size();
for (int i = 0; i < childCount; i++) {
@@ -264,6 +265,7 @@
StackScrollState.ViewState childViewState = resultState.getViewStateForView(child);
childViewState.dimmed = dimmed;
childViewState.dark = dark;
+ childViewState.hideSensitive = hideSensitive;
boolean isActivatedChild = activatedChild == child;
childViewState.scale = !dimmed || isActivatedChild
? 1.0f