Loading packages/SystemUI/src/com/android/systemui/ExpandHelper.java +2 −1 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ public class ExpandHelper implements Gefingerpoken { void setUserExpandedChild(View v, boolean userExpanded); void setUserLockedChild(View v, boolean userLocked); void expansionStateChanged(boolean isExpanding); int getMaxExpandHeight(ExpandableView view); } private static final String TAG = "ExpandHelper"; Loading Loading @@ -144,7 +145,7 @@ public class ExpandHelper implements Gefingerpoken { return mView.getActualHeight(); } public int getNaturalHeight() { return mView.getMaxContentHeight(); return mCallback.getMaxExpandHeight(mView); } } Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +12 −1 Original line number Diff line number Diff line Loading @@ -156,6 +156,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { } } }; private boolean mForceUnlocked; private boolean mDismissed; private boolean mKeepInParent; private boolean mRemoved; Loading Loading @@ -645,6 +646,16 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { onChildrenCountChanged(); } public void setForceUnlocked(boolean forceUnlocked) { mForceUnlocked = forceUnlocked; if (mIsSummaryWithChildren) { List<ExpandableNotificationRow> notificationChildren = getNotificationChildren(); for (ExpandableNotificationRow child : notificationChildren) { child.setForceUnlocked(forceUnlocked); } } } public void setDismissed(boolean dismissed) { mDismissed = dismissed; } Loading Loading @@ -1017,7 +1028,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { } public boolean isUserLocked() { return mUserLocked; return mUserLocked && !mForceUnlocked; } public void setUserLocked(boolean userLocked) { Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +54 −12 Original line number Diff line number Diff line Loading @@ -330,6 +330,7 @@ public class NotificationStackScrollLayout extends ViewGroup private boolean mPulsing; private boolean mDrawBackgroundAsSrc; private boolean mFadedOut; private boolean mGroupExpandedForMeasure; public NotificationStackScrollLayout(Context context) { this(context, null); Loading Loading @@ -929,6 +930,30 @@ public class NotificationStackScrollLayout extends ViewGroup } } @Override public int getMaxExpandHeight(ExpandableView view) { int maxContentHeight = view.getMaxContentHeight(); if (view.isSummaryWithChildren()) { // Faking a measure with the group expanded to simulate how the group would look if // it was. Doing a calculation here would be highly non-trivial because of the // algorithm mGroupExpandedForMeasure = true; ExpandableNotificationRow row = (ExpandableNotificationRow) view; mGroupManager.toggleGroupExpansion(row.getStatusBarNotification()); row.setForceUnlocked(true); mAmbientState.setLayoutHeight(mMaxLayoutHeight); mStackScrollAlgorithm.getStackScrollState(mAmbientState, mCurrentStackScrollState); mAmbientState.setLayoutHeight(getLayoutHeight()); mGroupManager.toggleGroupExpansion( row.getStatusBarNotification()); mGroupExpandedForMeasure = false; row.setForceUnlocked(false); int height = mCurrentStackScrollState.getViewStateForView(view).height; return Math.min(height, maxContentHeight); } return maxContentHeight; } public void setScrollingEnabled(boolean enable) { mScrollingEnabled = enable; } Loading Loading @@ -1547,6 +1572,24 @@ public class NotificationStackScrollLayout extends ViewGroup return null; } /** * @return the child before the given view which has visibility unequal to GONE */ public ExpandableView getViewBeforeView(ExpandableView view) { ExpandableView previousView = null; int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { View child = getChildAt(i); if (child == view) { return previousView; } if (child.getVisibility() != View.GONE) { previousView = (ExpandableView) child; } } return null; } /** * @return The first child which has visibility unequal to GONE which is currently below the * given translationY or equal to it. Loading Loading @@ -1591,14 +1634,6 @@ public class NotificationStackScrollLayout extends ViewGroup return count; } private int getMaxExpandHeight(View view) { if (view instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) view; return row.getIntrinsicHeight(); } return view.getHeight(); } public int getContentHeight() { return mContentHeight; } Loading Loading @@ -2867,8 +2902,7 @@ public class NotificationStackScrollLayout extends ViewGroup if (row.isChildInGroup()) { endPosition += row.getNotificationParent().getTranslationY(); } int stackEnd = mMaxLayoutHeight - mBottomStackPeekSize - mBottomStackSlowDownHeight + (int) mStackTranslation; int stackEnd = getStackEndPosition(); if (endPosition > stackEnd) { mOwnScrollY += endPosition - stackEnd; mDisallowScrollingInThisMotion = true; Loading @@ -2877,6 +2911,11 @@ public class NotificationStackScrollLayout extends ViewGroup } } private int getStackEndPosition() { return mMaxLayoutHeight - mBottomStackPeekSize - mBottomStackSlowDownHeight + mPaddingBetweenElements + (int) mStackTranslation; } public void setOnHeightChangedListener( ExpandableView.OnHeightChangedListener mOnHeightChangedListener) { this.mOnHeightChangedListener = mOnHeightChangedListener; Loading Loading @@ -3357,14 +3396,17 @@ public class NotificationStackScrollLayout extends ViewGroup @Override public void onGroupExpansionChanged(ExpandableNotificationRow changedRow, boolean expanded) { boolean animated = mAnimationsEnabled && (mIsExpanded || changedRow.isPinned()); boolean animated = !mGroupExpandedForMeasure && mAnimationsEnabled && (mIsExpanded || changedRow.isPinned()); if (animated) { mExpandedGroupView = changedRow; mNeedsAnimation = true; } changedRow.setChildrenExpanded(expanded, animated); if (!mGroupExpandedForMeasure) { onHeightChanged(changedRow, false /* needsAnimation */); } } @Override public void onGroupCreatedFromChildren(NotificationGroupManager.NotificationGroup group) { Loading Loading
packages/SystemUI/src/com/android/systemui/ExpandHelper.java +2 −1 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ public class ExpandHelper implements Gefingerpoken { void setUserExpandedChild(View v, boolean userExpanded); void setUserLockedChild(View v, boolean userLocked); void expansionStateChanged(boolean isExpanding); int getMaxExpandHeight(ExpandableView view); } private static final String TAG = "ExpandHelper"; Loading Loading @@ -144,7 +145,7 @@ public class ExpandHelper implements Gefingerpoken { return mView.getActualHeight(); } public int getNaturalHeight() { return mView.getMaxContentHeight(); return mCallback.getMaxExpandHeight(mView); } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +12 −1 Original line number Diff line number Diff line Loading @@ -156,6 +156,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { } } }; private boolean mForceUnlocked; private boolean mDismissed; private boolean mKeepInParent; private boolean mRemoved; Loading Loading @@ -645,6 +646,16 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { onChildrenCountChanged(); } public void setForceUnlocked(boolean forceUnlocked) { mForceUnlocked = forceUnlocked; if (mIsSummaryWithChildren) { List<ExpandableNotificationRow> notificationChildren = getNotificationChildren(); for (ExpandableNotificationRow child : notificationChildren) { child.setForceUnlocked(forceUnlocked); } } } public void setDismissed(boolean dismissed) { mDismissed = dismissed; } Loading Loading @@ -1017,7 +1028,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { } public boolean isUserLocked() { return mUserLocked; return mUserLocked && !mForceUnlocked; } public void setUserLocked(boolean userLocked) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +54 −12 Original line number Diff line number Diff line Loading @@ -330,6 +330,7 @@ public class NotificationStackScrollLayout extends ViewGroup private boolean mPulsing; private boolean mDrawBackgroundAsSrc; private boolean mFadedOut; private boolean mGroupExpandedForMeasure; public NotificationStackScrollLayout(Context context) { this(context, null); Loading Loading @@ -929,6 +930,30 @@ public class NotificationStackScrollLayout extends ViewGroup } } @Override public int getMaxExpandHeight(ExpandableView view) { int maxContentHeight = view.getMaxContentHeight(); if (view.isSummaryWithChildren()) { // Faking a measure with the group expanded to simulate how the group would look if // it was. Doing a calculation here would be highly non-trivial because of the // algorithm mGroupExpandedForMeasure = true; ExpandableNotificationRow row = (ExpandableNotificationRow) view; mGroupManager.toggleGroupExpansion(row.getStatusBarNotification()); row.setForceUnlocked(true); mAmbientState.setLayoutHeight(mMaxLayoutHeight); mStackScrollAlgorithm.getStackScrollState(mAmbientState, mCurrentStackScrollState); mAmbientState.setLayoutHeight(getLayoutHeight()); mGroupManager.toggleGroupExpansion( row.getStatusBarNotification()); mGroupExpandedForMeasure = false; row.setForceUnlocked(false); int height = mCurrentStackScrollState.getViewStateForView(view).height; return Math.min(height, maxContentHeight); } return maxContentHeight; } public void setScrollingEnabled(boolean enable) { mScrollingEnabled = enable; } Loading Loading @@ -1547,6 +1572,24 @@ public class NotificationStackScrollLayout extends ViewGroup return null; } /** * @return the child before the given view which has visibility unequal to GONE */ public ExpandableView getViewBeforeView(ExpandableView view) { ExpandableView previousView = null; int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { View child = getChildAt(i); if (child == view) { return previousView; } if (child.getVisibility() != View.GONE) { previousView = (ExpandableView) child; } } return null; } /** * @return The first child which has visibility unequal to GONE which is currently below the * given translationY or equal to it. Loading Loading @@ -1591,14 +1634,6 @@ public class NotificationStackScrollLayout extends ViewGroup return count; } private int getMaxExpandHeight(View view) { if (view instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) view; return row.getIntrinsicHeight(); } return view.getHeight(); } public int getContentHeight() { return mContentHeight; } Loading Loading @@ -2867,8 +2902,7 @@ public class NotificationStackScrollLayout extends ViewGroup if (row.isChildInGroup()) { endPosition += row.getNotificationParent().getTranslationY(); } int stackEnd = mMaxLayoutHeight - mBottomStackPeekSize - mBottomStackSlowDownHeight + (int) mStackTranslation; int stackEnd = getStackEndPosition(); if (endPosition > stackEnd) { mOwnScrollY += endPosition - stackEnd; mDisallowScrollingInThisMotion = true; Loading @@ -2877,6 +2911,11 @@ public class NotificationStackScrollLayout extends ViewGroup } } private int getStackEndPosition() { return mMaxLayoutHeight - mBottomStackPeekSize - mBottomStackSlowDownHeight + mPaddingBetweenElements + (int) mStackTranslation; } public void setOnHeightChangedListener( ExpandableView.OnHeightChangedListener mOnHeightChangedListener) { this.mOnHeightChangedListener = mOnHeightChangedListener; Loading Loading @@ -3357,14 +3396,17 @@ public class NotificationStackScrollLayout extends ViewGroup @Override public void onGroupExpansionChanged(ExpandableNotificationRow changedRow, boolean expanded) { boolean animated = mAnimationsEnabled && (mIsExpanded || changedRow.isPinned()); boolean animated = !mGroupExpandedForMeasure && mAnimationsEnabled && (mIsExpanded || changedRow.isPinned()); if (animated) { mExpandedGroupView = changedRow; mNeedsAnimation = true; } changedRow.setChildrenExpanded(expanded, animated); if (!mGroupExpandedForMeasure) { onHeightChanged(changedRow, false /* needsAnimation */); } } @Override public void onGroupCreatedFromChildren(NotificationGroupManager.NotificationGroup group) { Loading