Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +18 −6 Original line number Original line Diff line number Diff line Loading @@ -34,6 +34,7 @@ import com.android.systemui.statusbar.stack.AnimationProperties; import com.android.systemui.statusbar.stack.ExpandableViewState; import com.android.systemui.statusbar.stack.ExpandableViewState; import com.android.systemui.statusbar.stack.NotificationStackScrollLayout; import com.android.systemui.statusbar.stack.NotificationStackScrollLayout; import com.android.systemui.statusbar.stack.StackScrollState; import com.android.systemui.statusbar.stack.StackScrollState; import com.android.systemui.statusbar.stack.ViewState; /** /** * A notification shelf view that is placed inside the notification scroller. It manages the * A notification shelf view that is placed inside the notification scroller. It manages the Loading Loading @@ -200,7 +201,11 @@ public class NotificationShelf extends ActivatableNotificationView { int colorTwoBefore = NO_COLOR; int colorTwoBefore = NO_COLOR; int previousColor = NO_COLOR; int previousColor = NO_COLOR; float transitionAmount = 0.0f; float transitionAmount = 0.0f; boolean scrollingFast = mAmbientState.getCurrentScrollVelocity() > mScrollFastThreshold; boolean scrollingFast = mAmbientState.getCurrentScrollVelocity() > mScrollFastThreshold || (mAmbientState.isExpansionChanging() && Math.abs(mAmbientState.getExpandingVelocity()) > mScrollFastThreshold); boolean expandingAnimated = mAmbientState.isExpansionChanging() && !mAmbientState.isPanelTracking(); int baseZHeight = mAmbientState.getBaseZHeight(); int baseZHeight = mAmbientState.getBaseZHeight(); while (notificationIndex < mHostLayout.getChildCount()) { while (notificationIndex < mHostLayout.getChildCount()) { ExpandableView child = (ExpandableView) mHostLayout.getChildAt(notificationIndex); ExpandableView child = (ExpandableView) mHostLayout.getChildAt(notificationIndex); Loading Loading @@ -228,7 +233,7 @@ public class NotificationShelf extends ActivatableNotificationView { } } updateNotificationClipHeight(row, notificationClipEnd); updateNotificationClipHeight(row, notificationClipEnd); float inShelfAmount = updateIconAppearance(row, expandAmount, scrollingFast, float inShelfAmount = updateIconAppearance(row, expandAmount, scrollingFast, isLastChild); expandingAnimated, isLastChild); numViewsInShelf += inShelfAmount; numViewsInShelf += inShelfAmount; int ownColorUntinted = row.getBackgroundColorWithoutTint(); int ownColorUntinted = row.getBackgroundColorWithoutTint(); if (rowTranslationY >= shelfStart && mNotGoneIndex == -1) { if (rowTranslationY >= shelfStart && mNotGoneIndex == -1) { Loading Loading @@ -278,7 +283,7 @@ public class NotificationShelf extends ActivatableNotificationView { * @return the icon amount how much this notification is in the shelf; * @return the icon amount how much this notification is in the shelf; */ */ private float updateIconAppearance(ExpandableNotificationRow row, float expandAmount, private float updateIconAppearance(ExpandableNotificationRow row, float expandAmount, boolean scrollingFast, boolean isLastChild) { boolean scrollingFast, boolean expandingAnimated, boolean isLastChild) { // Let calculate how much the view is in the shelf // Let calculate how much the view is in the shelf float viewStart = row.getTranslationY(); float viewStart = row.getTranslationY(); int fullHeight = row.getActualHeight() + mPaddingBetweenElements; int fullHeight = row.getActualHeight() + mPaddingBetweenElements; Loading Loading @@ -316,12 +321,13 @@ public class NotificationShelf extends ActivatableNotificationView { iconTransitionAmount = 0.0f; iconTransitionAmount = 0.0f; } } updateIconPositioning(row, iconTransitionAmount, fullTransitionAmount, scrollingFast, updateIconPositioning(row, iconTransitionAmount, fullTransitionAmount, scrollingFast, isLastChild); expandingAnimated, isLastChild); return fullTransitionAmount; return fullTransitionAmount; } } private void updateIconPositioning(ExpandableNotificationRow row, float iconTransitionAmount, private void updateIconPositioning(ExpandableNotificationRow row, float iconTransitionAmount, float fullTransitionAmount, boolean scrollingFast, boolean isLastChild) { float fullTransitionAmount, boolean scrollingFast, boolean expandingAnimated, boolean isLastChild) { StatusBarIconView icon = row.getEntry().expandedIcon; StatusBarIconView icon = row.getEntry().expandedIcon; NotificationIconContainer.IconState iconState = getIconState(icon); NotificationIconContainer.IconState iconState = getIconState(icon); if (iconState == null) { if (iconState == null) { Loading @@ -332,10 +338,16 @@ public class NotificationShelf extends ActivatableNotificationView { iconState.keepClampedPosition = false; iconState.keepClampedPosition = false; } } if (clampedAmount == fullTransitionAmount) { if (clampedAmount == fullTransitionAmount) { iconState.useFullTransitionAmount = fullTransitionAmount == 0.0f || scrollingFast; iconState.useFullTransitionAmount = fullTransitionAmount == 0.0f || scrollingFast || expandingAnimated; iconState.translateContent = mMaxLayoutHeight - getTranslationY() iconState.translateContent = mMaxLayoutHeight - getTranslationY() - getIntrinsicHeight() > 0; - getIntrinsicHeight() > 0; } } if (scrollingFast || (expandingAnimated && iconState.useFullTransitionAmount && !ViewState.isAnimatingY(icon))) { iconState.cancelAnimations(icon); iconState.useFullTransitionAmount = true; } float transitionAmount; float transitionAmount; boolean needCannedAnimation = iconState.clampedAppearAmount == 1.0f boolean needCannedAnimation = iconState.clampedAppearAmount == 1.0f && clampedAmount == 0.0f; && clampedAmount == 0.0f; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +17 −14 Original line number Original line Diff line number Diff line Loading @@ -105,7 +105,7 @@ public class NotificationPanelView extends PanelView implements private boolean mAnimateNextTopPaddingChange; private boolean mAnimateNextTopPaddingChange; private int mTrackingPointer; private int mTrackingPointer; private VelocityTracker mVelocityTracker; private VelocityTracker mQsVelocityTracker; private boolean mQsTracking; private boolean mQsTracking; /** /** Loading Loading @@ -688,7 +688,7 @@ public class NotificationPanelView extends PanelView implements } } private void flingQsWithCurrentVelocity(float y, boolean isCancelMotionEvent) { private void flingQsWithCurrentVelocity(float y, boolean isCancelMotionEvent) { float vel = getCurrentVelocity(); float vel = getCurrentQSVelocity(); final boolean expandsQs = flingExpandsQs(vel); final boolean expandsQs = flingExpandsQs(vel); if (expandsQs) { if (expandsQs) { logQsSwipeDown(y); logQsSwipeDown(y); Loading @@ -697,7 +697,7 @@ public class NotificationPanelView extends PanelView implements } } private void logQsSwipeDown(float y) { private void logQsSwipeDown(float y) { float vel = getCurrentVelocity(); float vel = getCurrentQSVelocity(); final int gesture = mStatusBarState == StatusBarState.KEYGUARD final int gesture = mStatusBarState == StatusBarState.KEYGUARD ? EventLogConstants.SYSUI_LOCKSCREEN_GESTURE_SWIPE_DOWN_QS ? EventLogConstants.SYSUI_LOCKSCREEN_GESTURE_SWIPE_DOWN_QS : EventLogConstants.SYSUI_SHADE_GESTURE_SWIPE_DOWN_QS; : EventLogConstants.SYSUI_SHADE_GESTURE_SWIPE_DOWN_QS; Loading Loading @@ -926,9 +926,9 @@ public class NotificationPanelView extends PanelView implements flingQsWithCurrentVelocity(y, flingQsWithCurrentVelocity(y, event.getActionMasked() == MotionEvent.ACTION_CANCEL); event.getActionMasked() == MotionEvent.ACTION_CANCEL); } } if (mVelocityTracker != null) { if (mQsVelocityTracker != null) { mVelocityTracker.recycle(); mQsVelocityTracker.recycle(); mVelocityTracker = null; mQsVelocityTracker = null; } } break; break; } } Loading Loading @@ -1290,24 +1290,24 @@ public class NotificationPanelView extends PanelView implements } } private void trackMovement(MotionEvent event) { private void trackMovement(MotionEvent event) { if (mVelocityTracker != null) mVelocityTracker.addMovement(event); if (mQsVelocityTracker != null) mQsVelocityTracker.addMovement(event); mLastTouchX = event.getX(); mLastTouchX = event.getX(); mLastTouchY = event.getY(); mLastTouchY = event.getY(); } } private void initVelocityTracker() { private void initVelocityTracker() { if (mVelocityTracker != null) { if (mQsVelocityTracker != null) { mVelocityTracker.recycle(); mQsVelocityTracker.recycle(); } } mVelocityTracker = VelocityTracker.obtain(); mQsVelocityTracker = VelocityTracker.obtain(); } } private float getCurrentVelocity() { private float getCurrentQSVelocity() { if (mVelocityTracker == null) { if (mQsVelocityTracker == null) { return 0; return 0; } } mVelocityTracker.computeCurrentVelocity(1000); mQsVelocityTracker.computeCurrentVelocity(1000); return mVelocityTracker.getYVelocity(); return mQsVelocityTracker.getYVelocity(); } } private void cancelQsAnimation() { private void cancelQsAnimation() { Loading Loading @@ -2282,6 +2282,9 @@ public class NotificationPanelView extends PanelView implements } } protected void updateExpandedHeight(float expandedHeight) { protected void updateExpandedHeight(float expandedHeight) { if (mTracking) { mNotificationStackScroller.setExpandingVelocity(getCurrentExpandVelocity()); } mNotificationStackScroller.setExpandedHeight(expandedHeight); mNotificationStackScroller.setExpandedHeight(expandedHeight); updateKeyguardBottomAreaAlpha(); updateKeyguardBottomAreaAlpha(); setOpening(expandedHeight <= getOpeningHeight()); setOpening(expandedHeight <= getOpeningHeight()); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +9 −2 Original line number Original line Diff line number Diff line Loading @@ -306,6 +306,7 @@ public abstract class PanelView extends FrameLayout { } } break; break; case MotionEvent.ACTION_MOVE: case MotionEvent.ACTION_MOVE: trackMovement(event); float h = y - mInitialTouchY; float h = y - mInitialTouchY; // If the panel was collapsed when touching, we only need to check for the // If the panel was collapsed when touching, we only need to check for the Loading Loading @@ -346,8 +347,6 @@ public abstract class PanelView extends FrameLayout { !isTrackingBlocked()) { !isTrackingBlocked()) { setExpandedHeightInternal(newHeight); setExpandedHeightInternal(newHeight); } } trackMovement(event); break; break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_UP: Loading Loading @@ -449,6 +448,14 @@ public abstract class PanelView extends FrameLayout { mPeekTouching = false; mPeekTouching = false; } } protected float getCurrentExpandVelocity() { if (mVelocityTracker == null) { return 0; } mVelocityTracker.computeCurrentVelocity(1000); return mVelocityTracker.getYVelocity(); } private int getFalsingThreshold() { private int getFalsingThreshold() { float factor = mStatusBar.isWakeUpComingFromTouch() ? 1.5f : 1.0f; float factor = mStatusBar.isWakeUpComingFromTouch() ? 1.5f : 1.0f; return (int) (mUnlockFalsingThreshold * factor); return (int) (mUnlockFalsingThreshold * factor); Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java +27 −0 Original line number Original line Diff line number Diff line Loading @@ -55,6 +55,9 @@ public class AmbientState { private ActivatableNotificationView mLastVisibleBackgroundChild; private ActivatableNotificationView mLastVisibleBackgroundChild; private float mCurrentScrollVelocity; private float mCurrentScrollVelocity; private int mStatusBarState; private int mStatusBarState; private float mExpandingVelocity; private boolean mPanelTracking; private boolean mExpansionChanging; public AmbientState(Context context) { public AmbientState(Context context) { reload(context); reload(context); Loading Loading @@ -260,4 +263,28 @@ public class AmbientState { public void setStatusBarState(int statusBarState) { public void setStatusBarState(int statusBarState) { mStatusBarState = statusBarState; mStatusBarState = statusBarState; } } public void setExpandingVelocity(float expandingVelocity) { mExpandingVelocity = expandingVelocity; } public void setExpansionChanging(boolean expansionChanging) { mExpansionChanging = expansionChanging; } public boolean isExpansionChanging() { return mExpansionChanging; } public float getExpandingVelocity() { return mExpandingVelocity; } public void setPanelTracking(boolean panelTracking) { mPanelTracking = panelTracking; } public boolean isPanelTracking() { return mPanelTracking; } } } packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +8 −0 Original line number Original line Diff line number Diff line Loading @@ -3124,10 +3124,12 @@ public class NotificationStackScrollLayout extends ViewGroup public void onExpansionStarted() { public void onExpansionStarted() { mIsExpansionChanging = true; mIsExpansionChanging = true; mAmbientState.setExpansionChanging(true); } } public void onExpansionStopped() { public void onExpansionStopped() { mIsExpansionChanging = false; mIsExpansionChanging = false; mAmbientState.setExpansionChanging(false); if (!mIsExpanded) { if (!mIsExpanded) { setOwnScrollY(0); setOwnScrollY(0); mPhoneStatusBar.resetUserExpandedStates(); mPhoneStatusBar.resetUserExpandedStates(); Loading Loading @@ -3155,9 +3157,11 @@ public class NotificationStackScrollLayout extends ViewGroup public void onPanelTrackingStarted() { public void onPanelTrackingStarted() { mPanelTracking = true; mPanelTracking = true; mAmbientState.setPanelTracking(true); } } public void onPanelTrackingStopped() { public void onPanelTrackingStopped() { mPanelTracking = false; mPanelTracking = false; mAmbientState.setPanelTracking(false); } } public void resetScrollPosition() { public void resetScrollPosition() { Loading Loading @@ -3987,6 +3991,10 @@ public class NotificationStackScrollLayout extends ViewGroup mAmbientState.setStatusBarState(statusBarState); mAmbientState.setStatusBarState(statusBarState); } } public void setExpandingVelocity(float expandingVelocity) { mAmbientState.setExpandingVelocity(expandingVelocity); } /** /** * A listener that is notified when some child locations might have changed. * A listener that is notified when some child locations might have changed. */ */ Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +18 −6 Original line number Original line Diff line number Diff line Loading @@ -34,6 +34,7 @@ import com.android.systemui.statusbar.stack.AnimationProperties; import com.android.systemui.statusbar.stack.ExpandableViewState; import com.android.systemui.statusbar.stack.ExpandableViewState; import com.android.systemui.statusbar.stack.NotificationStackScrollLayout; import com.android.systemui.statusbar.stack.NotificationStackScrollLayout; import com.android.systemui.statusbar.stack.StackScrollState; import com.android.systemui.statusbar.stack.StackScrollState; import com.android.systemui.statusbar.stack.ViewState; /** /** * A notification shelf view that is placed inside the notification scroller. It manages the * A notification shelf view that is placed inside the notification scroller. It manages the Loading Loading @@ -200,7 +201,11 @@ public class NotificationShelf extends ActivatableNotificationView { int colorTwoBefore = NO_COLOR; int colorTwoBefore = NO_COLOR; int previousColor = NO_COLOR; int previousColor = NO_COLOR; float transitionAmount = 0.0f; float transitionAmount = 0.0f; boolean scrollingFast = mAmbientState.getCurrentScrollVelocity() > mScrollFastThreshold; boolean scrollingFast = mAmbientState.getCurrentScrollVelocity() > mScrollFastThreshold || (mAmbientState.isExpansionChanging() && Math.abs(mAmbientState.getExpandingVelocity()) > mScrollFastThreshold); boolean expandingAnimated = mAmbientState.isExpansionChanging() && !mAmbientState.isPanelTracking(); int baseZHeight = mAmbientState.getBaseZHeight(); int baseZHeight = mAmbientState.getBaseZHeight(); while (notificationIndex < mHostLayout.getChildCount()) { while (notificationIndex < mHostLayout.getChildCount()) { ExpandableView child = (ExpandableView) mHostLayout.getChildAt(notificationIndex); ExpandableView child = (ExpandableView) mHostLayout.getChildAt(notificationIndex); Loading Loading @@ -228,7 +233,7 @@ public class NotificationShelf extends ActivatableNotificationView { } } updateNotificationClipHeight(row, notificationClipEnd); updateNotificationClipHeight(row, notificationClipEnd); float inShelfAmount = updateIconAppearance(row, expandAmount, scrollingFast, float inShelfAmount = updateIconAppearance(row, expandAmount, scrollingFast, isLastChild); expandingAnimated, isLastChild); numViewsInShelf += inShelfAmount; numViewsInShelf += inShelfAmount; int ownColorUntinted = row.getBackgroundColorWithoutTint(); int ownColorUntinted = row.getBackgroundColorWithoutTint(); if (rowTranslationY >= shelfStart && mNotGoneIndex == -1) { if (rowTranslationY >= shelfStart && mNotGoneIndex == -1) { Loading Loading @@ -278,7 +283,7 @@ public class NotificationShelf extends ActivatableNotificationView { * @return the icon amount how much this notification is in the shelf; * @return the icon amount how much this notification is in the shelf; */ */ private float updateIconAppearance(ExpandableNotificationRow row, float expandAmount, private float updateIconAppearance(ExpandableNotificationRow row, float expandAmount, boolean scrollingFast, boolean isLastChild) { boolean scrollingFast, boolean expandingAnimated, boolean isLastChild) { // Let calculate how much the view is in the shelf // Let calculate how much the view is in the shelf float viewStart = row.getTranslationY(); float viewStart = row.getTranslationY(); int fullHeight = row.getActualHeight() + mPaddingBetweenElements; int fullHeight = row.getActualHeight() + mPaddingBetweenElements; Loading Loading @@ -316,12 +321,13 @@ public class NotificationShelf extends ActivatableNotificationView { iconTransitionAmount = 0.0f; iconTransitionAmount = 0.0f; } } updateIconPositioning(row, iconTransitionAmount, fullTransitionAmount, scrollingFast, updateIconPositioning(row, iconTransitionAmount, fullTransitionAmount, scrollingFast, isLastChild); expandingAnimated, isLastChild); return fullTransitionAmount; return fullTransitionAmount; } } private void updateIconPositioning(ExpandableNotificationRow row, float iconTransitionAmount, private void updateIconPositioning(ExpandableNotificationRow row, float iconTransitionAmount, float fullTransitionAmount, boolean scrollingFast, boolean isLastChild) { float fullTransitionAmount, boolean scrollingFast, boolean expandingAnimated, boolean isLastChild) { StatusBarIconView icon = row.getEntry().expandedIcon; StatusBarIconView icon = row.getEntry().expandedIcon; NotificationIconContainer.IconState iconState = getIconState(icon); NotificationIconContainer.IconState iconState = getIconState(icon); if (iconState == null) { if (iconState == null) { Loading @@ -332,10 +338,16 @@ public class NotificationShelf extends ActivatableNotificationView { iconState.keepClampedPosition = false; iconState.keepClampedPosition = false; } } if (clampedAmount == fullTransitionAmount) { if (clampedAmount == fullTransitionAmount) { iconState.useFullTransitionAmount = fullTransitionAmount == 0.0f || scrollingFast; iconState.useFullTransitionAmount = fullTransitionAmount == 0.0f || scrollingFast || expandingAnimated; iconState.translateContent = mMaxLayoutHeight - getTranslationY() iconState.translateContent = mMaxLayoutHeight - getTranslationY() - getIntrinsicHeight() > 0; - getIntrinsicHeight() > 0; } } if (scrollingFast || (expandingAnimated && iconState.useFullTransitionAmount && !ViewState.isAnimatingY(icon))) { iconState.cancelAnimations(icon); iconState.useFullTransitionAmount = true; } float transitionAmount; float transitionAmount; boolean needCannedAnimation = iconState.clampedAppearAmount == 1.0f boolean needCannedAnimation = iconState.clampedAppearAmount == 1.0f && clampedAmount == 0.0f; && clampedAmount == 0.0f; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +17 −14 Original line number Original line Diff line number Diff line Loading @@ -105,7 +105,7 @@ public class NotificationPanelView extends PanelView implements private boolean mAnimateNextTopPaddingChange; private boolean mAnimateNextTopPaddingChange; private int mTrackingPointer; private int mTrackingPointer; private VelocityTracker mVelocityTracker; private VelocityTracker mQsVelocityTracker; private boolean mQsTracking; private boolean mQsTracking; /** /** Loading Loading @@ -688,7 +688,7 @@ public class NotificationPanelView extends PanelView implements } } private void flingQsWithCurrentVelocity(float y, boolean isCancelMotionEvent) { private void flingQsWithCurrentVelocity(float y, boolean isCancelMotionEvent) { float vel = getCurrentVelocity(); float vel = getCurrentQSVelocity(); final boolean expandsQs = flingExpandsQs(vel); final boolean expandsQs = flingExpandsQs(vel); if (expandsQs) { if (expandsQs) { logQsSwipeDown(y); logQsSwipeDown(y); Loading @@ -697,7 +697,7 @@ public class NotificationPanelView extends PanelView implements } } private void logQsSwipeDown(float y) { private void logQsSwipeDown(float y) { float vel = getCurrentVelocity(); float vel = getCurrentQSVelocity(); final int gesture = mStatusBarState == StatusBarState.KEYGUARD final int gesture = mStatusBarState == StatusBarState.KEYGUARD ? EventLogConstants.SYSUI_LOCKSCREEN_GESTURE_SWIPE_DOWN_QS ? EventLogConstants.SYSUI_LOCKSCREEN_GESTURE_SWIPE_DOWN_QS : EventLogConstants.SYSUI_SHADE_GESTURE_SWIPE_DOWN_QS; : EventLogConstants.SYSUI_SHADE_GESTURE_SWIPE_DOWN_QS; Loading Loading @@ -926,9 +926,9 @@ public class NotificationPanelView extends PanelView implements flingQsWithCurrentVelocity(y, flingQsWithCurrentVelocity(y, event.getActionMasked() == MotionEvent.ACTION_CANCEL); event.getActionMasked() == MotionEvent.ACTION_CANCEL); } } if (mVelocityTracker != null) { if (mQsVelocityTracker != null) { mVelocityTracker.recycle(); mQsVelocityTracker.recycle(); mVelocityTracker = null; mQsVelocityTracker = null; } } break; break; } } Loading Loading @@ -1290,24 +1290,24 @@ public class NotificationPanelView extends PanelView implements } } private void trackMovement(MotionEvent event) { private void trackMovement(MotionEvent event) { if (mVelocityTracker != null) mVelocityTracker.addMovement(event); if (mQsVelocityTracker != null) mQsVelocityTracker.addMovement(event); mLastTouchX = event.getX(); mLastTouchX = event.getX(); mLastTouchY = event.getY(); mLastTouchY = event.getY(); } } private void initVelocityTracker() { private void initVelocityTracker() { if (mVelocityTracker != null) { if (mQsVelocityTracker != null) { mVelocityTracker.recycle(); mQsVelocityTracker.recycle(); } } mVelocityTracker = VelocityTracker.obtain(); mQsVelocityTracker = VelocityTracker.obtain(); } } private float getCurrentVelocity() { private float getCurrentQSVelocity() { if (mVelocityTracker == null) { if (mQsVelocityTracker == null) { return 0; return 0; } } mVelocityTracker.computeCurrentVelocity(1000); mQsVelocityTracker.computeCurrentVelocity(1000); return mVelocityTracker.getYVelocity(); return mQsVelocityTracker.getYVelocity(); } } private void cancelQsAnimation() { private void cancelQsAnimation() { Loading Loading @@ -2282,6 +2282,9 @@ public class NotificationPanelView extends PanelView implements } } protected void updateExpandedHeight(float expandedHeight) { protected void updateExpandedHeight(float expandedHeight) { if (mTracking) { mNotificationStackScroller.setExpandingVelocity(getCurrentExpandVelocity()); } mNotificationStackScroller.setExpandedHeight(expandedHeight); mNotificationStackScroller.setExpandedHeight(expandedHeight); updateKeyguardBottomAreaAlpha(); updateKeyguardBottomAreaAlpha(); setOpening(expandedHeight <= getOpeningHeight()); setOpening(expandedHeight <= getOpeningHeight()); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +9 −2 Original line number Original line Diff line number Diff line Loading @@ -306,6 +306,7 @@ public abstract class PanelView extends FrameLayout { } } break; break; case MotionEvent.ACTION_MOVE: case MotionEvent.ACTION_MOVE: trackMovement(event); float h = y - mInitialTouchY; float h = y - mInitialTouchY; // If the panel was collapsed when touching, we only need to check for the // If the panel was collapsed when touching, we only need to check for the Loading Loading @@ -346,8 +347,6 @@ public abstract class PanelView extends FrameLayout { !isTrackingBlocked()) { !isTrackingBlocked()) { setExpandedHeightInternal(newHeight); setExpandedHeightInternal(newHeight); } } trackMovement(event); break; break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_UP: Loading Loading @@ -449,6 +448,14 @@ public abstract class PanelView extends FrameLayout { mPeekTouching = false; mPeekTouching = false; } } protected float getCurrentExpandVelocity() { if (mVelocityTracker == null) { return 0; } mVelocityTracker.computeCurrentVelocity(1000); return mVelocityTracker.getYVelocity(); } private int getFalsingThreshold() { private int getFalsingThreshold() { float factor = mStatusBar.isWakeUpComingFromTouch() ? 1.5f : 1.0f; float factor = mStatusBar.isWakeUpComingFromTouch() ? 1.5f : 1.0f; return (int) (mUnlockFalsingThreshold * factor); return (int) (mUnlockFalsingThreshold * factor); Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java +27 −0 Original line number Original line Diff line number Diff line Loading @@ -55,6 +55,9 @@ public class AmbientState { private ActivatableNotificationView mLastVisibleBackgroundChild; private ActivatableNotificationView mLastVisibleBackgroundChild; private float mCurrentScrollVelocity; private float mCurrentScrollVelocity; private int mStatusBarState; private int mStatusBarState; private float mExpandingVelocity; private boolean mPanelTracking; private boolean mExpansionChanging; public AmbientState(Context context) { public AmbientState(Context context) { reload(context); reload(context); Loading Loading @@ -260,4 +263,28 @@ public class AmbientState { public void setStatusBarState(int statusBarState) { public void setStatusBarState(int statusBarState) { mStatusBarState = statusBarState; mStatusBarState = statusBarState; } } public void setExpandingVelocity(float expandingVelocity) { mExpandingVelocity = expandingVelocity; } public void setExpansionChanging(boolean expansionChanging) { mExpansionChanging = expansionChanging; } public boolean isExpansionChanging() { return mExpansionChanging; } public float getExpandingVelocity() { return mExpandingVelocity; } public void setPanelTracking(boolean panelTracking) { mPanelTracking = panelTracking; } public boolean isPanelTracking() { return mPanelTracking; } } }
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +8 −0 Original line number Original line Diff line number Diff line Loading @@ -3124,10 +3124,12 @@ public class NotificationStackScrollLayout extends ViewGroup public void onExpansionStarted() { public void onExpansionStarted() { mIsExpansionChanging = true; mIsExpansionChanging = true; mAmbientState.setExpansionChanging(true); } } public void onExpansionStopped() { public void onExpansionStopped() { mIsExpansionChanging = false; mIsExpansionChanging = false; mAmbientState.setExpansionChanging(false); if (!mIsExpanded) { if (!mIsExpanded) { setOwnScrollY(0); setOwnScrollY(0); mPhoneStatusBar.resetUserExpandedStates(); mPhoneStatusBar.resetUserExpandedStates(); Loading Loading @@ -3155,9 +3157,11 @@ public class NotificationStackScrollLayout extends ViewGroup public void onPanelTrackingStarted() { public void onPanelTrackingStarted() { mPanelTracking = true; mPanelTracking = true; mAmbientState.setPanelTracking(true); } } public void onPanelTrackingStopped() { public void onPanelTrackingStopped() { mPanelTracking = false; mPanelTracking = false; mAmbientState.setPanelTracking(false); } } public void resetScrollPosition() { public void resetScrollPosition() { Loading Loading @@ -3987,6 +3991,10 @@ public class NotificationStackScrollLayout extends ViewGroup mAmbientState.setStatusBarState(statusBarState); mAmbientState.setStatusBarState(statusBarState); } } public void setExpandingVelocity(float expandingVelocity) { mAmbientState.setExpandingVelocity(expandingVelocity); } /** /** * A listener that is notified when some child locations might have changed. * A listener that is notified when some child locations might have changed. */ */ Loading