Merge "sysui: refactor in notification panel view" into nyc-dev

This commit is contained in:
Xiaohui Chen
2016-02-17 19:21:40 +00:00
committed by Android (Google) Code Review
2 changed files with 14 additions and 20 deletions

View File

@@ -107,7 +107,7 @@ public class HeadsUpTouchHelper implements Gefingerpoken {
mPanel.setPanelScrimMinFraction((float) expandedHeight mPanel.setPanelScrimMinFraction((float) expandedHeight
/ mPanel.getMaxPanelHeight()); / mPanel.getMaxPanelHeight());
mPanel.startExpandMotion(x, y, true /* startTracking */, expandedHeight); mPanel.startExpandMotion(x, y, true /* startTracking */, expandedHeight);
mPanel.clearNotificattonEffects(); mPanel.clearNotificationEffects();
return true; return true;
} }
break; break;

View File

@@ -89,13 +89,13 @@ public class NotificationPanelView extends PanelView implements
private KeyguardAffordanceHelper mAfforanceHelper; private KeyguardAffordanceHelper mAfforanceHelper;
private KeyguardUserSwitcher mKeyguardUserSwitcher; private KeyguardUserSwitcher mKeyguardUserSwitcher;
private KeyguardStatusBarView mKeyguardStatusBar; private KeyguardStatusBarView mKeyguardStatusBar;
private QSContainer mQsContainer; protected QSContainer mQsContainer;
private KeyguardStatusView mKeyguardStatusView; private KeyguardStatusView mKeyguardStatusView;
private TextView mClockView; private TextView mClockView;
private View mReserveNotificationSpace; private View mReserveNotificationSpace;
private View mQsNavbarScrim; private View mQsNavbarScrim;
private NotificationsQuickSettingsContainer mNotificationContainerParent; private NotificationsQuickSettingsContainer mNotificationContainerParent;
private NotificationStackScrollLayout mNotificationStackScroller; protected NotificationStackScrollLayout mNotificationStackScroller;
private boolean mAnimateNextTopPaddingChange; private boolean mAnimateNextTopPaddingChange;
private int mTrackingPointer; private int mTrackingPointer;
@@ -126,9 +126,9 @@ public class NotificationPanelView extends PanelView implements
private float mInitialTouchY; private float mInitialTouchY;
private float mLastTouchX; private float mLastTouchX;
private float mLastTouchY; private float mLastTouchY;
private float mQsExpansionHeight; protected float mQsExpansionHeight;
private int mQsMinExpansionHeight; protected int mQsMinExpansionHeight;
private int mQsMaxExpansionHeight; protected int mQsMaxExpansionHeight;
private int mQsPeekHeight; private int mQsPeekHeight;
private boolean mStackScrollerOverscrolling; private boolean mStackScrollerOverscrolling;
private boolean mQsExpansionFromOverscroll; private boolean mQsExpansionFromOverscroll;
@@ -1072,8 +1072,8 @@ public class NotificationPanelView extends PanelView implements
private void setKeyguardBottomAreaVisibility(int statusBarState, private void setKeyguardBottomAreaVisibility(int statusBarState,
boolean goingToFullShade) { boolean goingToFullShade) {
if (goingToFullShade) {
mKeyguardBottomArea.animate().cancel(); mKeyguardBottomArea.animate().cancel();
if (goingToFullShade) {
mKeyguardBottomArea.animate() mKeyguardBottomArea.animate()
.alpha(0f) .alpha(0f)
.setStartDelay(mStatusBar.getKeyguardFadingAwayDelay()) .setStartDelay(mStatusBar.getKeyguardFadingAwayDelay())
@@ -1083,13 +1083,11 @@ public class NotificationPanelView extends PanelView implements
.start(); .start();
} else if (statusBarState == StatusBarState.KEYGUARD } else if (statusBarState == StatusBarState.KEYGUARD
|| statusBarState == StatusBarState.SHADE_LOCKED) { || statusBarState == StatusBarState.SHADE_LOCKED) {
mKeyguardBottomArea.animate().cancel();
if (!mDozing) { if (!mDozing) {
mKeyguardBottomArea.setVisibility(View.VISIBLE); mKeyguardBottomArea.setVisibility(View.VISIBLE);
} }
mKeyguardBottomArea.setAlpha(1f); mKeyguardBottomArea.setAlpha(1f);
} else { } else {
mKeyguardBottomArea.animate().cancel();
mKeyguardBottomArea.setVisibility(View.GONE); mKeyguardBottomArea.setVisibility(View.GONE);
mKeyguardBottomArea.setAlpha(1f); mKeyguardBottomArea.setAlpha(1f);
} }
@@ -1196,7 +1194,7 @@ public class NotificationPanelView extends PanelView implements
} }
} }
private void updateQsExpansion() { protected void updateQsExpansion() {
mQsContainer.setQsExpansion(getQsExpansionFraction(), getHeaderTranslation()); mQsContainer.setQsExpansion(getQsExpansionFraction(), getHeaderTranslation());
} }
@@ -1238,7 +1236,7 @@ public class NotificationPanelView extends PanelView implements
} }
} }
private void requestScrollerTopPaddingUpdate(boolean animate) { protected void requestScrollerTopPaddingUpdate(boolean animate) {
mNotificationStackScroller.updateTopPadding(calculateQsTopPadding(), mNotificationStackScroller.updateTopPadding(calculateQsTopPadding(),
mAnimateNextTopPaddingChange || animate, mAnimateNextTopPaddingChange || animate,
mKeyguardShowing mKeyguardShowing
@@ -1520,16 +1518,12 @@ public class NotificationPanelView extends PanelView implements
updateQsExpansion(); updateQsExpansion();
} }
private float getHeaderTranslation() { protected float getHeaderTranslation() {
if (mStatusBar.getBarState() == StatusBarState.KEYGUARD) { if (mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
return 0; return 0;
} }
if (mNotificationStackScroller.getNotGoneChildCount() == 0) { if (mNotificationStackScroller.getNotGoneChildCount() == 0) {
if (mExpandedHeight / HEADER_RUBBERBAND_FACTOR >= mQsMinExpansionHeight) { return Math.min(0, mExpandedHeight / HEADER_RUBBERBAND_FACTOR - mQsMinExpansionHeight);
return 0;
} else {
return mExpandedHeight / HEADER_RUBBERBAND_FACTOR - mQsMinExpansionHeight;
}
} }
float stackTranslation = mNotificationStackScroller.getStackTranslation(); float stackTranslation = mNotificationStackScroller.getStackTranslation();
float translation = stackTranslation / HEADER_RUBBERBAND_FACTOR; float translation = stackTranslation / HEADER_RUBBERBAND_FACTOR;
@@ -2191,7 +2185,7 @@ public class NotificationPanelView extends PanelView implements
* *
* @param x the x-coordinate the touch event * @param x the x-coordinate the touch event
*/ */
private void updateVerticalPanelPosition(float x) { protected void updateVerticalPanelPosition(float x) {
if (mNotificationStackScroller.getWidth() * 1.75f > getWidth()) { if (mNotificationStackScroller.getWidth() * 1.75f > getWidth()) {
resetVerticalPanelPosition(); resetVerticalPanelPosition();
return; return;
@@ -2216,7 +2210,7 @@ public class NotificationPanelView extends PanelView implements
mQsContainer.setTranslationX(translation); mQsContainer.setTranslationX(translation);
} }
private void updateStackHeight(float stackHeight) { protected void updateStackHeight(float stackHeight) {
mNotificationStackScroller.setStackHeight(stackHeight); mNotificationStackScroller.setStackHeight(stackHeight);
updateKeyguardBottomAreaAlpha(); updateKeyguardBottomAreaAlpha();
} }
@@ -2225,7 +2219,7 @@ public class NotificationPanelView extends PanelView implements
mBar.panelScrimMinFractionChanged(minFraction); mBar.panelScrimMinFractionChanged(minFraction);
} }
public void clearNotificattonEffects() { public void clearNotificationEffects() {
mStatusBar.clearNotificationEffects(); mStatusBar.clearNotificationEffects();
} }