Merge "Animate the heads up notification into the shade."
This commit is contained in:
@@ -165,6 +165,8 @@ public class PhoneStatusBar extends BaseStatusBar {
|
|||||||
int mIconHPadding = -1;
|
int mIconHPadding = -1;
|
||||||
Display mDisplay;
|
Display mDisplay;
|
||||||
Point mCurrentDisplaySize = new Point();
|
Point mCurrentDisplaySize = new Point();
|
||||||
|
private float mHeadsUpVerticalOffset;
|
||||||
|
private int[] mPilePosition = new int[2];
|
||||||
|
|
||||||
StatusBarWindowView mStatusBarWindow;
|
StatusBarWindowView mStatusBarWindow;
|
||||||
PhoneStatusBarView mStatusBarView;
|
PhoneStatusBarView mStatusBarView;
|
||||||
@@ -839,7 +841,7 @@ public class PhoneStatusBar extends BaseStatusBar {
|
|||||||
private void addHeadsUpView() {
|
private void addHeadsUpView() {
|
||||||
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
|
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
|
||||||
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT,
|
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT,
|
||||||
WindowManager.LayoutParams.TYPE_STATUS_BAR_SUB_PANEL, // below the status bar!
|
WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL, // above the status bar!
|
||||||
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
|
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
|
||||||
| WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
|
| WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
|
||||||
| WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
|
| WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
|
||||||
@@ -2365,6 +2367,8 @@ public class PhoneStatusBar extends BaseStatusBar {
|
|||||||
|
|
||||||
if (ENABLE_HEADS_UP && mHeadsUpNotificationView != null) {
|
if (ENABLE_HEADS_UP && mHeadsUpNotificationView != null) {
|
||||||
mHeadsUpNotificationView.setMargin(mNotificationPanelMarginPx);
|
mHeadsUpNotificationView.setMargin(mNotificationPanelMarginPx);
|
||||||
|
mPile.getLocationOnScreen(mPilePosition);
|
||||||
|
mHeadsUpVerticalOffset = mPilePosition[1] - mNaturalBarHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateCarrierLabelVisibility(false);
|
updateCarrierLabelVisibility(false);
|
||||||
@@ -2554,6 +2558,17 @@ public class PhoneStatusBar extends BaseStatusBar {
|
|||||||
mHeadsUpNotificationView.setVisibility(vis ? View.VISIBLE : View.GONE);
|
mHeadsUpNotificationView.setVisibility(vis ? View.VISIBLE : View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void animateHeadsUp(boolean animateInto, float frac) {
|
||||||
|
if (!ENABLE_HEADS_UP || mHeadsUpNotificationView == null) return;
|
||||||
|
frac = frac / 0.4f;
|
||||||
|
frac = frac < 1.0f ? frac : 1.0f;
|
||||||
|
float alpha = 1.0f - frac;
|
||||||
|
float offset = mHeadsUpVerticalOffset * frac;
|
||||||
|
offset = animateInto ? offset : 0f;
|
||||||
|
mHeadsUpNotificationView.setAlpha(alpha);
|
||||||
|
mHeadsUpNotificationView.setY(offset);
|
||||||
|
}
|
||||||
|
|
||||||
public void onHeadsUpDismissed() {
|
public void onHeadsUpDismissed() {
|
||||||
if (mInterruptingNotificationEntry == null) return;
|
if (mInterruptingNotificationEntry == null) return;
|
||||||
|
|
||||||
|
|||||||
@@ -236,6 +236,8 @@ public class PhoneStatusBarView extends PanelBar {
|
|||||||
panel.setAlpha(alpha);
|
panel.setAlpha(alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mBar.animateHeadsUp(mNotificationPanel == panel, mPanelExpandedFractionSum);
|
||||||
|
|
||||||
mBar.updateCarrierLabelVisibility(false);
|
mBar.updateCarrierLabelVisibility(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user