summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@android.com>2012-09-28 10:47:45 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-09-28 10:47:45 -0700
commit6e061919f313f787c91047bebdfb95fdb756d6bb (patch)
tree1d05bf8c8e53a1df63c0979216c762fa545e5bc6 /packages
parent95841ac3c2d45a839cc3cd0bd420fd9d91ccd583 (diff)
parente680f5483f845e2c9f75b80358599b5d654a9f8b (diff)
downloadframeworks_base-6e061919f313f787c91047bebdfb95fdb756d6bb.zip
frameworks_base-6e061919f313f787c91047bebdfb95fdb756d6bb.tar.gz
frameworks_base-6e061919f313f787c91047bebdfb95fdb756d6bb.tar.bz2
Merge "Prop the tablet notification panel open a bit." into jb-mr1-dev
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/res/values-sw600dp/dimens.xml3
-rw-r--r--packages/SystemUI/res/values/dimens.xml3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java35
3 files changed, 22 insertions, 19 deletions
diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml
index a687571..df6ed19 100644
--- a/packages/SystemUI/res/values-sw600dp/dimens.xml
+++ b/packages/SystemUI/res/values-sw600dp/dimens.xml
@@ -44,4 +44,7 @@
<!-- On tablet-sized devices, we allocate the rightmost third(ish) of the draggable status bar
to quick settings. -->
<item type="dimen" name="settings_panel_dragzone_fraction">35%</item>
+
+ <!-- Minimum fraction of the screen that should be taken up by the notification panel. -->
+ <item type="dimen" name="notification_panel_min_height_frac">40%</item>
</resources>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 5b15844..62289fb 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -189,4 +189,7 @@
<!-- The padding between each tile within the QuickSettings layout -->
<dimen name="quick_settings_cell_gap">4dp</dimen>
+ <!-- Minimum fraction of the screen that should be taken up by the notification panel.
+ Not used at this screen size. -->
+ <item type="dimen" name="notification_panel_min_height_frac">0%</item>
</resources>
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 508835f..4f0d113 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -33,6 +33,7 @@ import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.PixelFormat;
+import android.graphics.Point;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
@@ -143,6 +144,7 @@ public class PhoneStatusBar extends BaseStatusBar {
int mIconSize = -1;
int mIconHPadding = -1;
Display mDisplay;
+ Point mCurrentDisplaySize = new Point();
IDreamManager mDreamManager;
@@ -169,10 +171,9 @@ public class PhoneStatusBar extends BaseStatusBar {
PanelView mNotificationPanel; // the sliding/resizing panel within the notification window
ScrollView mScrollView;
View mExpandedContents;
- final Rect mNotificationPanelBackgroundPadding = new Rect();
int mNotificationPanelGravity;
int mNotificationPanelMarginBottomPx, mNotificationPanelMarginPx;
- int mNotificationPanelMinHeight;
+ float mNotificationPanelMinHeightFrac;
boolean mNotificationPanelIsFullScreenWidth;
TextView mNotificationPanelDebugText;
@@ -1644,12 +1645,17 @@ public class PhoneStatusBar extends BaseStatusBar {
@Override
public void updateExpandedViewPos(int thingy) {
- // TODO
if (DEBUG) Slog.v(TAG, "updateExpandedViewPos");
+
+ // on larger devices, the notification panel is propped open a bit
+ mNotificationPanel.setMinimumHeight(
+ (int)(mNotificationPanelMinHeightFrac * mCurrentDisplaySize.y));
+
FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) mNotificationPanel.getLayoutParams();
lp.gravity = mNotificationPanelGravity;
lp.leftMargin = mNotificationPanelMarginPx;
mNotificationPanel.setLayoutParams(lp);
+
lp = (FrameLayout.LayoutParams) mSettingsPanel.getLayoutParams();
lp.gravity = mSettingsPanelGravity;
lp.rightMargin = mNotificationPanelMarginPx;
@@ -1781,6 +1787,8 @@ public class PhoneStatusBar extends BaseStatusBar {
if (DEBUG) {
Slog.v(TAG, "configuration changed: " + mContext.getResources().getConfiguration());
}
+ mDisplay.getSize(mCurrentDisplaySize);
+
updateResources();
repositionNavigationBar();
updateExpandedViewPos(EXPANDED_LEAVE_ALONE);
@@ -1889,27 +1897,16 @@ public class PhoneStatusBar extends BaseStatusBar {
if (mSettingsPanelGravity <= 0) {
mSettingsPanelGravity = Gravity.RIGHT | Gravity.TOP;
}
- getNinePatchPadding(res.getDrawable(R.drawable.notification_panel_bg), mNotificationPanelBackgroundPadding);
- final int notificationPanelDecorationHeight =
- res.getDimensionPixelSize(R.dimen.notification_panel_padding_top)
- + res.getDimensionPixelSize(R.dimen.notification_panel_header_height)
- + mNotificationPanelBackgroundPadding.top
- + mNotificationPanelBackgroundPadding.bottom;
- mNotificationPanelMinHeight =
- notificationPanelDecorationHeight
- + 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");
- }
-
- private static void getNinePatchPadding(Drawable d, Rect outPadding) {
- if (d instanceof NinePatchDrawable) {
- NinePatchDrawable ninePatch = (NinePatchDrawable) d;
- ninePatch.getPadding(outPadding);
+ mNotificationPanelMinHeightFrac = res.getFraction(R.dimen.notification_panel_min_height_frac, 1, 1);
+ if (mNotificationPanelMinHeightFrac < 0f || mNotificationPanelMinHeightFrac > 1f) {
+ mNotificationPanelMinHeightFrac = 0f;
}
+
+ if (false) Slog.v(TAG, "updateResources");
}
//