Loading packages/SystemUI/res/values/dimens.xml +2 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,8 @@ <dimen name="fling_collapse_min_velocity">200dp</dimen> <!-- Cap on contribution of x dimension of gesture to overall velocity --> <dimen name="fling_gesture_max_x_velocity">200dp</dimen> <!-- Cap on overall resulting fling speed (s^-1) --> <dimen name="fling_gesture_max_output_velocity">3000dp</dimen> <!-- Minimum fraction of the display a gesture must travel, at any velocity, to qualify as a collapse request --> Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +17 −6 Original line number Diff line number Diff line Loading @@ -134,6 +134,9 @@ public class PhoneStatusBar extends BaseStatusBar { private float mExpandAccelPx; // classic value: 2000px/s/s private float mCollapseAccelPx; // classic value: 2000px/s/s (will be negated to collapse "up") private float mFlingGestureMaxOutputVelocityPx; // how fast can it really go? (should be a little // faster than mSelfCollapseVelocityPx) PhoneStatusBarPolicy mIconPolicy; // These are no longer handled by the policy, because we need custom strategies for them Loading Loading @@ -392,12 +395,13 @@ public class PhoneStatusBar extends BaseStatusBar { mTickerView = mStatusBarView.findViewById(R.id.ticker); mPile = (NotificationRowLayout)mStatusBarWindow.findViewById(R.id.latestItems); mPile.setLayoutTransitionsEnabled(false); mPile.setLongPressListener(getNotificationLongClicker()); if (SHOW_CARRIER_LABEL) { mPile.setOnSizeChangedListener(new OnSizeChangedListener() { @Override public void onSizeChanged(View view, int w, int h, int oldw, int oldh) { updateCarrierLabelVisibility(); updateCarrierLabelVisibility(false); } }); } Loading Loading @@ -889,7 +893,7 @@ public class PhoneStatusBar extends BaseStatusBar { } } protected void updateCarrierLabelVisibility() { protected void updateCarrierLabelVisibility(boolean force) { if (!SHOW_CARRIER_LABEL) return; // The idea here is to only show the carrier label when there is enough room to see it, // i.e. when there aren't enough notifications to fill the panel. Loading @@ -901,7 +905,7 @@ public class PhoneStatusBar extends BaseStatusBar { final boolean makeVisible = mPile.getHeight() < (mScrollView.getHeight() - mCarrierLabelHeight); if (mCarrierLabelVisible != makeVisible) { if (force || mCarrierLabelVisible != makeVisible) { mCarrierLabelVisible = makeVisible; if (DEBUG) { Slog.d(TAG, "making carrier label " + (makeVisible?"visible":"invisible")); Loading Loading @@ -986,7 +990,7 @@ public class PhoneStatusBar extends BaseStatusBar { .start(); } updateCarrierLabelVisibility(); updateCarrierLabelVisibility(false); } public void showClock(boolean show) { Loading Loading @@ -1159,9 +1163,10 @@ public class PhoneStatusBar extends BaseStatusBar { } mExpandedVisible = true; mPile.setLayoutTransitionsEnabled(true); makeSlippery(mNavigationBarView, true); updateCarrierLabelVisibility(); updateCarrierLabelVisibility(true); updateExpandedViewPos(EXPANDED_LEAVE_ALONE); Loading Loading @@ -1279,6 +1284,7 @@ public class PhoneStatusBar extends BaseStatusBar { return; } mExpandedVisible = false; mPile.setLayoutTransitionsEnabled(false); visibilityChanged(false); makeSlippery(mNavigationBarView, false); Loading Loading @@ -1562,6 +1568,9 @@ public class PhoneStatusBar extends BaseStatusBar { } float vel = (float)Math.hypot(yVel, xVel); if (vel > mFlingGestureMaxOutputVelocityPx) { vel = mFlingGestureMaxOutputVelocityPx; } if (negative) { vel = -vel; } Loading Loading @@ -2039,7 +2048,7 @@ public class PhoneStatusBar extends BaseStatusBar { mStatusBarWindow.setBackgroundColor(color); } updateCarrierLabelVisibility(); updateCarrierLabelVisibility(false); } void updateDisplaySize() { Loading Loading @@ -2266,6 +2275,8 @@ public class PhoneStatusBar extends BaseStatusBar { mFlingGestureMaxXVelocityPx = res.getDimension(R.dimen.fling_gesture_max_x_velocity); mFlingGestureMaxOutputVelocityPx = res.getDimension(R.dimen.fling_gesture_max_output_velocity); mNotificationPanelMarginBottomPx = (int) res.getDimension(R.dimen.notification_panel_margin_bottom); mNotificationPanelMarginLeftPx Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java +18 −3 Original line number Diff line number Diff line Loading @@ -68,6 +68,8 @@ public class NotificationRowLayout // animation is done boolean mRemoveViews = true; private LayoutTransition mRealLayoutTransition; public NotificationRowLayout(Context context, AttributeSet attrs) { this(context, attrs, 0); } Loading @@ -75,7 +77,8 @@ public class NotificationRowLayout public NotificationRowLayout(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); setLayoutTransition(new LayoutTransition()); mRealLayoutTransition = new LayoutTransition(); setLayoutTransitionsEnabled(true); setOrientation(LinearLayout.VERTICAL); Loading Loading @@ -121,9 +124,9 @@ public class NotificationRowLayout private void logLayoutTransition() { Log.v(TAG, "layout " + (getLayoutTransition().isChangingLayout() ? "is " : "is not ") + (mRealLayoutTransition.isChangingLayout() ? "is " : "is not ") + "in transition and animations " + (getLayoutTransition().isRunning() ? "are " : "are not ") + (mRealLayoutTransition.isRunning() ? "are " : "are not ") + "running."); } Loading Loading @@ -225,6 +228,18 @@ public class NotificationRowLayout mRemoveViews = removeViews; } // Suppress layout transitions for a little while. public void setLayoutTransitionsEnabled(boolean b) { if (b) { setLayoutTransition(mRealLayoutTransition); } else { if (mRealLayoutTransition.isRunning()) { mRealLayoutTransition.cancel(); } setLayoutTransition(null); } } public void dismissRowAnimated(View child) { dismissRowAnimated(child, 0); } Loading Loading
packages/SystemUI/res/values/dimens.xml +2 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,8 @@ <dimen name="fling_collapse_min_velocity">200dp</dimen> <!-- Cap on contribution of x dimension of gesture to overall velocity --> <dimen name="fling_gesture_max_x_velocity">200dp</dimen> <!-- Cap on overall resulting fling speed (s^-1) --> <dimen name="fling_gesture_max_output_velocity">3000dp</dimen> <!-- Minimum fraction of the display a gesture must travel, at any velocity, to qualify as a collapse request --> Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +17 −6 Original line number Diff line number Diff line Loading @@ -134,6 +134,9 @@ public class PhoneStatusBar extends BaseStatusBar { private float mExpandAccelPx; // classic value: 2000px/s/s private float mCollapseAccelPx; // classic value: 2000px/s/s (will be negated to collapse "up") private float mFlingGestureMaxOutputVelocityPx; // how fast can it really go? (should be a little // faster than mSelfCollapseVelocityPx) PhoneStatusBarPolicy mIconPolicy; // These are no longer handled by the policy, because we need custom strategies for them Loading Loading @@ -392,12 +395,13 @@ public class PhoneStatusBar extends BaseStatusBar { mTickerView = mStatusBarView.findViewById(R.id.ticker); mPile = (NotificationRowLayout)mStatusBarWindow.findViewById(R.id.latestItems); mPile.setLayoutTransitionsEnabled(false); mPile.setLongPressListener(getNotificationLongClicker()); if (SHOW_CARRIER_LABEL) { mPile.setOnSizeChangedListener(new OnSizeChangedListener() { @Override public void onSizeChanged(View view, int w, int h, int oldw, int oldh) { updateCarrierLabelVisibility(); updateCarrierLabelVisibility(false); } }); } Loading Loading @@ -889,7 +893,7 @@ public class PhoneStatusBar extends BaseStatusBar { } } protected void updateCarrierLabelVisibility() { protected void updateCarrierLabelVisibility(boolean force) { if (!SHOW_CARRIER_LABEL) return; // The idea here is to only show the carrier label when there is enough room to see it, // i.e. when there aren't enough notifications to fill the panel. Loading @@ -901,7 +905,7 @@ public class PhoneStatusBar extends BaseStatusBar { final boolean makeVisible = mPile.getHeight() < (mScrollView.getHeight() - mCarrierLabelHeight); if (mCarrierLabelVisible != makeVisible) { if (force || mCarrierLabelVisible != makeVisible) { mCarrierLabelVisible = makeVisible; if (DEBUG) { Slog.d(TAG, "making carrier label " + (makeVisible?"visible":"invisible")); Loading Loading @@ -986,7 +990,7 @@ public class PhoneStatusBar extends BaseStatusBar { .start(); } updateCarrierLabelVisibility(); updateCarrierLabelVisibility(false); } public void showClock(boolean show) { Loading Loading @@ -1159,9 +1163,10 @@ public class PhoneStatusBar extends BaseStatusBar { } mExpandedVisible = true; mPile.setLayoutTransitionsEnabled(true); makeSlippery(mNavigationBarView, true); updateCarrierLabelVisibility(); updateCarrierLabelVisibility(true); updateExpandedViewPos(EXPANDED_LEAVE_ALONE); Loading Loading @@ -1279,6 +1284,7 @@ public class PhoneStatusBar extends BaseStatusBar { return; } mExpandedVisible = false; mPile.setLayoutTransitionsEnabled(false); visibilityChanged(false); makeSlippery(mNavigationBarView, false); Loading Loading @@ -1562,6 +1568,9 @@ public class PhoneStatusBar extends BaseStatusBar { } float vel = (float)Math.hypot(yVel, xVel); if (vel > mFlingGestureMaxOutputVelocityPx) { vel = mFlingGestureMaxOutputVelocityPx; } if (negative) { vel = -vel; } Loading Loading @@ -2039,7 +2048,7 @@ public class PhoneStatusBar extends BaseStatusBar { mStatusBarWindow.setBackgroundColor(color); } updateCarrierLabelVisibility(); updateCarrierLabelVisibility(false); } void updateDisplaySize() { Loading Loading @@ -2266,6 +2275,8 @@ public class PhoneStatusBar extends BaseStatusBar { mFlingGestureMaxXVelocityPx = res.getDimension(R.dimen.fling_gesture_max_x_velocity); mFlingGestureMaxOutputVelocityPx = res.getDimension(R.dimen.fling_gesture_max_output_velocity); mNotificationPanelMarginBottomPx = (int) res.getDimension(R.dimen.notification_panel_margin_bottom); mNotificationPanelMarginLeftPx Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java +18 −3 Original line number Diff line number Diff line Loading @@ -68,6 +68,8 @@ public class NotificationRowLayout // animation is done boolean mRemoveViews = true; private LayoutTransition mRealLayoutTransition; public NotificationRowLayout(Context context, AttributeSet attrs) { this(context, attrs, 0); } Loading @@ -75,7 +77,8 @@ public class NotificationRowLayout public NotificationRowLayout(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); setLayoutTransition(new LayoutTransition()); mRealLayoutTransition = new LayoutTransition(); setLayoutTransitionsEnabled(true); setOrientation(LinearLayout.VERTICAL); Loading Loading @@ -121,9 +124,9 @@ public class NotificationRowLayout private void logLayoutTransition() { Log.v(TAG, "layout " + (getLayoutTransition().isChangingLayout() ? "is " : "is not ") + (mRealLayoutTransition.isChangingLayout() ? "is " : "is not ") + "in transition and animations " + (getLayoutTransition().isRunning() ? "are " : "are not ") + (mRealLayoutTransition.isRunning() ? "are " : "are not ") + "running."); } Loading Loading @@ -225,6 +228,18 @@ public class NotificationRowLayout mRemoveViews = removeViews; } // Suppress layout transitions for a little while. public void setLayoutTransitionsEnabled(boolean b) { if (b) { setLayoutTransition(mRealLayoutTransition); } else { if (mRealLayoutTransition.isRunning()) { mRealLayoutTransition.cancel(); } setLayoutTransition(null); } } public void dismissRowAnimated(View child) { dismissRowAnimated(child, 0); } Loading