Merge "Fix issue #4500511: Holo effect background doesn't reach top of screen anymore" into honeycomb-mr2

This commit is contained in:
Dianne Hackborn
2011-06-01 12:34:48 -07:00
committed by Android (Google) Code Review
3 changed files with 60 additions and 44 deletions

View File

@@ -724,10 +724,17 @@ public final class ViewRoot extends Handler implements ViewParent,
fullRedrawNeeded = true;
mLayoutRequested = true;
DisplayMetrics packageMetrics =
mView.getContext().getResources().getDisplayMetrics();
desiredWindowWidth = packageMetrics.widthPixels;
desiredWindowHeight = packageMetrics.heightPixels;
if (lp.type == WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL) {
// NOTE -- system code, won't try to do compat mode.
Display disp = WindowManagerImpl.getDefault().getDefaultDisplay();
desiredWindowWidth = disp.getRealWidth();
desiredWindowHeight = disp.getRealHeight();
} else {
DisplayMetrics packageMetrics =
mView.getContext().getResources().getDisplayMetrics();
desiredWindowWidth = packageMetrics.widthPixels;
desiredWindowHeight = packageMetrics.heightPixels;
}
// For the very first time, tell the view hierarchy that it
// is attached to the window. Note that at this point the surface
@@ -851,9 +858,16 @@ public final class ViewRoot extends Handler implements ViewParent,
|| lp.height == ViewGroup.LayoutParams.WRAP_CONTENT) {
windowSizeMayChange = true;
DisplayMetrics packageMetrics = res.getDisplayMetrics();
desiredWindowWidth = packageMetrics.widthPixels;
desiredWindowHeight = packageMetrics.heightPixels;
if (lp.type == WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL) {
// NOTE -- system code, won't try to do compat mode.
Display disp = WindowManagerImpl.getDefault().getDefaultDisplay();
desiredWindowWidth = disp.getRealWidth();
desiredWindowHeight = disp.getRealHeight();
} else {
DisplayMetrics packageMetrics = res.getDisplayMetrics();
desiredWindowWidth = packageMetrics.widthPixels;
desiredWindowHeight = packageMetrics.heightPixels;
}
}
}

View File

@@ -308,7 +308,7 @@ public class TabletStatusBar extends StatusBar implements
final Resources res = mContext.getResources();
final Display d = WindowManagerImpl.getDefault().getDefaultDisplay();
return Math.max(res.getDimensionPixelSize(R.dimen.notification_panel_min_height),
d.getHeight());
d.getRealHeight());
}
@Override

View File

@@ -1781,21 +1781,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// frame is the same as the one we are attached to.
setAttachedWindowFrames(win, fl, sim, attached, true, pf, df, cf, vf);
} else {
if (attrs.type == TYPE_STATUS_BAR_PANEL) {
// Status bar panels are the only windows who can go on top of
// the status bar. They are protected by the STATUS_BAR_SERVICE
// permission, so they have the same privileges as the status
// bar itself.
pf.left = df.left = mUnrestrictedScreenLeft;
pf.top = df.top = mUnrestrictedScreenTop;
pf.right = df.right = mUnrestrictedScreenLeft+mUnrestrictedScreenWidth;
pf.bottom = df.bottom = mUnrestrictedScreenTop+mUnrestrictedScreenHeight;
} else {
pf.left = df.left = mRestrictedScreenLeft;
pf.top = df.top = mRestrictedScreenTop;
pf.right = df.right = mRestrictedScreenLeft+mRestrictedScreenWidth;
pf.bottom = df.bottom = mRestrictedScreenTop+mRestrictedScreenHeight;
}
pf.left = df.left = mRestrictedScreenLeft;
pf.top = df.top = mRestrictedScreenTop;
pf.right = df.right = mRestrictedScreenLeft+mRestrictedScreenWidth;
pf.bottom = df.bottom = mRestrictedScreenTop+mRestrictedScreenHeight;
if (adjust != SOFT_INPUT_ADJUST_RESIZE) {
cf.left = mDockLeft;
cf.top = mDockTop;
@@ -1848,28 +1837,41 @@ public class PhoneWindowManager implements WindowManagerPolicy {
} else {
// Otherwise, a normal window must be placed inside the content
// of all screen decorations.
pf.left = mContentLeft;
pf.top = mContentTop;
pf.right = mContentRight;
pf.bottom = mContentBottom;
if (adjust != SOFT_INPUT_ADJUST_RESIZE) {
df.left = cf.left = mDockLeft;
df.top = cf.top = mDockTop;
df.right = cf.right = mDockRight;
df.bottom = cf.bottom = mDockBottom;
if (attrs.type == TYPE_STATUS_BAR_PANEL) {
// Status bar panels are the only windows who can go on top of
// the status bar. They are protected by the STATUS_BAR_SERVICE
// permission, so they have the same privileges as the status
// bar itself.
pf.left = df.left = cf.left = vf.left = mUnrestrictedScreenLeft;
pf.top = df.top = cf.top = vf.top = mUnrestrictedScreenTop;
pf.right = df.right = cf.right = vf.right
= mUnrestrictedScreenLeft+mUnrestrictedScreenWidth;
pf.bottom = df.bottom = cf.bottom = vf.bottom
= mUnrestrictedScreenTop+mUnrestrictedScreenHeight;
} else {
df.left = cf.left = mContentLeft;
df.top = cf.top = mContentTop;
df.right = cf.right = mContentRight;
df.bottom = cf.bottom = mContentBottom;
}
if (adjust != SOFT_INPUT_ADJUST_NOTHING) {
vf.left = mCurLeft;
vf.top = mCurTop;
vf.right = mCurRight;
vf.bottom = mCurBottom;
} else {
vf.set(cf);
pf.left = mContentLeft;
pf.top = mContentTop;
pf.right = mContentRight;
pf.bottom = mContentBottom;
if (adjust != SOFT_INPUT_ADJUST_RESIZE) {
df.left = cf.left = mDockLeft;
df.top = cf.top = mDockTop;
df.right = cf.right = mDockRight;
df.bottom = cf.bottom = mDockBottom;
} else {
df.left = cf.left = mContentLeft;
df.top = cf.top = mContentTop;
df.right = cf.right = mContentRight;
df.bottom = cf.bottom = mContentBottom;
}
if (adjust != SOFT_INPUT_ADJUST_NOTHING) {
vf.left = mCurLeft;
vf.top = mCurTop;
vf.right = mCurRight;
vf.bottom = mCurBottom;
} else {
vf.set(cf);
}
}
}
}