Loading packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +3 −1 Original line number Diff line number Diff line Loading @@ -1281,7 +1281,9 @@ public abstract class BaseStatusBar extends SystemUI implements // Add a basic notification template publicViewLocal = LayoutInflater.from(mContext).inflate( com.android.internal.R.layout.notification_template_material_base, expandedPublic, true); expandedPublic, false); publicViewLocal.setIsRootNamespace(true); expandedPublic.setContractedChild(publicViewLocal); final TextView title = (TextView) publicViewLocal.findViewById(com.android.internal.R.id.title); try { Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +50 −0 Original line number Diff line number Diff line Loading @@ -17,10 +17,15 @@ package com.android.systemui.statusbar; import android.content.Context; import android.graphics.drawable.AnimatedVectorDrawable; import android.graphics.drawable.AnimationDrawable; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.view.accessibility.AccessibilityEvent; import android.widget.ImageView; import com.android.systemui.R; public class ExpandableNotificationRow extends ActivatableNotificationView { Loading Loading @@ -62,6 +67,51 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { private boolean mWasReset; private NotificationGuts mGuts; public void setIconAnimationRunning(boolean running) { setIconAnimationRunning(running, mPublicLayout); setIconAnimationRunning(running, mPrivateLayout); } private void setIconAnimationRunning(boolean running, NotificationContentView layout) { if (layout != null) { View contractedChild = layout.getContractedChild(); View expandedChild = layout.getExpandedChild(); setIconAnimationRunningForChild(running, contractedChild); setIconAnimationRunningForChild(running, expandedChild); } } private void setIconAnimationRunningForChild(boolean running, View child) { if (child != null) { ImageView icon = (ImageView) child.findViewById(com.android.internal.R.id.icon); setIconRunning(icon, running); ImageView rightIcon = (ImageView) child.findViewById( com.android.internal.R.id.right_icon); setIconRunning(rightIcon, running); } } private void setIconRunning(ImageView imageView, boolean running) { if (imageView != null) { Drawable drawable = imageView.getDrawable(); if (drawable instanceof AnimationDrawable) { AnimationDrawable animationDrawable = (AnimationDrawable) drawable; if (running) { animationDrawable.start(); } else { animationDrawable.stop(); } } else if (drawable instanceof AnimatedVectorDrawable) { AnimatedVectorDrawable animationDrawable = (AnimatedVectorDrawable) drawable; if (running) { animationDrawable.start(); } else { animationDrawable.stop(); } } } } public interface ExpansionLogger { public void logNotificationExpansion(String key, boolean userAction, boolean expanded); } Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +8 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,14 @@ public class NotificationContentView extends FrameLayout { mContractedVisible = true; } public View getContractedChild() { return mContractedChild; } public View getExpandedChild() { return mExpandedChild; } public void setContractedChild(View child) { if (mContractedChild != null) { mContractedChild.animate().cancel(); Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +23 −0 Original line number Diff line number Diff line Loading @@ -1467,6 +1467,7 @@ public class NotificationStackScrollLayout extends ViewGroup // drawn when removed getOverlay().add(child); } updateAnimationState(false, child); // Make sure the clipRect we might have set is removed child.setClipBounds(null); Loading Loading @@ -1545,10 +1546,28 @@ public class NotificationStackScrollLayout extends ViewGroup mStackScrollAlgorithm.notifyChildrenChanged(this); ((ExpandableView) child).setOnHeightChangedListener(this); generateAddAnimation(child, false /* fromMoreCard */); updateAnimationState(mAnimationsEnabled && mIsExpanded, child); } public void setAnimationsEnabled(boolean animationsEnabled) { mAnimationsEnabled = animationsEnabled; updateNotificationAnimationStates(); } private void updateNotificationAnimationStates() { boolean running = mIsExpanded && mAnimationsEnabled; int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { View child = getChildAt(i); updateAnimationState(running, child); } } private void updateAnimationState(boolean running, View child) { if (child instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) child; row.setIconAnimationRunning(running); } } public boolean isAddOrRemoveAnimationPending() { Loading Loading @@ -1918,8 +1937,12 @@ public class NotificationStackScrollLayout extends ViewGroup } private void setIsExpanded(boolean isExpanded) { boolean changed = isExpanded != mIsExpanded; mIsExpanded = isExpanded; mStackScrollAlgorithm.setIsExpanded(isExpanded); if (changed) { updateNotificationAnimationStates(); } } @Override Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +3 −1 Original line number Diff line number Diff line Loading @@ -1281,7 +1281,9 @@ public abstract class BaseStatusBar extends SystemUI implements // Add a basic notification template publicViewLocal = LayoutInflater.from(mContext).inflate( com.android.internal.R.layout.notification_template_material_base, expandedPublic, true); expandedPublic, false); publicViewLocal.setIsRootNamespace(true); expandedPublic.setContractedChild(publicViewLocal); final TextView title = (TextView) publicViewLocal.findViewById(com.android.internal.R.id.title); try { Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +50 −0 Original line number Diff line number Diff line Loading @@ -17,10 +17,15 @@ package com.android.systemui.statusbar; import android.content.Context; import android.graphics.drawable.AnimatedVectorDrawable; import android.graphics.drawable.AnimationDrawable; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.view.accessibility.AccessibilityEvent; import android.widget.ImageView; import com.android.systemui.R; public class ExpandableNotificationRow extends ActivatableNotificationView { Loading Loading @@ -62,6 +67,51 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { private boolean mWasReset; private NotificationGuts mGuts; public void setIconAnimationRunning(boolean running) { setIconAnimationRunning(running, mPublicLayout); setIconAnimationRunning(running, mPrivateLayout); } private void setIconAnimationRunning(boolean running, NotificationContentView layout) { if (layout != null) { View contractedChild = layout.getContractedChild(); View expandedChild = layout.getExpandedChild(); setIconAnimationRunningForChild(running, contractedChild); setIconAnimationRunningForChild(running, expandedChild); } } private void setIconAnimationRunningForChild(boolean running, View child) { if (child != null) { ImageView icon = (ImageView) child.findViewById(com.android.internal.R.id.icon); setIconRunning(icon, running); ImageView rightIcon = (ImageView) child.findViewById( com.android.internal.R.id.right_icon); setIconRunning(rightIcon, running); } } private void setIconRunning(ImageView imageView, boolean running) { if (imageView != null) { Drawable drawable = imageView.getDrawable(); if (drawable instanceof AnimationDrawable) { AnimationDrawable animationDrawable = (AnimationDrawable) drawable; if (running) { animationDrawable.start(); } else { animationDrawable.stop(); } } else if (drawable instanceof AnimatedVectorDrawable) { AnimatedVectorDrawable animationDrawable = (AnimatedVectorDrawable) drawable; if (running) { animationDrawable.start(); } else { animationDrawable.stop(); } } } } public interface ExpansionLogger { public void logNotificationExpansion(String key, boolean userAction, boolean expanded); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +8 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,14 @@ public class NotificationContentView extends FrameLayout { mContractedVisible = true; } public View getContractedChild() { return mContractedChild; } public View getExpandedChild() { return mExpandedChild; } public void setContractedChild(View child) { if (mContractedChild != null) { mContractedChild.animate().cancel(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +23 −0 Original line number Diff line number Diff line Loading @@ -1467,6 +1467,7 @@ public class NotificationStackScrollLayout extends ViewGroup // drawn when removed getOverlay().add(child); } updateAnimationState(false, child); // Make sure the clipRect we might have set is removed child.setClipBounds(null); Loading Loading @@ -1545,10 +1546,28 @@ public class NotificationStackScrollLayout extends ViewGroup mStackScrollAlgorithm.notifyChildrenChanged(this); ((ExpandableView) child).setOnHeightChangedListener(this); generateAddAnimation(child, false /* fromMoreCard */); updateAnimationState(mAnimationsEnabled && mIsExpanded, child); } public void setAnimationsEnabled(boolean animationsEnabled) { mAnimationsEnabled = animationsEnabled; updateNotificationAnimationStates(); } private void updateNotificationAnimationStates() { boolean running = mIsExpanded && mAnimationsEnabled; int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { View child = getChildAt(i); updateAnimationState(running, child); } } private void updateAnimationState(boolean running, View child) { if (child instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) child; row.setIconAnimationRunning(running); } } public boolean isAddOrRemoveAnimationPending() { Loading Loading @@ -1918,8 +1937,12 @@ public class NotificationStackScrollLayout extends ViewGroup } private void setIsExpanded(boolean isExpanded) { boolean changed = isExpanded != mIsExpanded; mIsExpanded = isExpanded; mStackScrollAlgorithm.setIsExpanded(isExpanded); if (changed) { updateNotificationAnimationStates(); } } @Override Loading