Loading packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +10 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,7 @@ import com.android.internal.statusbar.StatusBarIconList; import com.android.internal.util.NotificationColorUtil; import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.systemui.DejankUtils; import com.android.systemui.R; import com.android.systemui.RecentsComponent; import com.android.systemui.SwipeHelper; Loading Loading @@ -1506,6 +1507,15 @@ public abstract class BaseStatusBar extends SystemUI implements final PendingIntent intent = sbn.getNotification().contentIntent; final String notificationKey = sbn.getKey(); // Mark notification for one frame. row.setJustClicked(true); DejankUtils.postAfterTraversal(new Runnable() { @Override public void run() { row.setJustClicked(false); } }); if (NOTIFICATION_CLICK_DEBUG) { Log.d(TAG, "Clicked on content of " + notificationKey); } Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +17 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { } }; private boolean mJustClicked; public NotificationContentView getPrivateLayout() { return mPrivateLayout; } Loading Loading @@ -301,6 +303,21 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { return mHeadsUpHeight; } /** * Mark whether this notification was just clicked, i.e. the user has just clicked this * notification in this frame. */ public void setJustClicked(boolean justClicked) { mJustClicked = justClicked; } /** * @return true if this notification has been clicked in this frame, false otherwise */ public boolean wasJustClicked() { return mJustClicked; } public interface ExpansionLogger { public void logNotificationExpansion(String key, boolean userAction, boolean expanded); } Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/AnimationFilter.java +6 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ public class AnimationFilter { boolean hasDelays; boolean hasGoToFullShadeEvent; boolean hasDarkEvent; boolean hasHeadsUpDisappearClickEvent; int darkAnimationOriginIndex; public AnimationFilter animateAlpha() { Loading Loading @@ -106,6 +107,10 @@ public class AnimationFilter { hasDarkEvent = true; darkAnimationOriginIndex = ev.darkAnimationOriginIndex; } if (ev.animationType == NotificationStackScrollLayout.AnimationEvent .ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK) { hasHeadsUpDisappearClickEvent = true; } } } Loading Loading @@ -135,6 +140,7 @@ public class AnimationFilter { hasDelays = false; hasGoToFullShadeEvent = false; hasDarkEvent = false; hasHeadsUpDisappearClickEvent = false; darkAnimationOriginIndex = NotificationStackScrollLayout.AnimationEvent.DARK_ANIMATION_ORIGIN_INDEX_ABOVE; } Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +18 −3 Original line number Diff line number Diff line Loading @@ -1915,7 +1915,9 @@ public class NotificationStackScrollLayout extends ViewGroup boolean onBottom = false; boolean pinnedAndClosed = row.isPinned() && !mIsExpanded; if (!mIsExpanded && !isHeadsUp) { type = AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR; type = row.wasJustClicked() ? AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK : AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR; } else { StackViewState viewState = mCurrentStackScrollState.getViewStateForView(row); if (viewState == null) { Loading Loading @@ -3016,6 +3018,15 @@ public class NotificationStackScrollLayout extends ViewGroup .animateY() .animateZ(), // ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK new AnimationFilter() .animateAlpha() .animateHeight() .animateTopInset() .animateY() .animateZ() .hasDelays(), // ANIMATION_TYPE_HEADS_UP_OTHER new AnimationFilter() .animateAlpha() Loading Loading @@ -3087,6 +3098,9 @@ public class NotificationStackScrollLayout extends ViewGroup // ANIMATION_TYPE_HEADS_UP_DISAPPEAR StackStateAnimator.ANIMATION_DURATION_HEADS_UP_DISAPPEAR, // ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK StackStateAnimator.ANIMATION_DURATION_HEADS_UP_DISAPPEAR, // ANIMATION_TYPE_HEADS_UP_OTHER StackStateAnimator.ANIMATION_DURATION_STANDARD, Loading @@ -3110,8 +3124,9 @@ public class NotificationStackScrollLayout extends ViewGroup static final int ANIMATION_TYPE_GROUP_EXPANSION_CHANGED = 13; static final int ANIMATION_TYPE_HEADS_UP_APPEAR = 14; static final int ANIMATION_TYPE_HEADS_UP_DISAPPEAR = 15; static final int ANIMATION_TYPE_HEADS_UP_OTHER = 16; static final int ANIMATION_TYPE_EVERYTHING = 17; static final int ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK = 16; static final int ANIMATION_TYPE_HEADS_UP_OTHER = 17; static final int ANIMATION_TYPE_EVERYTHING = 18; static final int DARK_ANIMATION_ORIGIN_INDEX_ABOVE = -1; static final int DARK_ANIMATION_ORIGIN_INDEX_BELOW = -2; Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/StackStateAnimator.java +12 −2 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ public class StackStateAnimator { public static final int ANIMATION_DELAY_PER_ELEMENT_DARK = 24; public static final int DELAY_EFFECT_MAX_INDEX_DIFFERENCE = 2; public static final int DELAY_EFFECT_MAX_INDEX_DIFFERENCE_CHILDREN = 3; public static final int ANIMATION_DELAY_HEADS_UP = 120; private static final int TAG_ANIMATOR_TRANSLATION_Y = R.id.translation_y_animator_tag; private static final int TAG_ANIMATOR_TRANSLATION_Z = R.id.translation_z_animator_tag; Loading Loading @@ -320,6 +321,9 @@ public class StackStateAnimator { if (mAnimationFilter.hasGoToFullShadeEvent) { return calculateDelayGoToFullShade(viewState); } if (mAnimationFilter.hasHeadsUpDisappearClickEvent) { return ANIMATION_DELAY_HEADS_UP; } long minDelay = 0; for (NotificationStackScrollLayout.AnimationEvent event : mNewEvents) { long delayPerElement = ANIMATION_DELAY_PER_ELEMENT_INTERRUPTING; Loading Loading @@ -890,7 +894,9 @@ public class StackStateAnimator { mHeadsUpAppearChildren.add(changingView); finalState.applyState(changingView, mTmpState); } else if (event.animationType == NotificationStackScrollLayout .AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR) { .AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR || event.animationType == NotificationStackScrollLayout .AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK) { mHeadsUpDisappearChildren.add(changingView); if (mHostLayout.indexOfChild(changingView) == -1) { // This notification was actually removed, so we need to add it to the overlay Loading @@ -900,7 +906,11 @@ public class StackStateAnimator { // We temporarily enable Y animations, the real filter will be combined // afterwards anyway mAnimationFilter.animateY = true; startViewAnimations(changingView, mTmpState, 0, startViewAnimations(changingView, mTmpState, event.animationType == NotificationStackScrollLayout .AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK ? ANIMATION_DELAY_HEADS_UP : 0, ANIMATION_DURATION_HEADS_UP_DISAPPEAR); mChildrenToClearFromOverlay.add(changingView); } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +10 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,7 @@ import com.android.internal.statusbar.StatusBarIconList; import com.android.internal.util.NotificationColorUtil; import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.systemui.DejankUtils; import com.android.systemui.R; import com.android.systemui.RecentsComponent; import com.android.systemui.SwipeHelper; Loading Loading @@ -1506,6 +1507,15 @@ public abstract class BaseStatusBar extends SystemUI implements final PendingIntent intent = sbn.getNotification().contentIntent; final String notificationKey = sbn.getKey(); // Mark notification for one frame. row.setJustClicked(true); DejankUtils.postAfterTraversal(new Runnable() { @Override public void run() { row.setJustClicked(false); } }); if (NOTIFICATION_CLICK_DEBUG) { Log.d(TAG, "Clicked on content of " + notificationKey); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +17 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { } }; private boolean mJustClicked; public NotificationContentView getPrivateLayout() { return mPrivateLayout; } Loading Loading @@ -301,6 +303,21 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { return mHeadsUpHeight; } /** * Mark whether this notification was just clicked, i.e. the user has just clicked this * notification in this frame. */ public void setJustClicked(boolean justClicked) { mJustClicked = justClicked; } /** * @return true if this notification has been clicked in this frame, false otherwise */ public boolean wasJustClicked() { return mJustClicked; } public interface ExpansionLogger { public void logNotificationExpansion(String key, boolean userAction, boolean expanded); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/AnimationFilter.java +6 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ public class AnimationFilter { boolean hasDelays; boolean hasGoToFullShadeEvent; boolean hasDarkEvent; boolean hasHeadsUpDisappearClickEvent; int darkAnimationOriginIndex; public AnimationFilter animateAlpha() { Loading Loading @@ -106,6 +107,10 @@ public class AnimationFilter { hasDarkEvent = true; darkAnimationOriginIndex = ev.darkAnimationOriginIndex; } if (ev.animationType == NotificationStackScrollLayout.AnimationEvent .ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK) { hasHeadsUpDisappearClickEvent = true; } } } Loading Loading @@ -135,6 +140,7 @@ public class AnimationFilter { hasDelays = false; hasGoToFullShadeEvent = false; hasDarkEvent = false; hasHeadsUpDisappearClickEvent = false; darkAnimationOriginIndex = NotificationStackScrollLayout.AnimationEvent.DARK_ANIMATION_ORIGIN_INDEX_ABOVE; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +18 −3 Original line number Diff line number Diff line Loading @@ -1915,7 +1915,9 @@ public class NotificationStackScrollLayout extends ViewGroup boolean onBottom = false; boolean pinnedAndClosed = row.isPinned() && !mIsExpanded; if (!mIsExpanded && !isHeadsUp) { type = AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR; type = row.wasJustClicked() ? AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK : AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR; } else { StackViewState viewState = mCurrentStackScrollState.getViewStateForView(row); if (viewState == null) { Loading Loading @@ -3016,6 +3018,15 @@ public class NotificationStackScrollLayout extends ViewGroup .animateY() .animateZ(), // ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK new AnimationFilter() .animateAlpha() .animateHeight() .animateTopInset() .animateY() .animateZ() .hasDelays(), // ANIMATION_TYPE_HEADS_UP_OTHER new AnimationFilter() .animateAlpha() Loading Loading @@ -3087,6 +3098,9 @@ public class NotificationStackScrollLayout extends ViewGroup // ANIMATION_TYPE_HEADS_UP_DISAPPEAR StackStateAnimator.ANIMATION_DURATION_HEADS_UP_DISAPPEAR, // ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK StackStateAnimator.ANIMATION_DURATION_HEADS_UP_DISAPPEAR, // ANIMATION_TYPE_HEADS_UP_OTHER StackStateAnimator.ANIMATION_DURATION_STANDARD, Loading @@ -3110,8 +3124,9 @@ public class NotificationStackScrollLayout extends ViewGroup static final int ANIMATION_TYPE_GROUP_EXPANSION_CHANGED = 13; static final int ANIMATION_TYPE_HEADS_UP_APPEAR = 14; static final int ANIMATION_TYPE_HEADS_UP_DISAPPEAR = 15; static final int ANIMATION_TYPE_HEADS_UP_OTHER = 16; static final int ANIMATION_TYPE_EVERYTHING = 17; static final int ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK = 16; static final int ANIMATION_TYPE_HEADS_UP_OTHER = 17; static final int ANIMATION_TYPE_EVERYTHING = 18; static final int DARK_ANIMATION_ORIGIN_INDEX_ABOVE = -1; static final int DARK_ANIMATION_ORIGIN_INDEX_BELOW = -2; Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/StackStateAnimator.java +12 −2 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ public class StackStateAnimator { public static final int ANIMATION_DELAY_PER_ELEMENT_DARK = 24; public static final int DELAY_EFFECT_MAX_INDEX_DIFFERENCE = 2; public static final int DELAY_EFFECT_MAX_INDEX_DIFFERENCE_CHILDREN = 3; public static final int ANIMATION_DELAY_HEADS_UP = 120; private static final int TAG_ANIMATOR_TRANSLATION_Y = R.id.translation_y_animator_tag; private static final int TAG_ANIMATOR_TRANSLATION_Z = R.id.translation_z_animator_tag; Loading Loading @@ -320,6 +321,9 @@ public class StackStateAnimator { if (mAnimationFilter.hasGoToFullShadeEvent) { return calculateDelayGoToFullShade(viewState); } if (mAnimationFilter.hasHeadsUpDisappearClickEvent) { return ANIMATION_DELAY_HEADS_UP; } long minDelay = 0; for (NotificationStackScrollLayout.AnimationEvent event : mNewEvents) { long delayPerElement = ANIMATION_DELAY_PER_ELEMENT_INTERRUPTING; Loading Loading @@ -890,7 +894,9 @@ public class StackStateAnimator { mHeadsUpAppearChildren.add(changingView); finalState.applyState(changingView, mTmpState); } else if (event.animationType == NotificationStackScrollLayout .AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR) { .AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR || event.animationType == NotificationStackScrollLayout .AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK) { mHeadsUpDisappearChildren.add(changingView); if (mHostLayout.indexOfChild(changingView) == -1) { // This notification was actually removed, so we need to add it to the overlay Loading @@ -900,7 +906,11 @@ public class StackStateAnimator { // We temporarily enable Y animations, the real filter will be combined // afterwards anyway mAnimationFilter.animateY = true; startViewAnimations(changingView, mTmpState, 0, startViewAnimations(changingView, mTmpState, event.animationType == NotificationStackScrollLayout .AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK ? ANIMATION_DELAY_HEADS_UP : 0, ANIMATION_DURATION_HEADS_UP_DISAPPEAR); mChildrenToClearFromOverlay.add(changingView); } Loading