Merge "Fixed the remove animations for notification children" into nyc-dev
am: 37a4027131
* commit '37a4027131f80709c27a81be0b426b60d33dd6c7':
Fixed the remove animations for notification children
Change-Id: I31ac58e09ac980df5008e87b46c0d268d93fabe5
This commit is contained in:
@@ -329,7 +329,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
|
|||||||
if (mChildrenContainer != null) {
|
if (mChildrenContainer != null) {
|
||||||
mChildrenContainer.removeNotification(row);
|
mChildrenContainer.removeNotification(row);
|
||||||
}
|
}
|
||||||
mHeaderUtil.restoreNotificationHeader(row);
|
if (!row.isRemoved()) {
|
||||||
|
mHeaderUtil.restoreNotificationHeader(row);
|
||||||
|
}
|
||||||
onChildrenCountChanged();
|
onChildrenCountChanged();
|
||||||
row.setIsChildInGroup(false, null);
|
row.setIsChildInGroup(false, null);
|
||||||
}
|
}
|
||||||
@@ -644,7 +646,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
mChildrenContainer.removeNotification(row);
|
mChildrenContainer.removeNotification(row);
|
||||||
mHeaderUtil.restoreNotificationHeader(row);
|
if (!row.isRemoved()) {
|
||||||
|
mHeaderUtil.restoreNotificationHeader(row);
|
||||||
|
}
|
||||||
row.setIsChildInGroup(false, null);
|
row.setIsChildInGroup(false, null);
|
||||||
}
|
}
|
||||||
onChildrenCountChanged();
|
onChildrenCountChanged();
|
||||||
@@ -1338,6 +1342,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected View getContentView() {
|
protected View getContentView() {
|
||||||
|
if (mIsSummaryWithChildren) {
|
||||||
|
return mChildrenContainer;
|
||||||
|
}
|
||||||
return getShowingLayout();
|
return getShowingLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1505,6 +1505,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
mHeadsUpEntriesToRemoveOnSwitch.add(mHeadsUpManager.getEntry(key));
|
mHeadsUpEntriesToRemoveOnSwitch.add(mHeadsUpManager.getEntry(key));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Entry entry = mNotificationData.get(key);
|
||||||
|
if (entry != null && entry.row != null) {
|
||||||
|
entry.row.setRemoved(true);
|
||||||
|
}
|
||||||
// Let's remove the children if this was a summary
|
// Let's remove the children if this was a summary
|
||||||
handleGroupSummaryRemoved(key, ranking);
|
handleGroupSummaryRemoved(key, ranking);
|
||||||
StatusBarNotification old = removeNotificationViews(key, ranking);
|
StatusBarNotification old = removeNotificationViews(key, ranking);
|
||||||
@@ -1544,12 +1548,13 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
// always cancelled. We only remove them if they were dismissed by the user.
|
// always cancelled. We only remove them if they were dismissed by the user.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
entry.row.setRemoved(true);
|
|
||||||
List<ExpandableNotificationRow> notificationChildren =
|
List<ExpandableNotificationRow> notificationChildren =
|
||||||
entry.row.getNotificationChildren();
|
entry.row.getNotificationChildren();
|
||||||
ArrayList<ExpandableNotificationRow> toRemove = new ArrayList<>(notificationChildren);
|
ArrayList<ExpandableNotificationRow> toRemove = new ArrayList<>(notificationChildren);
|
||||||
for (int i = 0; i < toRemove.size(); i++) {
|
for (int i = 0; i < toRemove.size(); i++) {
|
||||||
toRemove.get(i).setKeepInParent(true);
|
toRemove.get(i).setKeepInParent(true);
|
||||||
|
// we need to set this state earlier as otherwise we might generate some weird
|
||||||
|
// animations
|
||||||
toRemove.get(i).setRemoved(true);
|
toRemove.get(i).setRemoved(true);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < toRemove.size(); i++) {
|
for (int i = 0; i < toRemove.size(); i++) {
|
||||||
|
|||||||
@@ -2188,7 +2188,7 @@ public class NotificationStackScrollLayout extends ViewGroup
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onViewRemovedInternal(View child, ViewGroup transientContainer) {
|
private void onViewRemovedInternal(View child, ViewGroup container) {
|
||||||
if (mChangePositionInProgress) {
|
if (mChangePositionInProgress) {
|
||||||
// This is only a position change, don't do anything special
|
// This is only a position change, don't do anything special
|
||||||
return;
|
return;
|
||||||
@@ -2200,10 +2200,10 @@ public class NotificationStackScrollLayout extends ViewGroup
|
|||||||
boolean animationGenerated = generateRemoveAnimation(child);
|
boolean animationGenerated = generateRemoveAnimation(child);
|
||||||
if (animationGenerated) {
|
if (animationGenerated) {
|
||||||
if (!mSwipedOutViews.contains(child)) {
|
if (!mSwipedOutViews.contains(child)) {
|
||||||
getOverlay().add(child);
|
container.getOverlay().add(child);
|
||||||
} else if (Math.abs(expandableView.getTranslation()) != expandableView.getWidth()) {
|
} else if (Math.abs(expandableView.getTranslation()) != expandableView.getWidth()) {
|
||||||
transientContainer.addTransientView(child, 0);
|
container.addTransientView(child, 0);
|
||||||
expandableView.setTransientContainer(transientContainer);
|
expandableView.setTransientContainer(container);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mSwipedOutViews.remove(child);
|
mSwipedOutViews.remove(child);
|
||||||
@@ -2885,22 +2885,24 @@ public class NotificationStackScrollLayout extends ViewGroup
|
|||||||
mPhoneStatusBar.resetUserExpandedStates();
|
mPhoneStatusBar.resetUserExpandedStates();
|
||||||
|
|
||||||
// lets make sure nothing is in the overlay / transient anymore
|
// lets make sure nothing is in the overlay / transient anymore
|
||||||
clearTransientViews(this);
|
clearTemporaryViews(this);
|
||||||
for (int i = 0; i < getChildCount(); i++) {
|
for (int i = 0; i < getChildCount(); i++) {
|
||||||
ExpandableView child = (ExpandableView) getChildAt(i);
|
ExpandableView child = (ExpandableView) getChildAt(i);
|
||||||
if (child instanceof ExpandableNotificationRow) {
|
if (child instanceof ExpandableNotificationRow) {
|
||||||
ExpandableNotificationRow row = (ExpandableNotificationRow) child;
|
ExpandableNotificationRow row = (ExpandableNotificationRow) child;
|
||||||
clearTransientViews(row.getChildrenContainer());
|
clearTemporaryViews(row.getChildrenContainer());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getOverlay().clear();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearTransientViews(ViewGroup viewGroup) {
|
private void clearTemporaryViews(ViewGroup viewGroup) {
|
||||||
while (viewGroup != null && viewGroup.getTransientViewCount() != 0) {
|
while (viewGroup != null && viewGroup.getTransientViewCount() != 0) {
|
||||||
viewGroup.removeTransientView(viewGroup.getTransientView(0));
|
viewGroup.removeTransientView(viewGroup.getTransientView(0));
|
||||||
}
|
}
|
||||||
|
if (viewGroup != null) {
|
||||||
|
viewGroup.getOverlay().clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onPanelTrackingStarted() {
|
public void onPanelTrackingStarted() {
|
||||||
@@ -3020,7 +3022,7 @@ public class NotificationStackScrollLayout extends ViewGroup
|
|||||||
|
|
||||||
private void clearViewOverlays() {
|
private void clearViewOverlays() {
|
||||||
for (View view : mClearOverlayViewsWhenFinished) {
|
for (View view : mClearOverlayViewsWhenFinished) {
|
||||||
getOverlay().remove(view);
|
StackStateAnimator.removeFromOverlay(view);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import android.animation.ObjectAnimator;
|
|||||||
import android.animation.PropertyValuesHolder;
|
import android.animation.PropertyValuesHolder;
|
||||||
import android.animation.ValueAnimator;
|
import android.animation.ValueAnimator;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
import android.view.animation.Interpolator;
|
import android.view.animation.Interpolator;
|
||||||
|
|
||||||
import com.android.systemui.Interpolators;
|
import com.android.systemui.Interpolators;
|
||||||
@@ -797,7 +798,7 @@ public class StackStateAnimator {
|
|||||||
private void onAnimationFinished() {
|
private void onAnimationFinished() {
|
||||||
mHostLayout.onChildAnimationFinished();
|
mHostLayout.onChildAnimationFinished();
|
||||||
for (View v : mChildrenToClearFromOverlay) {
|
for (View v : mChildrenToClearFromOverlay) {
|
||||||
mHostLayout.getOverlay().remove(v);
|
removeFromOverlay(v);
|
||||||
}
|
}
|
||||||
mChildrenToClearFromOverlay.clear();
|
mChildrenToClearFromOverlay.clear();
|
||||||
}
|
}
|
||||||
@@ -829,7 +830,7 @@ public class StackStateAnimator {
|
|||||||
} else if (event.animationType ==
|
} else if (event.animationType ==
|
||||||
NotificationStackScrollLayout.AnimationEvent.ANIMATION_TYPE_REMOVE) {
|
NotificationStackScrollLayout.AnimationEvent.ANIMATION_TYPE_REMOVE) {
|
||||||
if (changingView.getVisibility() == View.GONE) {
|
if (changingView.getVisibility() == View.GONE) {
|
||||||
mHostLayout.getOverlay().remove(changingView);
|
removeFromOverlay(changingView);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -854,7 +855,7 @@ public class StackStateAnimator {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
// remove the temporary overlay
|
// remove the temporary overlay
|
||||||
mHostLayout.getOverlay().remove(changingView);
|
removeFromOverlay(changingView);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (event.animationType ==
|
} else if (event.animationType ==
|
||||||
@@ -909,6 +910,13 @@ public class StackStateAnimator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void removeFromOverlay(View changingView) {
|
||||||
|
ViewGroup parent = (ViewGroup) changingView.getParent();
|
||||||
|
if (parent != null) {
|
||||||
|
parent.removeView(changingView);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void animateOverScrollToAmount(float targetAmount, final boolean onTop,
|
public void animateOverScrollToAmount(float targetAmount, final boolean onTop,
|
||||||
final boolean isRubberbanded) {
|
final boolean isRubberbanded) {
|
||||||
final float startOverScrollAmount = mHostLayout.getCurrentOverScrollAmount(onTop);
|
final float startOverScrollAmount = mHostLayout.getCurrentOverScrollAmount(onTop);
|
||||||
|
|||||||
Reference in New Issue
Block a user