summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src/com')
-rw-r--r--packages/SystemUI/src/com/android/systemui/SearchPanelView.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java62
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/CloseDragHandle.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java22
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java75
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java32
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsView.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java29
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java10
14 files changed, 144 insertions, 114 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/SearchPanelView.java b/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
index b0879fc..f71f554 100644
--- a/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
@@ -72,7 +72,7 @@ public class SearchPanelView extends FrameLayout implements
private void startAssistActivity() {
// Close Recent Apps if needed
- mBar.animateCollapseNotifications(CommandQueue.FLAG_EXCLUDE_SEARCH_PANEL);
+ mBar.animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_SEARCH_PANEL);
// Launch Assist
Intent intent = ((SearchManager) mContext.getSystemService(Context.SEARCH_SERVICE))
.getAssistIntent(mContext, UserHandle.USER_CURRENT);
@@ -220,7 +220,7 @@ public class SearchPanelView extends FrameLayout implements
public void hide(boolean animate) {
if (mBar != null) {
// This will indirectly cause show(false, ...) to get called
- mBar.animateCollapseNotifications(CommandQueue.FLAG_EXCLUDE_NONE);
+ mBar.animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE);
} else {
setVisibility(View.INVISIBLE);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index de016c0..d7b1b35 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -185,7 +185,7 @@ public abstract class BaseStatusBar extends SystemUI implements
if (isActivity && handled) {
// close the shade if it was open
- animateCollapseNotifications(CommandQueue.FLAG_EXCLUDE_NONE);
+ animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE);
visibilityChanged(false);
}
return handled;
@@ -357,7 +357,7 @@ public abstract class BaseStatusBar extends SystemUI implements
public boolean onMenuItemClick(MenuItem item) {
if (item.getItemId() == R.id.notification_inspect_item) {
startApplicationDetailsActivity(packageNameF);
- animateCollapseNotifications(CommandQueue.FLAG_EXCLUDE_NONE);
+ animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE);
} else {
return false;
}
@@ -789,7 +789,7 @@ public abstract class BaseStatusBar extends SystemUI implements
}
// close the shade if it was open
- animateCollapseNotifications(CommandQueue.FLAG_EXCLUDE_NONE);
+ animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE);
visibilityChanged(false);
// If this click was on the intruder alert, hide that instead
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
index 39e49b8..752bb0c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
@@ -46,17 +46,16 @@ public class CommandQueue extends IStatusBar.Stub {
private static final int MSG_REMOVE_NOTIFICATION = 4 << MSG_SHIFT;
private static final int MSG_DISABLE = 5 << MSG_SHIFT;
private static final int MSG_EXPAND_NOTIFICATIONS = 6 << MSG_SHIFT;
- private static final int MSG_COLLAPSE_NOTIFICATIONS = 7 << MSG_SHIFT;
- private static final int MSG_EXPAND_QUICK_SETTINGS = 8 << MSG_SHIFT;
- private static final int MSG_COLLAPSE_QUICK_SETTINGS = 9 << MSG_SHIFT;
- private static final int MSG_SET_SYSTEMUI_VISIBILITY = 10 << MSG_SHIFT;
- private static final int MSG_TOP_APP_WINDOW_CHANGED = 11 << MSG_SHIFT;
- private static final int MSG_SHOW_IME_BUTTON = 12 << MSG_SHIFT;
- private static final int MSG_SET_HARD_KEYBOARD_STATUS = 13 << MSG_SHIFT;
- private static final int MSG_TOGGLE_RECENT_APPS = 14 << MSG_SHIFT;
- private static final int MSG_PRELOAD_RECENT_APPS = 15 << MSG_SHIFT;
- private static final int MSG_CANCEL_PRELOAD_RECENT_APPS = 16 << MSG_SHIFT;
- private static final int MSG_SET_NAVIGATION_ICON_HINTS = 17 << MSG_SHIFT;
+ private static final int MSG_COLLAPSE_PANELS = 7 << MSG_SHIFT;
+ private static final int MSG_EXPAND_SETTINGS = 8 << MSG_SHIFT;
+ private static final int MSG_SET_SYSTEMUI_VISIBILITY = 9 << MSG_SHIFT;
+ private static final int MSG_TOP_APP_WINDOW_CHANGED = 10 << MSG_SHIFT;
+ private static final int MSG_SHOW_IME_BUTTON = 11 << MSG_SHIFT;
+ private static final int MSG_SET_HARD_KEYBOARD_STATUS = 12 << MSG_SHIFT;
+ private static final int MSG_TOGGLE_RECENT_APPS = 13 << MSG_SHIFT;
+ private static final int MSG_PRELOAD_RECENT_APPS = 14 << MSG_SHIFT;
+ private static final int MSG_CANCEL_PRELOAD_RECENT_APPS = 15 << MSG_SHIFT;
+ private static final int MSG_SET_NAVIGATION_ICON_HINTS = 16 << MSG_SHIFT;
public static final int FLAG_EXCLUDE_NONE = 0;
public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 0;
@@ -86,10 +85,9 @@ public class CommandQueue extends IStatusBar.Stub {
public void updateNotification(IBinder key, StatusBarNotification notification);
public void removeNotification(IBinder key);
public void disable(int state);
- public void animateExpandNotifications();
- public void animateCollapseNotifications(int flags);
- public void animateExpandQuickSettings();
- public void animateCollapseQuickSettings();
+ public void animateExpandNotificationsPanel();
+ public void animateCollapsePanels(int flags);
+ public void animateExpandSettingsPanel();
public void setSystemUiVisibility(int vis, int mask);
public void topAppWindowChanged(boolean visible);
public void setImeWindowStatus(IBinder token, int vis, int backDisposition);
@@ -154,31 +152,24 @@ public class CommandQueue extends IStatusBar.Stub {
}
}
- public void animateExpandNotifications() {
+ public void animateExpandNotificationsPanel() {
synchronized (mList) {
mHandler.removeMessages(MSG_EXPAND_NOTIFICATIONS);
mHandler.sendEmptyMessage(MSG_EXPAND_NOTIFICATIONS);
}
}
- public void animateCollapseNotifications() {
+ public void animateCollapsePanels() {
synchronized (mList) {
- mHandler.removeMessages(MSG_COLLAPSE_NOTIFICATIONS);
- mHandler.sendEmptyMessage(MSG_COLLAPSE_NOTIFICATIONS);
+ mHandler.removeMessages(MSG_COLLAPSE_PANELS);
+ mHandler.sendEmptyMessage(MSG_COLLAPSE_PANELS);
}
}
- public void animateExpandQuickSettings() {
+ public void animateExpandSettingsPanel() {
synchronized (mList) {
- mHandler.removeMessages(MSG_EXPAND_QUICK_SETTINGS);
- mHandler.sendEmptyMessage(MSG_EXPAND_QUICK_SETTINGS);
- }
- }
-
- public void animateCollapseQuickSettings() {
- synchronized (mList) {
- mHandler.removeMessages(MSG_COLLAPSE_QUICK_SETTINGS);
- mHandler.sendEmptyMessage(MSG_COLLAPSE_QUICK_SETTINGS);
+ mHandler.removeMessages(MSG_EXPAND_SETTINGS);
+ mHandler.sendEmptyMessage(MSG_EXPAND_SETTINGS);
}
}
@@ -289,16 +280,13 @@ public class CommandQueue extends IStatusBar.Stub {
mCallbacks.disable(msg.arg1);
break;
case MSG_EXPAND_NOTIFICATIONS:
- mCallbacks.animateExpandNotifications();
- break;
- case MSG_COLLAPSE_NOTIFICATIONS:
- mCallbacks.animateCollapseNotifications(0);
+ mCallbacks.animateExpandNotificationsPanel();
break;
- case MSG_EXPAND_QUICK_SETTINGS:
- mCallbacks.animateExpandQuickSettings();
+ case MSG_COLLAPSE_PANELS:
+ mCallbacks.animateCollapsePanels(0);
break;
- case MSG_COLLAPSE_QUICK_SETTINGS:
- mCallbacks.animateCollapseQuickSettings();
+ case MSG_EXPAND_SETTINGS:
+ mCallbacks.animateExpandSettingsPanel();
break;
case MSG_SET_SYSTEMUI_VISIBILITY:
mCallbacks.setSystemUiVisibility(msg.arg1, msg.arg2);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CloseDragHandle.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CloseDragHandle.java
index ba64282..ee01489 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CloseDragHandle.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CloseDragHandle.java
@@ -36,7 +36,9 @@ public class CloseDragHandle extends LinearLayout {
*/
@Override
public boolean onTouchEvent(MotionEvent event) {
- if (event.getAction() != MotionEvent.ACTION_DOWN) {
+ if (event.getAction() == MotionEvent.ACTION_DOWN) {
+ setPressed(true);
+ } else {
mService.interceptTouchEvent(event);
}
return true;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index 9c978d5..c9ec481 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -21,19 +21,28 @@ import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
+import android.view.View;
+
import com.android.systemui.R;
public class NotificationPanelView extends PanelView {
Drawable mHandleBar;
float mHandleBarHeight;
+ View mHandleView;
public NotificationPanelView(Context context, AttributeSet attrs) {
super(context, attrs);
+ }
+
+ @Override
+ protected void onFinishInflate() {
+ super.onFinishInflate();
- Resources resources = context.getResources();
+ Resources resources = getContext().getResources();
mHandleBar = resources.getDrawable(R.drawable.status_bar_close);
mHandleBarHeight = resources.getDimension(R.dimen.close_handle_height);
+ mHandleView = findViewById(R.id.handle);
}
@Override
@@ -44,19 +53,24 @@ public class NotificationPanelView extends PanelView {
super.fling(vel, always);
}
+ // We draw the handle ourselves so that it's always glued to the bottom of the window.
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
if (changed) {
- mHandleBar.setBounds(0, 0, getWidth(), (int) mHandleBarHeight);
+ final int pl = getPaddingLeft();
+ final int pr = getPaddingRight();
+ mHandleBar.setBounds(pl, 0, getWidth() - pr, (int) mHandleBarHeight);
}
}
@Override
public void draw(Canvas canvas) {
super.draw(canvas);
- canvas.translate(0, getHeight() - mHandleBarHeight);
+ final int off = (int) (getHeight() - mHandleBarHeight - getPaddingBottom());
+ canvas.translate(0, off);
+ mHandleBar.setState(mHandleView.getDrawableState());
mHandleBar.draw(canvas);
- canvas.translate(0, -getHeight() + mHandleBarHeight);
+ canvas.translate(0, -off);
}
}
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 45a107d..d94dbe4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
@@ -220,6 +220,7 @@ public class PanelView extends FrameLayout {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
mTracking = true;
+ mHandleView.setPressed(true);
mInitialTouchY = y;
mVelocityTracker = VelocityTracker.obtain();
trackMovement(event);
@@ -239,6 +240,7 @@ public class PanelView extends FrameLayout {
case MotionEvent.ACTION_CANCEL:
mFinalTouchY = y;
mTracking = false;
+ mHandleView.setPressed(false);
mBar.onTrackingStopped(PanelView.this);
trackMovement(event);
mVelocityTracker.computeCurrentVelocity(1000);
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 d72632f..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;
@@ -104,7 +105,8 @@ public class PhoneStatusBar extends BaseStatusBar {
= "com.android.internal.policy.statusbar.START";
private static final int MSG_OPEN_NOTIFICATION_PANEL = 1000;
- private static final int MSG_CLOSE_NOTIFICATION_PANEL = 1001;
+ private static final int MSG_CLOSE_PANELS = 1001;
+ private static final int MSG_OPEN_SETTINGS_PANEL = 1002;
// 1020-1030 reserved for BaseStatusBar
// will likely move to a resource or other tunable param at some point
@@ -142,6 +144,7 @@ public class PhoneStatusBar extends BaseStatusBar {
int mIconSize = -1;
int mIconHPadding = -1;
Display mDisplay;
+ Point mCurrentDisplaySize = new Point();
IDreamManager mDreamManager;
@@ -168,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;
@@ -296,7 +298,7 @@ public class PhoneStatusBar extends BaseStatusBar {
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
if (mExpandedVisible && !mAnimating) {
- animateCollapseNotifications();
+ animateCollapsePanels();
}
}
return mStatusBarWindow.onTouchEvent(event);
@@ -778,7 +780,7 @@ public class PhoneStatusBar extends BaseStatusBar {
}
if (CLOSE_PANEL_WHEN_EMPTIED && mNotificationData.size() == 0 && !mAnimating) {
- animateCollapseNotifications();
+ animateCollapsePanels();
}
}
@@ -1051,7 +1053,7 @@ public class PhoneStatusBar extends BaseStatusBar {
}
if ((diff & StatusBarManager.DISABLE_EXPAND) != 0) {
if ((state & StatusBarManager.DISABLE_EXPAND) != 0) {
- animateCollapseNotifications();
+ animateCollapsePanels();
}
}
@@ -1111,10 +1113,13 @@ public class PhoneStatusBar extends BaseStatusBar {
super.handleMessage(m);
switch (m.what) {
case MSG_OPEN_NOTIFICATION_PANEL:
- animateExpandNotifications();
+ animateExpandNotificationsPanel();
break;
- case MSG_CLOSE_NOTIFICATION_PANEL:
- animateCollapseNotifications();
+ case MSG_OPEN_SETTINGS_PANEL:
+ animateExpandSettingsPanel();
+ break;
+ case MSG_CLOSE_PANELS:
+ animateCollapsePanels();
break;
case MSG_SHOW_INTRUDER:
setIntruderAlertVisibility(true);
@@ -1167,11 +1172,11 @@ public class PhoneStatusBar extends BaseStatusBar {
visibilityChanged(true);
}
- public void animateCollapseNotifications() {
- animateCollapseNotifications(CommandQueue.FLAG_EXCLUDE_NONE);
+ public void animateCollapsePanels() {
+ animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE);
}
- public void animateCollapseNotifications(int flags) {
+ public void animateCollapsePanels(int flags) {
if (SPEW) {
Slog.d(TAG, "animateCollapse():"
+ " mExpandedVisible=" + mExpandedVisible
@@ -1196,7 +1201,7 @@ public class PhoneStatusBar extends BaseStatusBar {
}
@Override
- public void animateExpandNotifications() {
+ public void animateExpandNotificationsPanel() {
if (SPEW) Slog.d(TAG, "animateExpand: mExpandedVisible=" + mExpandedVisible);
if ((mDisabled & StatusBarManager.DISABLE_EXPAND) != 0) {
return ;
@@ -1208,7 +1213,7 @@ public class PhoneStatusBar extends BaseStatusBar {
}
@Override
- public void animateExpandQuickSettings() {
+ public void animateExpandSettingsPanel() {
if (SPEW) Slog.d(TAG, "animateExpand: mExpandedVisible=" + mExpandedVisible);
if ((mDisabled & StatusBarManager.DISABLE_EXPAND) != 0) {
return;
@@ -1352,7 +1357,7 @@ public class PhoneStatusBar extends BaseStatusBar {
if (0 != (diff & View.SYSTEM_UI_FLAG_LOW_PROFILE)) {
final boolean lightsOut = (0 != (vis & View.SYSTEM_UI_FLAG_LOW_PROFILE));
if (lightsOut) {
- animateCollapseNotifications();
+ animateCollapsePanels();
if (mTicking) {
mTicker.halt();
}
@@ -1640,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;
@@ -1678,7 +1688,7 @@ public class PhoneStatusBar extends BaseStatusBar {
}
}
if (snapshot.isEmpty()) {
- animateCollapseNotifications(CommandQueue.FLAG_EXCLUDE_NONE);
+ animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE);
return;
}
new Thread(new Runnable() {
@@ -1729,7 +1739,7 @@ public class PhoneStatusBar extends BaseStatusBar {
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
- animateCollapseNotifications(CommandQueue.FLAG_EXCLUDE_NONE);
+ animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE);
}
}, totalDelay + 225);
}
@@ -1751,7 +1761,7 @@ public class PhoneStatusBar extends BaseStatusBar {
v.getContext().startActivityAsUser(new Intent(Settings.ACTION_SETTINGS)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK),
new UserHandle(UserHandle.USER_CURRENT));
- animateCollapseNotifications();
+ animateCollapsePanels();
}
};
@@ -1767,7 +1777,7 @@ public class PhoneStatusBar extends BaseStatusBar {
flags |= CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL;
}
}
- animateCollapseNotifications(flags);
+ animateCollapsePanels(flags);
}
else if (Intent.ACTION_SCREEN_OFF.equals(action)) {
// no waiting!
@@ -1777,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);
@@ -1792,7 +1804,7 @@ public class PhoneStatusBar extends BaseStatusBar {
@Override
public void userSwitched(int newUserId) {
if (MULTIUSER_DEBUG) mNotificationPanelDebugText.setText("USER " + newUserId);
- animateCollapseNotifications();
+ animateCollapsePanels();
updateNotificationIcons();
}
@@ -1885,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");
}
//
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
index 585793e..35b9f85 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
@@ -235,7 +235,7 @@ class QuickSettings {
}
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
mContext.startActivityAsUser(intent, new UserHandle(UserHandle.USER_CURRENT));
- getService().animateCollapseNotifications();
+ getService().animateCollapsePanels();
}
private void addUserTiles(ViewGroup parent, LayoutInflater inflater) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java
index 2ed450dd..f9d9dac0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java
@@ -20,6 +20,8 @@ import android.animation.LayoutTransition;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
+import android.graphics.Canvas;
+import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
@@ -37,6 +39,10 @@ public class SettingsPanelView extends PanelView {
private QuickSettings mQS;
private QuickSettingsContainerView mQSContainer;
+ Drawable mHandleBar;
+ float mHandleBarHeight;
+ View mHandleView;
+
public SettingsPanelView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@@ -47,6 +53,11 @@ public class SettingsPanelView extends PanelView {
mQSContainer = (QuickSettingsContainerView) findViewById(R.id.quick_settings_container);
mQS = new QuickSettings(getContext(), mQSContainer);
+
+ Resources resources = getContext().getResources();
+ mHandleBar = resources.getDrawable(R.drawable.status_bar_close);
+ mHandleBarHeight = resources.getDimension(R.dimen.close_handle_height);
+ mHandleView = findViewById(R.id.handle);
}
@Override
@@ -95,4 +106,25 @@ public class SettingsPanelView extends PanelView {
mQS.setService(phoneStatusBar);
}
}
+
+ // We draw the handle ourselves so that it's always glued to the bottom of the window.
+ @Override
+ protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+ super.onLayout(changed, left, top, right, bottom);
+ if (changed) {
+ final int pl = getPaddingLeft();
+ final int pr = getPaddingRight();
+ mHandleBar.setBounds(pl, 0, getWidth() - pr, (int) mHandleBarHeight);
+ }
+ }
+
+ @Override
+ public void draw(Canvas canvas) {
+ super.draw(canvas);
+ final int off = (int) (getHeight() - mHandleBarHeight - getPaddingBottom());
+ canvas.translate(0, off);
+ mHandleBar.setState(mHandleView.getDrawableState());
+ mHandleBar.draw(canvas);
+ canvas.translate(0, -off);
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
index 85b91d1..0176f42 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
@@ -70,7 +70,7 @@ public class StatusBarWindowView extends FrameLayout
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_BACK:
if (!down) {
- mService.animateCollapseNotifications();
+ mService.animateCollapsePanels();
}
return true;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
index 73d1c7c..b431287 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
@@ -204,14 +204,14 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
// We exclusively handle the back key by hiding this panel.
case KeyEvent.KEYCODE_BACK: {
if (event.getAction() == KeyEvent.ACTION_UP) {
- mBar.animateCollapseNotifications();
+ mBar.animateCollapsePanels();
}
return true;
}
// We react to the home key but let the system handle it.
case KeyEvent.KEYCODE_HOME: {
if (event.getAction() == KeyEvent.ACTION_UP) {
- mBar.animateCollapseNotifications();
+ mBar.animateCollapsePanels();
}
} break;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsView.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsView.java
index ab4ef75..194f1f6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsView.java
@@ -112,7 +112,7 @@ public class SettingsView extends LinearLayout implements View.OnClickListener {
private void onClickNetwork() {
getContext().startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
- getStatusBarManager().collapseNotifications();
+ getStatusBarManager().collapsePanels();
}
// Settings
@@ -121,7 +121,7 @@ public class SettingsView extends LinearLayout implements View.OnClickListener {
getContext().startActivityAsUser(new Intent(Settings.ACTION_SETTINGS)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK),
new UserHandle(UserHandle.USER_CURRENT));
- getStatusBarManager().collapseNotifications();
+ getStatusBarManager().collapsePanels();
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index d1dd3c7..97451ae 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -740,7 +740,7 @@ public class TabletStatusBar extends BaseStatusBar implements
SharedPreferences.Editor editor = Prefs.edit(mContext);
editor.putBoolean(Prefs.DO_NOT_DISTURB_PREF, false);
editor.apply();
- animateCollapseNotifications();
+ animateCollapsePanels();
visibilityChanged(false);
}
});
@@ -821,7 +821,7 @@ public class TabletStatusBar extends BaseStatusBar implements
break;
case MSG_HIDE_CHROME:
if (DEBUG) Slog.d(TAG, "showing shadows (lights out)");
- animateCollapseNotifications();
+ animateCollapsePanels();
visibilityChanged(false);
mBarContents.setVisibility(View.GONE);
mShadow.setVisibility(View.VISIBLE);
@@ -907,7 +907,7 @@ public class TabletStatusBar extends BaseStatusBar implements
if ((diff & StatusBarManager.DISABLE_EXPAND) != 0) {
if ((state & StatusBarManager.DISABLE_EXPAND) != 0) {
Slog.i(TAG, "DISABLE_EXPAND: yes");
- animateCollapseNotifications();
+ animateCollapsePanels();
visibilityChanged(false);
}
}
@@ -988,16 +988,16 @@ public class TabletStatusBar extends BaseStatusBar implements
mFeedbackIconArea.setVisibility(View.VISIBLE);
}
- public void animateExpandNotifications() {
+ public void animateExpandNotificationsPanel() {
mHandler.removeMessages(MSG_OPEN_NOTIFICATION_PANEL);
mHandler.sendEmptyMessage(MSG_OPEN_NOTIFICATION_PANEL);
}
- public void animateCollapseNotifications() {
- animateCollapseNotifications(CommandQueue.FLAG_EXCLUDE_NONE);
+ public void animateCollapsePanels() {
+ animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE);
}
- public void animateCollapseNotifications(int flags) {
+ public void animateCollapsePanels(int flags) {
if ((flags & CommandQueue.FLAG_EXCLUDE_NOTIFICATION_PANEL) == 0) {
mHandler.removeMessages(MSG_CLOSE_NOTIFICATION_PANEL);
mHandler.sendEmptyMessage(MSG_CLOSE_NOTIFICATION_PANEL);
@@ -1022,12 +1022,7 @@ public class TabletStatusBar extends BaseStatusBar implements
}
@Override
- public void animateExpandQuickSettings() {
- // TODO: Implement when TabletStatusBar begins to be used.
- }
-
- @Override
- public void animateCollapseQuickSettings() {
+ public void animateExpandSettingsPanel() {
// TODO: Implement when TabletStatusBar begins to be used.
}
@@ -1299,7 +1294,7 @@ public class TabletStatusBar extends BaseStatusBar implements
mVT.computeCurrentVelocity(1000); // pixels per second
// require a little more oomph once we're already in peekaboo mode
if (mVT.getYVelocity() < -mNotificationFlingVelocity) {
- animateExpandNotifications();
+ animateExpandNotificationsPanel();
visibilityChanged(true);
hilite(false);
mVT.recycle();
@@ -1317,7 +1312,7 @@ public class TabletStatusBar extends BaseStatusBar implements
&& Math.abs(event.getY() - mInitialTouchY) < (mTouchSlop / 3)
// dragging off the bottom doesn't count
&& (int)event.getY() < v.getBottom()) {
- animateExpandNotifications();
+ animateExpandNotificationsPanel();
visibilityChanged(true);
v.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
v.playSoundEffect(SoundEffectConstants.CLICK);
@@ -1493,7 +1488,7 @@ public class TabletStatusBar extends BaseStatusBar implements
} catch (RemoteException ex) {
// system process is dead if we're here.
}
- animateCollapseNotifications();
+ animateCollapsePanels();
visibilityChanged(false);
}
@@ -1509,7 +1504,7 @@ public class TabletStatusBar extends BaseStatusBar implements
flags |= CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL;
}
}
- animateCollapseNotifications(flags);
+ animateCollapsePanels(flags);
}
}
};
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java
index fd2ee38..519d3c1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java
@@ -61,11 +61,11 @@ public class TvStatusBar extends BaseStatusBar {
}
@Override
- public void animateExpandNotifications() {
+ public void animateExpandNotificationsPanel() {
}
@Override
- public void animateCollapseNotifications(int flags) {
+ public void animateCollapsePanels(int flags) {
}
@Override
@@ -143,10 +143,6 @@ public class TvStatusBar extends BaseStatusBar {
}
@Override
- public void animateExpandQuickSettings() {
- }
-
- @Override
- public void animateCollapseQuickSettings() {
+ public void animateExpandSettingsPanel() {
}
}