summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2014-05-09 22:26:09 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-09 22:26:09 +0000
commit9d8e968789da2ce70e9c1129be6d28fc1191cbf0 (patch)
treef4a45c3a34ecee3c327b88cdf40457be46ba578f /packages/SystemUI
parenta58405ef46d5f7ea563605697c2a4792fc11bd17 (diff)
parent1d0861dd6c9e2d48a60680bc1ba2bd274dbf07b6 (diff)
downloadframeworks_base-9d8e968789da2ce70e9c1129be6d28fc1191cbf0.zip
frameworks_base-9d8e968789da2ce70e9c1129be6d28fc1191cbf0.tar.gz
frameworks_base-9d8e968789da2ce70e9c1129be6d28fc1191cbf0.tar.bz2
am c1c89ade: Merge "Move Carrier label into universal status bar header."
* commit 'c1c89ade63dd2252c77a553c92f77b3d74cebde2': Move Carrier label into universal status bar header.
Diffstat (limited to 'packages/SystemUI')
-rw-r--r--packages/SystemUI/res/drawable/notification_header_bg.xml2
-rw-r--r--packages/SystemUI/res/layout/status_bar_expanded.xml9
-rw-r--r--packages/SystemUI/res/layout/status_bar_expanded_header.xml9
-rw-r--r--packages/SystemUI/res/values/dimens.xml3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java38
6 files changed, 46 insertions, 19 deletions
diff --git a/packages/SystemUI/res/drawable/notification_header_bg.xml b/packages/SystemUI/res/drawable/notification_header_bg.xml
index c5ba18b..b6b2e9a 100644
--- a/packages/SystemUI/res/drawable/notification_header_bg.xml
+++ b/packages/SystemUI/res/drawable/notification_header_bg.xml
@@ -24,7 +24,7 @@
</item>
<item>
<shape>
- <solid android:color="#ff374248" />
+ <solid android:color="#ff384248" />
<corners android:radius="@*android:dimen/notification_quantum_rounded_rect_radius" />
</shape>
</item>
diff --git a/packages/SystemUI/res/layout/status_bar_expanded.xml b/packages/SystemUI/res/layout/status_bar_expanded.xml
index 7308626..d36f692 100644
--- a/packages/SystemUI/res/layout/status_bar_expanded.xml
+++ b/packages/SystemUI/res/layout/status_bar_expanded.xml
@@ -34,15 +34,6 @@
android:layout_gravity="bottom"
/>
- <com.android.keyguard.CarrierText
- android:id="@+id/keyguard_carrier_text"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="2dp"
- android:layout_marginLeft="8dp"
- android:ellipsize="marquee"
- android:textAppearance="?android:attr/textAppearanceMedium" />
-
<include
layout="@layout/keyguard_status_view"
android:layout_height="wrap_content"
diff --git a/packages/SystemUI/res/layout/status_bar_expanded_header.xml b/packages/SystemUI/res/layout/status_bar_expanded_header.xml
index 3759f82..ac81e4e 100644
--- a/packages/SystemUI/res/layout/status_bar_expanded_header.xml
+++ b/packages/SystemUI/res/layout/status_bar_expanded_header.xml
@@ -65,6 +65,15 @@
/>
</RelativeLayout>
+ <com.android.keyguard.CarrierText
+ android:id="@+id/keyguard_carrier_text"
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/status_bar_header_height_keyguard"
+ android:layout_marginLeft="8dp"
+ android:gravity="center_vertical"
+ android:ellipsize="marquee"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
+
<FrameLayout android:id="@+id/system_icons_container"
android:layout_width="wrap_content"
android:layout_height="@dimen/status_bar_header_height"
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 50df706..7c68600 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -158,6 +158,9 @@
<!-- Height of the status bar header bar when expanded -->
<dimen name="status_bar_header_height_expanded">144dp</dimen>
+ <!-- Height of the status bar header bar when on Keyguard -->
+ <dimen name="status_bar_header_height_keyguard">40dp</dimen>
+
<!-- Gravity for the notification panel -->
<!-- 0x37 = fill_horizontal|top -->
<integer name="notification_panel_layout_gravity">0x37</integer>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index a9a504e..dad858e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -247,7 +247,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
private int mCarrierLabelHeight;
private TextView mEmergencyCallLabel;
private int mStatusBarHeaderHeight;
- private View mKeyguardCarrierLabel;
private boolean mShowCarrierInPanel = false;
@@ -626,7 +625,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
(NotificationOverflowContainer) LayoutInflater.from(mContext).inflate(
R.layout.status_bar_notification_keyguard_overflow, mStackScroller, false);
mKeyguardIconOverflowContainer.setOnActivatedListener(this);
- mKeyguardCarrierLabel = mStatusBarWindow.findViewById(R.id.keyguard_carrier_text);
mKeyguardIconOverflowContainer.setOnClickListener(mOverflowClickListener);
mStackScroller.addView(mKeyguardIconOverflowContainer);
@@ -2717,14 +2715,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
mKeyguardBottomArea.setVisibility(View.VISIBLE);
mKeyguardIndicationTextView.setVisibility(View.VISIBLE);
mKeyguardIndicationTextView.switchIndication(mKeyguardHotwordPhrase);
- mKeyguardCarrierLabel.setVisibility(View.VISIBLE);
mNotificationPanel.closeQs();
} else {
mKeyguardStatusView.setVisibility(View.GONE);
mKeyguardBottomArea.setVisibility(View.GONE);
mKeyguardIndicationTextView.setVisibility(View.GONE);
- mKeyguardCarrierLabel.setVisibility(View.GONE);
}
mSettingsContainer.setKeyguardShowing(mState == StatusBarState.KEYGUARD);
mHeader.setKeyguardShowing(mState == StatusBarState.KEYGUARD);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
index 6b3c94e..67487ab 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
@@ -34,9 +34,13 @@ public class StatusBarHeaderView extends RelativeLayout {
private View mBackground;
private ViewGroup mSystemIconsContainer;
private View mDateTime;
+ private View mKeyguardCarrierText;
private int mCollapsedHeight;
private int mExpandedHeight;
+ private int mKeyguardHeight;
+
+ private boolean mKeyguardShowing;
public StatusBarHeaderView(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -48,6 +52,7 @@ public class StatusBarHeaderView extends RelativeLayout {
mBackground = findViewById(R.id.background);
mSystemIconsContainer = (ViewGroup) findViewById(R.id.system_icons_container);
mDateTime = findViewById(R.id.datetime);
+ mKeyguardCarrierText = findViewById(R.id.keyguard_carrier_text);
loadDimens();
}
@@ -55,10 +60,12 @@ public class StatusBarHeaderView extends RelativeLayout {
mCollapsedHeight = getResources().getDimensionPixelSize(R.dimen.status_bar_header_height);
mExpandedHeight = getResources().getDimensionPixelSize(
R.dimen.status_bar_header_height_expanded);
+ mKeyguardHeight = getResources().getDimensionPixelSize(
+ R.dimen.status_bar_header_height_keyguard);
}
public int getCollapsedHeight() {
- return mCollapsedHeight;
+ return mKeyguardShowing ? mKeyguardHeight : mCollapsedHeight;
}
public int getExpandedHeight() {
@@ -66,11 +73,29 @@ public class StatusBarHeaderView extends RelativeLayout {
}
public void setExpanded(boolean expanded) {
- if (expanded != mExpanded) {
- ViewGroup.LayoutParams lp = getLayoutParams();
- lp.height = expanded ? mExpandedHeight : mCollapsedHeight;
+ mExpanded = expanded;
+ updateHeights();
+ }
+
+ private void updateHeights() {
+ int height;
+ if (mExpanded) {
+ height = mExpandedHeight;
+ } else if (mKeyguardShowing) {
+ height = mKeyguardHeight;
+ } else {
+ height = mCollapsedHeight;
+ }
+ ViewGroup.LayoutParams lp = getLayoutParams();
+ if (lp.height != height) {
+ lp.height = height;
setLayoutParams(lp);
- mExpanded = expanded;
+ }
+ int systemIconsContainerHeight = mKeyguardShowing ? mKeyguardHeight : mCollapsedHeight;
+ lp = mSystemIconsContainer.getLayoutParams();
+ if (lp.height != systemIconsContainerHeight) {
+ lp.height = systemIconsContainerHeight;
+ mSystemIconsContainer.setLayoutParams(lp);
}
}
@@ -97,12 +122,15 @@ public class StatusBarHeaderView extends RelativeLayout {
}
public void setKeyguardShowing(boolean keyguardShowing) {
+ mKeyguardShowing = keyguardShowing;
mBackground.setVisibility(keyguardShowing ? View.INVISIBLE : View.VISIBLE);
mDateTime.setVisibility(keyguardShowing ? View.INVISIBLE : View.VISIBLE);
+ mKeyguardCarrierText.setVisibility(keyguardShowing ? View.VISIBLE : View.GONE);
if (keyguardShowing) {
setZ(0);
} else {
setTranslationZ(0);
}
+ updateHeights();
}
}