Merge "Conserve expansion after re-inflation" into pi-dev
am: 0eb2be3a67
Change-Id: I44f868df5cafeac3bef09586403cf955bad1e581
This commit is contained in:
@@ -29,6 +29,7 @@ public abstract class PanelBar extends FrameLayout {
|
||||
private static final boolean SPEW = false;
|
||||
private boolean mBouncerShowing;
|
||||
private boolean mExpanded;
|
||||
protected float mPanelFraction;
|
||||
|
||||
public static final void LOG(String fmt, Object... args) {
|
||||
if (!DEBUG) return;
|
||||
@@ -77,6 +78,14 @@ public abstract class PanelBar extends FrameLayout {
|
||||
if (mPanel != null) mPanel.setImportantForAccessibility(important);
|
||||
}
|
||||
|
||||
public float getExpansionFraction() {
|
||||
return mPanelFraction;
|
||||
}
|
||||
|
||||
public boolean isExpanded() {
|
||||
return mExpanded;
|
||||
}
|
||||
|
||||
private void updateVisibility() {
|
||||
mPanel.setVisibility(mExpanded || mBouncerShowing ? VISIBLE : INVISIBLE);
|
||||
}
|
||||
@@ -131,6 +140,7 @@ public abstract class PanelBar extends FrameLayout {
|
||||
if (SPEW) LOG("panelExpansionChanged: start state=%d", mState);
|
||||
PanelView pv = mPanel;
|
||||
mExpanded = expanded;
|
||||
mPanelFraction = frac;
|
||||
updateVisibility();
|
||||
// adjust any other panels that may be partially visible
|
||||
if (expanded) {
|
||||
|
||||
@@ -59,7 +59,6 @@ public class PhoneStatusBarView extends PanelBar {
|
||||
private final PhoneStatusBarTransitions mBarTransitions;
|
||||
private ScrimController mScrimController;
|
||||
private float mMinFraction;
|
||||
private float mPanelFraction;
|
||||
private Runnable mHideExpandedRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -269,7 +268,6 @@ public class PhoneStatusBarView extends PanelBar {
|
||||
@Override
|
||||
public void panelExpansionChanged(float frac, boolean expanded) {
|
||||
super.panelExpansionChanged(frac, expanded);
|
||||
mPanelFraction = frac;
|
||||
updateScrimFraction();
|
||||
if ((frac == 0 || frac == 1) && mBar.getNavigationBarView() != null) {
|
||||
mBar.getNavigationBarView().onPanelExpandedChange(expanded);
|
||||
|
||||
@@ -836,11 +836,17 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
CollapsedStatusBarFragment statusBarFragment =
|
||||
(CollapsedStatusBarFragment) fragment;
|
||||
statusBarFragment.initNotificationIconArea(mNotificationIconAreaController);
|
||||
PhoneStatusBarView oldStatusBarView = mStatusBarView;
|
||||
mStatusBarView = (PhoneStatusBarView) fragment.getView();
|
||||
mStatusBarView.setBar(this);
|
||||
mStatusBarView.setPanel(mNotificationPanel);
|
||||
mStatusBarView.setScrimController(mScrimController);
|
||||
mStatusBarView.setBouncerShowing(mBouncerShowing);
|
||||
if (oldStatusBarView != null) {
|
||||
float fraction = oldStatusBarView.getExpansionFraction();
|
||||
boolean expanded = oldStatusBarView.isExpanded();
|
||||
mStatusBarView.panelExpansionChanged(fraction, expanded);
|
||||
}
|
||||
if (mHeadsUpAppearanceController != null) {
|
||||
// This view is being recreated, let's destroy the old one
|
||||
mHeadsUpAppearanceController.destroy();
|
||||
|
||||
Reference in New Issue
Block a user