Loading packages/SystemUI/res/layout-sw600dp/status_bar_notification_area.xml +4 −9 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ android:layout_height="match_parent" android:layout_alignParentRight="true" android:orientation="horizontal" android:background="?android:attr/listChoiceBackgroundIndicator" android:clickable="true" > <LinearLayout Loading Loading @@ -65,14 +67,7 @@ android:layout_height="match_parent" android:layout_gravity="center_vertical" android:layout_marginLeft="8dp" /> <View android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignLeft="@id/icons" android:layout_alignRight="@id/icons" android:background="@drawable/notification_icon_area_smoke" android:clickable="false" android:alpha="0.4" /> </com.android.systemui.statusbar.tablet.NotificationIconArea> </LinearLayout> Loading @@ -88,7 +83,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="3dip" android:layout_marginLeft="4dip" android:layout_marginLeft="8dip" android:layout_marginRight="4dip" > <TextView android:id="@+id/time_solid" Loading packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +83 −50 Original line number Diff line number Diff line Loading @@ -103,6 +103,11 @@ public class TabletStatusBar extends StatusBar implements // Fitts' Law assistance for LatinIME; see policy.EventHole private static final boolean FAKE_SPACE_BAR = true; // Notification "peeking" (flyover preview of individual notifications) final static boolean NOTIFICATION_PEEK_ENABLED = false; final static int NOTIFICATION_PEEK_HOLD_THRESH = 200; // ms final static int NOTIFICATION_PEEK_FADE_DELAY = 3000; // ms // The height of the bar, as definied by the build. It may be taller if we're plugged // into hdmi. int mNaturalBarHeight = -1; Loading Loading @@ -250,6 +255,7 @@ public class TabletStatusBar extends StatusBar implements WindowManagerImpl.getDefault().addView(mNotificationPanel, lp); // Notification preview window if (NOTIFICATION_PEEK_ENABLED) { mNotificationPeekWindow = (NotificationPeekPanel) View.inflate(context, R.layout.status_bar_notification_peek, null); mNotificationPeekWindow.setBar(this); Loading Loading @@ -287,6 +293,7 @@ public class TabletStatusBar extends StatusBar implements lp.windowAnimations = com.android.internal.R.style.Animation_Toast; WindowManagerImpl.getDefault().addView(mNotificationPeekWindow, lp); } // Recents Panel mRecentsPanel = (RecentsPanelView) View.inflate(context, Loading Loading @@ -444,17 +451,24 @@ public class TabletStatusBar extends StatusBar implements // the whole right-hand side of the bar mNotificationArea = sb.findViewById(R.id.notificationArea); if (!NOTIFICATION_PEEK_ENABLED) { mNotificationArea.setOnTouchListener(new NotificationTriggerTouchListener()); } // the button to open the notification area mNotificationTrigger = sb.findViewById(R.id.notificationTrigger); if (NOTIFICATION_PEEK_ENABLED) { mNotificationTrigger.setOnTouchListener(new NotificationTriggerTouchListener()); } // the more notifications icon mNotificationIconArea = (NotificationIconArea)sb.findViewById(R.id.notificationIcons); // where the icons go mIconLayout = (NotificationIconArea.IconLayout) sb.findViewById(R.id.icons); if (NOTIFICATION_PEEK_ENABLED) { mIconLayout.setOnTouchListener(new NotificationIconTouchListener()); } ViewConfiguration vc = ViewConfiguration.get(context); mNotificationPeekTapDuration = vc.getTapTimeout(); Loading Loading @@ -684,7 +698,9 @@ public class TabletStatusBar extends StatusBar implements case MSG_OPEN_NOTIFICATION_PANEL: if (DEBUG) Slog.d(TAG, "opening notifications panel"); if (!mNotificationPanel.isShowing()) { if (NOTIFICATION_PEEK_ENABLED) { mNotificationPeekWindow.setVisibility(View.GONE); } mNotificationPanel.show(true, true); mNotificationArea.setVisibility(View.INVISIBLE); mTicker.halt(); Loading Loading @@ -863,7 +879,7 @@ public class TabletStatusBar extends StatusBar implements oldEntry.largeIcon.setVisibility(View.INVISIBLE); } if (key == mNotificationPeekKey) { if (NOTIFICATION_PEEK_ENABLED && key == mNotificationPeekKey) { // must update the peek window Message peekMsg = mHandler.obtainMessage(MSG_OPEN_NOTIFICATION_PEEK); peekMsg.arg1 = mNotificationPeekIndex; Loading Loading @@ -1010,9 +1026,11 @@ public class TabletStatusBar extends StatusBar implements } public void animateExpand() { if (NOTIFICATION_PEEK_ENABLED) { mHandler.removeMessages(MSG_CLOSE_NOTIFICATION_PEEK); mHandler.removeMessages(MSG_OPEN_NOTIFICATION_PEEK); mHandler.sendEmptyMessage(MSG_CLOSE_NOTIFICATION_PEEK); } mHandler.removeMessages(MSG_OPEN_NOTIFICATION_PANEL); mHandler.sendEmptyMessage(MSG_OPEN_NOTIFICATION_PANEL); } Loading @@ -1026,9 +1044,11 @@ public class TabletStatusBar extends StatusBar implements mHandler.sendEmptyMessage(MSG_CLOSE_INPUT_METHODS_PANEL); mHandler.removeMessages(MSG_CLOSE_COMPAT_MODE_PANEL); mHandler.sendEmptyMessage(MSG_CLOSE_COMPAT_MODE_PANEL); if (NOTIFICATION_PEEK_ENABLED) { mHandler.removeMessages(MSG_CLOSE_NOTIFICATION_PEEK); mHandler.sendEmptyMessage(MSG_CLOSE_NOTIFICATION_PEEK); } } private void notifyUiVisibilityChanged() { try { Loading Loading @@ -1328,7 +1348,7 @@ public class TabletStatusBar extends StatusBar implements ViewGroup rowParent = (ViewGroup)entry.row.getParent(); if (rowParent != null) rowParent.removeView(entry.row); if (key == mNotificationPeekKey) { if (NOTIFICATION_PEEK_ENABLED && key == mNotificationPeekKey) { // must close the peek as well, since it's gone mHandler.sendEmptyMessage(MSG_CLOSE_NOTIFICATION_PEEK); } Loading @@ -1349,6 +1369,19 @@ public class TabletStatusBar extends StatusBar implements mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop(); } private Runnable mHiliteOnR = new Runnable() { public void run() { mNotificationArea.setBackgroundResource( com.android.internal.R.drawable.list_selector_pressed_holo_dark); }}; public void hilite(final boolean on) { if (on) { mNotificationArea.postDelayed(mHiliteOnR, 100); } else { mNotificationArea.removeCallbacks(mHiliteOnR); mNotificationArea.setBackgroundDrawable(null); } } public boolean onTouch(View v, MotionEvent event) { // Slog.d(TAG, String.format("touch: (%.1f, %.1f) initial: (%.1f, %.1f)", // event.getX(), Loading @@ -1361,6 +1394,7 @@ public class TabletStatusBar extends StatusBar implements mVT = VelocityTracker.obtain(); mInitialTouchX = event.getX(); mInitialTouchY = event.getY(); hilite(true); // fall through case MotionEvent.ACTION_OUTSIDE: case MotionEvent.ACTION_MOVE: Loading @@ -1371,6 +1405,7 @@ public class TabletStatusBar extends StatusBar implements // require a little more oomph once we're already in peekaboo mode if (mVT.getYVelocity() < -mNotificationFlingVelocity) { animateExpand(); hilite(false); mVT.recycle(); mVT = null; } Loading @@ -1378,6 +1413,7 @@ public class TabletStatusBar extends StatusBar implements return true; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: hilite(false); if (mVT != null) { if (action == MotionEvent.ACTION_UP // was this a sloppy tap? Loading @@ -1399,9 +1435,6 @@ public class TabletStatusBar extends StatusBar implements } } final static int NOTIFICATION_PEEK_HOLD_THRESH = 200; // ms final static int NOTIFICATION_PEEK_FADE_DELAY = 3000; // ms public void resetNotificationPeekFadeTimer() { if (DEBUG) { Slog.d(TAG, "setting peek fade timer for " + NOTIFICATION_PEEK_FADE_DELAY Loading Loading
packages/SystemUI/res/layout-sw600dp/status_bar_notification_area.xml +4 −9 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ android:layout_height="match_parent" android:layout_alignParentRight="true" android:orientation="horizontal" android:background="?android:attr/listChoiceBackgroundIndicator" android:clickable="true" > <LinearLayout Loading Loading @@ -65,14 +67,7 @@ android:layout_height="match_parent" android:layout_gravity="center_vertical" android:layout_marginLeft="8dp" /> <View android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignLeft="@id/icons" android:layout_alignRight="@id/icons" android:background="@drawable/notification_icon_area_smoke" android:clickable="false" android:alpha="0.4" /> </com.android.systemui.statusbar.tablet.NotificationIconArea> </LinearLayout> Loading @@ -88,7 +83,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="3dip" android:layout_marginLeft="4dip" android:layout_marginLeft="8dip" android:layout_marginRight="4dip" > <TextView android:id="@+id/time_solid" Loading
packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +83 −50 Original line number Diff line number Diff line Loading @@ -103,6 +103,11 @@ public class TabletStatusBar extends StatusBar implements // Fitts' Law assistance for LatinIME; see policy.EventHole private static final boolean FAKE_SPACE_BAR = true; // Notification "peeking" (flyover preview of individual notifications) final static boolean NOTIFICATION_PEEK_ENABLED = false; final static int NOTIFICATION_PEEK_HOLD_THRESH = 200; // ms final static int NOTIFICATION_PEEK_FADE_DELAY = 3000; // ms // The height of the bar, as definied by the build. It may be taller if we're plugged // into hdmi. int mNaturalBarHeight = -1; Loading Loading @@ -250,6 +255,7 @@ public class TabletStatusBar extends StatusBar implements WindowManagerImpl.getDefault().addView(mNotificationPanel, lp); // Notification preview window if (NOTIFICATION_PEEK_ENABLED) { mNotificationPeekWindow = (NotificationPeekPanel) View.inflate(context, R.layout.status_bar_notification_peek, null); mNotificationPeekWindow.setBar(this); Loading Loading @@ -287,6 +293,7 @@ public class TabletStatusBar extends StatusBar implements lp.windowAnimations = com.android.internal.R.style.Animation_Toast; WindowManagerImpl.getDefault().addView(mNotificationPeekWindow, lp); } // Recents Panel mRecentsPanel = (RecentsPanelView) View.inflate(context, Loading Loading @@ -444,17 +451,24 @@ public class TabletStatusBar extends StatusBar implements // the whole right-hand side of the bar mNotificationArea = sb.findViewById(R.id.notificationArea); if (!NOTIFICATION_PEEK_ENABLED) { mNotificationArea.setOnTouchListener(new NotificationTriggerTouchListener()); } // the button to open the notification area mNotificationTrigger = sb.findViewById(R.id.notificationTrigger); if (NOTIFICATION_PEEK_ENABLED) { mNotificationTrigger.setOnTouchListener(new NotificationTriggerTouchListener()); } // the more notifications icon mNotificationIconArea = (NotificationIconArea)sb.findViewById(R.id.notificationIcons); // where the icons go mIconLayout = (NotificationIconArea.IconLayout) sb.findViewById(R.id.icons); if (NOTIFICATION_PEEK_ENABLED) { mIconLayout.setOnTouchListener(new NotificationIconTouchListener()); } ViewConfiguration vc = ViewConfiguration.get(context); mNotificationPeekTapDuration = vc.getTapTimeout(); Loading Loading @@ -684,7 +698,9 @@ public class TabletStatusBar extends StatusBar implements case MSG_OPEN_NOTIFICATION_PANEL: if (DEBUG) Slog.d(TAG, "opening notifications panel"); if (!mNotificationPanel.isShowing()) { if (NOTIFICATION_PEEK_ENABLED) { mNotificationPeekWindow.setVisibility(View.GONE); } mNotificationPanel.show(true, true); mNotificationArea.setVisibility(View.INVISIBLE); mTicker.halt(); Loading Loading @@ -863,7 +879,7 @@ public class TabletStatusBar extends StatusBar implements oldEntry.largeIcon.setVisibility(View.INVISIBLE); } if (key == mNotificationPeekKey) { if (NOTIFICATION_PEEK_ENABLED && key == mNotificationPeekKey) { // must update the peek window Message peekMsg = mHandler.obtainMessage(MSG_OPEN_NOTIFICATION_PEEK); peekMsg.arg1 = mNotificationPeekIndex; Loading Loading @@ -1010,9 +1026,11 @@ public class TabletStatusBar extends StatusBar implements } public void animateExpand() { if (NOTIFICATION_PEEK_ENABLED) { mHandler.removeMessages(MSG_CLOSE_NOTIFICATION_PEEK); mHandler.removeMessages(MSG_OPEN_NOTIFICATION_PEEK); mHandler.sendEmptyMessage(MSG_CLOSE_NOTIFICATION_PEEK); } mHandler.removeMessages(MSG_OPEN_NOTIFICATION_PANEL); mHandler.sendEmptyMessage(MSG_OPEN_NOTIFICATION_PANEL); } Loading @@ -1026,9 +1044,11 @@ public class TabletStatusBar extends StatusBar implements mHandler.sendEmptyMessage(MSG_CLOSE_INPUT_METHODS_PANEL); mHandler.removeMessages(MSG_CLOSE_COMPAT_MODE_PANEL); mHandler.sendEmptyMessage(MSG_CLOSE_COMPAT_MODE_PANEL); if (NOTIFICATION_PEEK_ENABLED) { mHandler.removeMessages(MSG_CLOSE_NOTIFICATION_PEEK); mHandler.sendEmptyMessage(MSG_CLOSE_NOTIFICATION_PEEK); } } private void notifyUiVisibilityChanged() { try { Loading Loading @@ -1328,7 +1348,7 @@ public class TabletStatusBar extends StatusBar implements ViewGroup rowParent = (ViewGroup)entry.row.getParent(); if (rowParent != null) rowParent.removeView(entry.row); if (key == mNotificationPeekKey) { if (NOTIFICATION_PEEK_ENABLED && key == mNotificationPeekKey) { // must close the peek as well, since it's gone mHandler.sendEmptyMessage(MSG_CLOSE_NOTIFICATION_PEEK); } Loading @@ -1349,6 +1369,19 @@ public class TabletStatusBar extends StatusBar implements mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop(); } private Runnable mHiliteOnR = new Runnable() { public void run() { mNotificationArea.setBackgroundResource( com.android.internal.R.drawable.list_selector_pressed_holo_dark); }}; public void hilite(final boolean on) { if (on) { mNotificationArea.postDelayed(mHiliteOnR, 100); } else { mNotificationArea.removeCallbacks(mHiliteOnR); mNotificationArea.setBackgroundDrawable(null); } } public boolean onTouch(View v, MotionEvent event) { // Slog.d(TAG, String.format("touch: (%.1f, %.1f) initial: (%.1f, %.1f)", // event.getX(), Loading @@ -1361,6 +1394,7 @@ public class TabletStatusBar extends StatusBar implements mVT = VelocityTracker.obtain(); mInitialTouchX = event.getX(); mInitialTouchY = event.getY(); hilite(true); // fall through case MotionEvent.ACTION_OUTSIDE: case MotionEvent.ACTION_MOVE: Loading @@ -1371,6 +1405,7 @@ public class TabletStatusBar extends StatusBar implements // require a little more oomph once we're already in peekaboo mode if (mVT.getYVelocity() < -mNotificationFlingVelocity) { animateExpand(); hilite(false); mVT.recycle(); mVT = null; } Loading @@ -1378,6 +1413,7 @@ public class TabletStatusBar extends StatusBar implements return true; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: hilite(false); if (mVT != null) { if (action == MotionEvent.ACTION_UP // was this a sloppy tap? Loading @@ -1399,9 +1435,6 @@ public class TabletStatusBar extends StatusBar implements } } final static int NOTIFICATION_PEEK_HOLD_THRESH = 200; // ms final static int NOTIFICATION_PEEK_FADE_DELAY = 3000; // ms public void resetNotificationPeekFadeTimer() { if (DEBUG) { Slog.d(TAG, "setting peek fade timer for " + NOTIFICATION_PEEK_FADE_DELAY Loading