summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@android.com>2012-09-04 22:56:44 -0400
committerDaniel Sandler <dsandler@android.com>2012-09-05 10:36:02 -0400
commitbf526d14f3252b8a5c123291e4cd8b1c51346560 (patch)
treee5dbf3114afbd0dd1776567dce849dac0041c2ef /packages/SystemUI
parente94831e5ed4aa3b1ebc5444cc1b16cdab8cb92f8 (diff)
downloadframeworks_base-bf526d14f3252b8a5c123291e4cd8b1c51346560.zip
frameworks_base-bf526d14f3252b8a5c123291e4cd8b1c51346560.tar.gz
frameworks_base-bf526d14f3252b8a5c123291e4cd8b1c51346560.tar.bz2
Full-height panels on phones.
The dynamic carrier label is also back for those devices. Finally, allow the panel to be dragged just by touching the (newly reopened) empty area. Bug: 6999596 Change-Id: I65f2867f1bd1977270de0bcedd32cb7141fcb6b1
Diffstat (limited to 'packages/SystemUI')
-rw-r--r--packages/SystemUI/res/layout-sw600dp/carrier_label.xml23
-rw-r--r--packages/SystemUI/res/layout/carrier_label.xml30
-rw-r--r--packages/SystemUI/res/layout/quick_settings.xml2
-rw-r--r--packages/SystemUI/res/layout/status_bar_expanded.xml9
-rw-r--r--packages/SystemUI/res/layout/super_status_bar.xml4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java27
7 files changed, 78 insertions, 27 deletions
diff --git a/packages/SystemUI/res/layout-sw600dp/carrier_label.xml b/packages/SystemUI/res/layout-sw600dp/carrier_label.xml
new file mode 100644
index 0000000..b33caf8
--- /dev/null
+++ b/packages/SystemUI/res/layout-sw600dp/carrier_label.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2012, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<Space
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:visibility="gone"
+ /> \ No newline at end of file
diff --git a/packages/SystemUI/res/layout/carrier_label.xml b/packages/SystemUI/res/layout/carrier_label.xml
new file mode 100644
index 0000000..41a1fff
--- /dev/null
+++ b/packages/SystemUI/res/layout/carrier_label.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2012, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<TextView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/carrier_label"
+ android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network"
+ android:layout_height="@dimen/carrier_label_height"
+ android:layout_width="match_parent"
+ android:layout_gravity="bottom"
+ android:layout_marginBottom="@dimen/close_handle_height"
+ android:gravity="center"
+ android:visibility="invisible"
+ /> \ No newline at end of file
diff --git a/packages/SystemUI/res/layout/quick_settings.xml b/packages/SystemUI/res/layout/quick_settings.xml
index c4b881e..8c6258a 100644
--- a/packages/SystemUI/res/layout/quick_settings.xml
+++ b/packages/SystemUI/res/layout/quick_settings.xml
@@ -19,6 +19,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/settings_panel"
+ android:background="#80000080"
>
<ImageView
android:layout_width="match_parent"
@@ -26,7 +27,6 @@
android:scaleType="centerInside"
android:src="@drawable/qs_coming_soon"
android:padding="4dp"
- android:background="#80000080"
/>
<LinearLayout android:id="@+id/handle"
android:layout_width="match_parent"
diff --git a/packages/SystemUI/res/layout/status_bar_expanded.xml b/packages/SystemUI/res/layout/status_bar_expanded.xml
index 8eff1f4..f2e83d8 100644
--- a/packages/SystemUI/res/layout/status_bar_expanded.xml
+++ b/packages/SystemUI/res/layout/status_bar_expanded.xml
@@ -29,15 +29,10 @@
android:layout_marginLeft="@dimen/notification_panel_margin_left"
>
- <TextView
- android:id="@+id/carrier_label"
- android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network"
+ <include
+ layout="@layout/carrier_label"
android:layout_height="@dimen/carrier_label_height"
android:layout_width="match_parent"
- android:layout_gravity="bottom"
- android:layout_marginBottom="@dimen/close_handle_height"
- android:gravity="center"
- android:visibility="invisible"
/>
<LinearLayout
diff --git a/packages/SystemUI/res/layout/super_status_bar.xml b/packages/SystemUI/res/layout/super_status_bar.xml
index ad6b8f4..5e0d1e8 100644
--- a/packages/SystemUI/res/layout/super_status_bar.xml
+++ b/packages/SystemUI/res/layout/super_status_bar.xml
@@ -40,11 +40,11 @@
>
<include layout="@layout/status_bar_expanded"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
/>
<include layout="@layout/quick_settings"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
/>
</com.android.systemui.statusbar.phone.PanelHolder>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
index 33f467f..2f551e1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
@@ -5,7 +5,7 @@ import android.animation.TimeAnimator.TimeListener;
import android.content.Context;
import android.content.res.Resources;
import android.util.AttributeSet;
-import android.util.Log;
+import android.util.Slog;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
@@ -18,7 +18,7 @@ public class PanelView extends FrameLayout {
public static final String TAG = PanelView.class.getSimpleName();
public final void LOG(String fmt, Object... args) {
if (!DEBUG) return;
- Log.v(TAG, (mViewName != null ? (mViewName + ": ") : "") + String.format(fmt, args));
+ Slog.v(TAG, (mViewName != null ? (mViewName + ": ") : "") + String.format(fmt, args));
}
public static final boolean BRAKES = false;
@@ -175,6 +175,12 @@ public class PanelView extends FrameLayout {
event.offsetLocation(-deltaX, -deltaY);
}
+ // Pass all touches along to the handle, allowing the user to drag the panel closed from its interior
+ @Override
+ public boolean onTouchEvent(MotionEvent event) {
+ return mHandleView.dispatchTouchEvent(event);
+ }
+
@Override
protected void onFinishInflate() {
super.onFinishInflate();
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 31bc8a0..433d3fe 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -109,8 +109,6 @@ public class PhoneStatusBar extends BaseStatusBar {
public static final String ACTION_STATUSBAR_START
= "com.android.internal.policy.statusbar.START";
- private static final boolean SHOW_CARRIER_LABEL = false; // XXX: doesn't work with rubberband panels right now
-
private static final int MSG_OPEN_NOTIFICATION_PANEL = 1000;
private static final int MSG_CLOSE_NOTIFICATION_PANEL = 1001;
// 1020-1030 reserved for BaseStatusBar
@@ -189,6 +187,9 @@ public class PhoneStatusBar extends BaseStatusBar {
private boolean mCarrierLabelVisible = false;
private int mCarrierLabelHeight;
private TextView mEmergencyCallLabel;
+ private int mNotificationHeaderHeight;
+
+ private boolean mShowCarrierInPanel = false;
// position
int[] mPositionTmp = new int[2];
@@ -310,14 +311,6 @@ public class PhoneStatusBar extends BaseStatusBar {
mStatusBarView.setPanelHolder(holder);
mNotificationPanel = (PanelView) mStatusBarWindow.findViewById(R.id.notification_panel);
- // don't allow clicks on the panel to pass through to the background where they will cause the panel to close
- View.OnTouchListener clickStopper = new View.OnTouchListener() {
- @Override
- public boolean onTouch(View v, MotionEvent event) {
- return true;
- }
- };
- mNotificationPanel.setOnTouchListener(clickStopper);
mNotificationPanelIsFullScreenWidth =
(mNotificationPanel.getLayoutParams().width == ViewGroup.LayoutParams.MATCH_PARENT);
mNotificationPanel.setSystemUiVisibility(
@@ -326,7 +319,6 @@ public class PhoneStatusBar extends BaseStatusBar {
// quick settings (WIP)
mSettingsPanel = (PanelView) mStatusBarWindow.findViewById(R.id.settings_panel);
- mSettingsPanel.setOnTouchListener(clickStopper);
if (!ActivityManager.isHighEndGfx()) {
mStatusBarWindow.setBackground(null);
@@ -419,8 +411,10 @@ public class PhoneStatusBar extends BaseStatusBar {
}});
}
- if (SHOW_CARRIER_LABEL) {
- mCarrierLabel = (TextView)mStatusBarWindow.findViewById(R.id.carrier_label);
+ mCarrierLabel = (TextView)mStatusBarWindow.findViewById(R.id.carrier_label);
+ mShowCarrierInPanel = (mCarrierLabel != null);
+ Slog.v(TAG, "carrierlabel=" + mCarrierLabel + " show=" + mShowCarrierInPanel);
+ if (mShowCarrierInPanel) {
mCarrierLabel.setVisibility(mCarrierLabelVisible ? View.VISIBLE : View.INVISIBLE);
// for mobile devices, we always show mobile connection info here (SPN/PLMN)
@@ -880,7 +874,7 @@ public class PhoneStatusBar extends BaseStatusBar {
}
protected void updateCarrierLabelVisibility(boolean force) {
- if (!SHOW_CARRIER_LABEL) return;
+ if (!mShowCarrierInPanel) return;
// The idea here is to only show the carrier label when there is enough room to see it,
// i.e. when there aren't enough notifications to fill the panel.
if (DEBUG) {
@@ -891,7 +885,7 @@ public class PhoneStatusBar extends BaseStatusBar {
final boolean emergencyCallsShownElsewhere = mEmergencyCallLabel != null;
final boolean makeVisible =
!(emergencyCallsShownElsewhere && mNetworkController.isEmergencyOnly())
- && mPile.getHeight() < (mScrollView.getHeight() - mCarrierLabelHeight);
+ && mPile.getHeight() < (mNotificationPanel.getHeight() - mCarrierLabelHeight - mNotificationHeaderHeight);
if (force || mCarrierLabelVisible != makeVisible) {
mCarrierLabelVisible = makeVisible;
@@ -1644,6 +1638,8 @@ public class PhoneStatusBar extends BaseStatusBar {
lp.gravity = mSettingsPanelGravity;
lp.rightMargin = mNotificationPanelMarginPx;
mSettingsPanel.setLayoutParams(lp);
+
+ updateCarrierLabelVisibility(false);
}
// called by makeStatusbar and also by PhoneStatusBarView
@@ -1918,6 +1914,7 @@ public class PhoneStatusBar extends BaseStatusBar {
+ res.getDimensionPixelSize(R.dimen.close_handle_underlap);
mCarrierLabelHeight = res.getDimensionPixelSize(R.dimen.carrier_label_height);
+ mNotificationHeaderHeight = res.getDimensionPixelSize(R.dimen.notification_panel_header_height);
if (false) Slog.v(TAG, "updateResources");
}