am e27bfe30: Merge "Fix QuickSettings header state on Keyguard."

* commit 'e27bfe30dda829fd9e0f4dcaee15a0aa6f3096c0':
  Fix QuickSettings header state on Keyguard.
This commit is contained in:
Jorim Jaggi
2014-05-12 15:41:18 +00:00
committed by Android Git Automerger
2 changed files with 9 additions and 10 deletions

View File

@@ -414,11 +414,8 @@ public class NotificationPanelView extends PanelView implements
if (!mQsExpansionEnabled) {
return false;
}
View headerView = mStatusBar.getBarState() == StatusBarState.KEYGUARD && !mQsExpanded
? mKeyguardStatusView
: mHeader;
boolean onHeader = x >= headerView.getLeft() && x <= headerView.getRight()
&& y >= headerView.getTop() && y <= headerView.getBottom();
boolean onHeader = x >= mHeader.getLeft() && x <= mHeader.getRight()
&& y >= mHeader.getTop() && y <= mHeader.getBottom();
if (mQsExpanded) {
return onHeader || (mScrollView.isScrolledToBottom() && yDiff < 0);
} else {

View File

@@ -114,10 +114,11 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL
}
private void updateHeights() {
boolean onKeyguardAndCollapsed = mKeyguardShowing && !mExpanded;
int height;
if (mExpanded) {
height = mExpandedHeight;
} else if (mKeyguardShowing) {
} else if (onKeyguardAndCollapsed) {
height = mKeyguardHeight;
} else {
height = mCollapsedHeight;
@@ -127,7 +128,7 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL
lp.height = height;
setLayoutParams(lp);
}
int systemIconsContainerHeight = mKeyguardShowing ? mKeyguardHeight : mCollapsedHeight;
int systemIconsContainerHeight = onKeyguardAndCollapsed ? mKeyguardHeight : mCollapsedHeight;
lp = mSystemIconsContainer.getLayoutParams();
if (lp.height != systemIconsContainerHeight) {
lp.height = systemIconsContainerHeight;
@@ -150,9 +151,10 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL
}
private void updateVisibilities() {
mBackground.setVisibility(mKeyguardShowing ? View.INVISIBLE : View.VISIBLE);
mDateTime.setVisibility(mKeyguardShowing ? View.INVISIBLE : View.VISIBLE);
mKeyguardCarrierText.setVisibility(mKeyguardShowing ? View.VISIBLE : View.GONE);
boolean onKeyguardAndCollapsed = mKeyguardShowing && !mExpanded;
mBackground.setVisibility(onKeyguardAndCollapsed ? View.INVISIBLE : View.VISIBLE);
mDateTime.setVisibility(onKeyguardAndCollapsed ? View.INVISIBLE : View.VISIBLE);
mKeyguardCarrierText.setVisibility(onKeyguardAndCollapsed ? View.VISIBLE : View.GONE);
mDate.setVisibility(mExpanded ? View.VISIBLE : View.GONE);
mSettingsButton.setVisibility(mExpanded ? View.VISIBLE : View.GONE);
mBrightnessContainer.setVisibility(mExpanded ? View.VISIBLE : View.GONE);