Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +2 −24 Original line number Diff line number Diff line Loading @@ -105,7 +105,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { private boolean mClearable; private ExpansionLogger mLogger; private String mLoggingKey; private boolean mWasReset; private NotificationSettingsIconRow mSettingsIconRow; private NotificationGuts mGuts; private NotificationData.Entry mEntry; Loading Loading @@ -615,20 +614,16 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { mShowingPublicInitialized = false; mIsSystemExpanded = false; mOnKeyguard = false; mPublicLayout.reset(mIsHeadsUp); mPrivateLayout.reset(mIsHeadsUp); mPublicLayout.reset(); mPrivateLayout.reset(); resetHeight(); resetTranslation(); logExpansionEvent(false, wasExpanded); } public void resetHeight() { if (mIsHeadsUp) { resetActualHeight(); } mMaxExpandHeight = 0; mHeadsUpHeight = 0; mWasReset = true; onHeightReset(); requestLayout(); } Loading Loading @@ -964,18 +959,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { return mStatusBarNotification != null && mStatusBarNotification.isClearable(); } /** * Apply an expansion state to the layout. */ public void applyExpansionToLayout() { boolean expand = isExpanded(); if (expand && mExpandable) { setActualHeight(mMaxExpandHeight); } else { setActualHeight(getMinHeight()); } } @Override public int getIntrinsicHeight() { if (isUserLocked()) { Loading Loading @@ -1057,12 +1040,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); boolean updateExpandHeight = mMaxExpandHeight == 0 && !mWasReset; updateMaxHeights(); if (updateExpandHeight) { applyExpansionToLayout(); } mWasReset = false; } private void updateMaxHeights() { Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java +0 −21 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ public abstract class ExpandableView extends FrameLayout { protected OnHeightChangedListener mOnHeightChangedListener; private int mActualHeight; protected int mClipTopAmount; private boolean mActualHeightInitialized; private boolean mDark; private ArrayList<View> mMatchParentViews = new ArrayList<View>(); private int mClipTopOptimization; Loading Loading @@ -99,28 +98,9 @@ public abstract class ExpandableView extends FrameLayout { @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); if (!mActualHeightInitialized && mActualHeight == 0) { int initialHeight = getInitialHeight(); if (initialHeight != 0) { setActualHeight(initialHeight); } } updateClipping(); } /** * Resets the height of the view on the next layout pass */ protected void resetActualHeight() { mActualHeight = 0; mActualHeightInitialized = false; requestLayout(); } protected int getInitialHeight() { return getHeight(); } @Override public boolean pointInView(float localX, float localY, float slop) { float top = mClipTopAmount; Loading @@ -137,7 +117,6 @@ public abstract class ExpandableView extends FrameLayout { * @param notifyListeners Whether the listener should be informed about the change. */ public void setActualHeight(int actualHeight, boolean notifyListeners) { mActualHeightInitialized = true; mActualHeight = actualHeight; updateClipping(); if (notifyListeners) { Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +19 −9 Original line number Diff line number Diff line Loading @@ -120,7 +120,7 @@ public class NotificationContentView extends FrameLayout { R.dimen.min_notification_layout_height); mNotificationContentMarginEnd = getResources().getDimensionPixelSize( com.android.internal.R.dimen.notification_content_margin_end); reset(true); reset(); } public void setHeights(int smallHeight, int headsUpMaxHeight, int maxHeight) { Loading Loading @@ -255,7 +255,7 @@ public class NotificationContentView extends FrameLayout { updateVisibility(); } public void reset(boolean resetActualHeight) { public void reset() { if (mContractedChild != null) { mContractedChild.animate().cancel(); removeView(mContractedChild); Loading @@ -271,10 +271,6 @@ public class NotificationContentView extends FrameLayout { mContractedChild = null; mExpandedChild = null; mHeadsUpChild = null; mVisibleType = VISIBLE_TYPE_CONTRACTED; if (resetActualHeight) { mContentHeight = mSmallHeight; } } public View getContractedChild() { Loading Loading @@ -484,13 +480,19 @@ public class NotificationContentView extends FrameLayout { private void animateToVisibleType(int visibleType) { final TransformableView shownView = getTransformableViewForVisibleType(visibleType); final TransformableView hiddenView = getTransformableViewForVisibleType(mVisibleType); if (shownView == hiddenView) { shownView.setVisible(true); return; } shownView.transformFrom(hiddenView); getViewForVisibleType(visibleType).setVisibility(View.VISIBLE); hiddenView.transformTo(shownView, new Runnable() { @Override public void run() { if (hiddenView != getTransformableViewForVisibleType(mVisibleType)) { hiddenView.setVisible(false); } } }); } Loading Loading @@ -550,6 +552,9 @@ public class NotificationContentView extends FrameLayout { || mContainingNotification.isExpanded() ? mContainingNotification.getMaxContentHeight() : mContainingNotification.getShowingLayout().getMinHeight(); if (height == 0) { height = mContentHeight; } int expandedVisualType = getVisualTypeForHeight(height); int collapsedVisualType = getVisualTypeForHeight( mContainingNotification.getMinExpandHeight()); Loading @@ -557,7 +562,12 @@ public class NotificationContentView extends FrameLayout { ? expandedVisualType : collapsedVisualType; } int viewHeight = Math.min(mContentHeight, mContainingNotification.getIntrinsicHeight()); int intrinsicHeight = mContainingNotification.getIntrinsicHeight(); int viewHeight = mContentHeight; if (intrinsicHeight != 0) { // the intrinsicHeight might be 0 because it was just reset. viewHeight = Math.min(mContentHeight, intrinsicHeight); } return getVisualTypeForHeight(viewHeight); } Loading Loading @@ -638,7 +648,6 @@ public class NotificationContentView extends FrameLayout { mBeforeN = entry.targetSdk < Build.VERSION_CODES.N; updateSingleLineView(); applyRemoteInput(entry); selectLayout(false /* animate */, true /* force */); if (mContractedChild != null) { mContractedWrapper.notifyContentUpdated(entry.notification); } Loading @@ -648,6 +657,7 @@ public class NotificationContentView extends FrameLayout { if (mHeadsUpChild != null) { mHeadsUpWrapper.notifyContentUpdated(entry.notification); } selectLayout(false /* animate */, true /* force */); setDark(mDark, false /* animate */, 0 /* delay */); } Loading packages/SystemUI/src/com/android/systemui/statusbar/ViewTransformationHelper.java +16 −16 Original line number Diff line number Diff line Loading @@ -76,14 +76,15 @@ public class ViewTransformationHelper implements TransformableView { }); mViewTransformationAnimation.setInterpolator(Interpolators.LINEAR); mViewTransformationAnimation.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD); if (endRunnable != null) { mViewTransformationAnimation.addListener(new AnimatorListenerAdapter() { public boolean mCancelled; @Override public void onAnimationEnd(Animator animation) { endRunnable.run(); if (!mCancelled) { if (endRunnable != null) { endRunnable.run(); } setVisible(false); } else { abortTransformations(); Loading @@ -95,7 +96,6 @@ public class ViewTransformationHelper implements TransformableView { mCancelled = true; } }); } mViewTransformationAnimation.start(); } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +2 −24 Original line number Diff line number Diff line Loading @@ -105,7 +105,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { private boolean mClearable; private ExpansionLogger mLogger; private String mLoggingKey; private boolean mWasReset; private NotificationSettingsIconRow mSettingsIconRow; private NotificationGuts mGuts; private NotificationData.Entry mEntry; Loading Loading @@ -615,20 +614,16 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { mShowingPublicInitialized = false; mIsSystemExpanded = false; mOnKeyguard = false; mPublicLayout.reset(mIsHeadsUp); mPrivateLayout.reset(mIsHeadsUp); mPublicLayout.reset(); mPrivateLayout.reset(); resetHeight(); resetTranslation(); logExpansionEvent(false, wasExpanded); } public void resetHeight() { if (mIsHeadsUp) { resetActualHeight(); } mMaxExpandHeight = 0; mHeadsUpHeight = 0; mWasReset = true; onHeightReset(); requestLayout(); } Loading Loading @@ -964,18 +959,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { return mStatusBarNotification != null && mStatusBarNotification.isClearable(); } /** * Apply an expansion state to the layout. */ public void applyExpansionToLayout() { boolean expand = isExpanded(); if (expand && mExpandable) { setActualHeight(mMaxExpandHeight); } else { setActualHeight(getMinHeight()); } } @Override public int getIntrinsicHeight() { if (isUserLocked()) { Loading Loading @@ -1057,12 +1040,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); boolean updateExpandHeight = mMaxExpandHeight == 0 && !mWasReset; updateMaxHeights(); if (updateExpandHeight) { applyExpansionToLayout(); } mWasReset = false; } private void updateMaxHeights() { Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java +0 −21 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ public abstract class ExpandableView extends FrameLayout { protected OnHeightChangedListener mOnHeightChangedListener; private int mActualHeight; protected int mClipTopAmount; private boolean mActualHeightInitialized; private boolean mDark; private ArrayList<View> mMatchParentViews = new ArrayList<View>(); private int mClipTopOptimization; Loading Loading @@ -99,28 +98,9 @@ public abstract class ExpandableView extends FrameLayout { @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); if (!mActualHeightInitialized && mActualHeight == 0) { int initialHeight = getInitialHeight(); if (initialHeight != 0) { setActualHeight(initialHeight); } } updateClipping(); } /** * Resets the height of the view on the next layout pass */ protected void resetActualHeight() { mActualHeight = 0; mActualHeightInitialized = false; requestLayout(); } protected int getInitialHeight() { return getHeight(); } @Override public boolean pointInView(float localX, float localY, float slop) { float top = mClipTopAmount; Loading @@ -137,7 +117,6 @@ public abstract class ExpandableView extends FrameLayout { * @param notifyListeners Whether the listener should be informed about the change. */ public void setActualHeight(int actualHeight, boolean notifyListeners) { mActualHeightInitialized = true; mActualHeight = actualHeight; updateClipping(); if (notifyListeners) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +19 −9 Original line number Diff line number Diff line Loading @@ -120,7 +120,7 @@ public class NotificationContentView extends FrameLayout { R.dimen.min_notification_layout_height); mNotificationContentMarginEnd = getResources().getDimensionPixelSize( com.android.internal.R.dimen.notification_content_margin_end); reset(true); reset(); } public void setHeights(int smallHeight, int headsUpMaxHeight, int maxHeight) { Loading Loading @@ -255,7 +255,7 @@ public class NotificationContentView extends FrameLayout { updateVisibility(); } public void reset(boolean resetActualHeight) { public void reset() { if (mContractedChild != null) { mContractedChild.animate().cancel(); removeView(mContractedChild); Loading @@ -271,10 +271,6 @@ public class NotificationContentView extends FrameLayout { mContractedChild = null; mExpandedChild = null; mHeadsUpChild = null; mVisibleType = VISIBLE_TYPE_CONTRACTED; if (resetActualHeight) { mContentHeight = mSmallHeight; } } public View getContractedChild() { Loading Loading @@ -484,13 +480,19 @@ public class NotificationContentView extends FrameLayout { private void animateToVisibleType(int visibleType) { final TransformableView shownView = getTransformableViewForVisibleType(visibleType); final TransformableView hiddenView = getTransformableViewForVisibleType(mVisibleType); if (shownView == hiddenView) { shownView.setVisible(true); return; } shownView.transformFrom(hiddenView); getViewForVisibleType(visibleType).setVisibility(View.VISIBLE); hiddenView.transformTo(shownView, new Runnable() { @Override public void run() { if (hiddenView != getTransformableViewForVisibleType(mVisibleType)) { hiddenView.setVisible(false); } } }); } Loading Loading @@ -550,6 +552,9 @@ public class NotificationContentView extends FrameLayout { || mContainingNotification.isExpanded() ? mContainingNotification.getMaxContentHeight() : mContainingNotification.getShowingLayout().getMinHeight(); if (height == 0) { height = mContentHeight; } int expandedVisualType = getVisualTypeForHeight(height); int collapsedVisualType = getVisualTypeForHeight( mContainingNotification.getMinExpandHeight()); Loading @@ -557,7 +562,12 @@ public class NotificationContentView extends FrameLayout { ? expandedVisualType : collapsedVisualType; } int viewHeight = Math.min(mContentHeight, mContainingNotification.getIntrinsicHeight()); int intrinsicHeight = mContainingNotification.getIntrinsicHeight(); int viewHeight = mContentHeight; if (intrinsicHeight != 0) { // the intrinsicHeight might be 0 because it was just reset. viewHeight = Math.min(mContentHeight, intrinsicHeight); } return getVisualTypeForHeight(viewHeight); } Loading Loading @@ -638,7 +648,6 @@ public class NotificationContentView extends FrameLayout { mBeforeN = entry.targetSdk < Build.VERSION_CODES.N; updateSingleLineView(); applyRemoteInput(entry); selectLayout(false /* animate */, true /* force */); if (mContractedChild != null) { mContractedWrapper.notifyContentUpdated(entry.notification); } Loading @@ -648,6 +657,7 @@ public class NotificationContentView extends FrameLayout { if (mHeadsUpChild != null) { mHeadsUpWrapper.notifyContentUpdated(entry.notification); } selectLayout(false /* animate */, true /* force */); setDark(mDark, false /* animate */, 0 /* delay */); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/ViewTransformationHelper.java +16 −16 Original line number Diff line number Diff line Loading @@ -76,14 +76,15 @@ public class ViewTransformationHelper implements TransformableView { }); mViewTransformationAnimation.setInterpolator(Interpolators.LINEAR); mViewTransformationAnimation.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD); if (endRunnable != null) { mViewTransformationAnimation.addListener(new AnimatorListenerAdapter() { public boolean mCancelled; @Override public void onAnimationEnd(Animator animation) { endRunnable.run(); if (!mCancelled) { if (endRunnable != null) { endRunnable.run(); } setVisible(false); } else { abortTransformations(); Loading @@ -95,7 +96,6 @@ public class ViewTransformationHelper implements TransformableView { mCancelled = true; } }); } mViewTransformationAnimation.start(); } Loading