diff options
14 files changed, 268 insertions, 29 deletions
diff --git a/packages/SystemUI/res/drawable/dots_empty.png b/packages/SystemUI/res/drawable/dots_empty.png Binary files differnew file mode 100644 index 0000000..22ada41 --- /dev/null +++ b/packages/SystemUI/res/drawable/dots_empty.png diff --git a/packages/SystemUI/res/drawable/dots_full.png b/packages/SystemUI/res/drawable/dots_full.png Binary files differnew file mode 100644 index 0000000..2a346d6 --- /dev/null +++ b/packages/SystemUI/res/drawable/dots_full.png diff --git a/packages/SystemUI/res/drawable/status_bar_back_default.png b/packages/SystemUI/res/drawable/status_bar_back_default.png Binary files differindex e6648f7..dd64746 100644 --- a/packages/SystemUI/res/drawable/status_bar_back_default.png +++ b/packages/SystemUI/res/drawable/status_bar_back_default.png diff --git a/packages/SystemUI/res/drawable/status_bar_back_pressed.png b/packages/SystemUI/res/drawable/status_bar_back_pressed.png Binary files differindex beda981..66a3677 100644 --- a/packages/SystemUI/res/drawable/status_bar_back_pressed.png +++ b/packages/SystemUI/res/drawable/status_bar_back_pressed.png diff --git a/packages/SystemUI/res/drawable/status_bar_home_default.png b/packages/SystemUI/res/drawable/status_bar_home_default.png Binary files differindex ccfcb95..b129210 100644 --- a/packages/SystemUI/res/drawable/status_bar_home_default.png +++ b/packages/SystemUI/res/drawable/status_bar_home_default.png diff --git a/packages/SystemUI/res/drawable/status_bar_home_pressed.png b/packages/SystemUI/res/drawable/status_bar_home_pressed.png Binary files differindex c81c1fb..dcb2447 100644 --- a/packages/SystemUI/res/drawable/status_bar_home_pressed.png +++ b/packages/SystemUI/res/drawable/status_bar_home_pressed.png diff --git a/packages/SystemUI/res/drawable/status_bar_icon_tray.9.png b/packages/SystemUI/res/drawable/status_bar_icon_tray.9.png Binary files differnew file mode 100644 index 0000000..a39f743 --- /dev/null +++ b/packages/SystemUI/res/drawable/status_bar_icon_tray.9.png diff --git a/packages/SystemUI/res/drawable/status_bar_menu_default.png b/packages/SystemUI/res/drawable/status_bar_menu_default.png Binary files differindex 2499d3e..bf3a755 100644 --- a/packages/SystemUI/res/drawable/status_bar_menu_default.png +++ b/packages/SystemUI/res/drawable/status_bar_menu_default.png diff --git a/packages/SystemUI/res/drawable/status_bar_menu_pressed.png b/packages/SystemUI/res/drawable/status_bar_menu_pressed.png Binary files differindex 33344d0..15e21d73 100644 --- a/packages/SystemUI/res/drawable/status_bar_menu_pressed.png +++ b/packages/SystemUI/res/drawable/status_bar_menu_pressed.png diff --git a/packages/SystemUI/res/layout-xlarge/status_bar.xml b/packages/SystemUI/res/layout-xlarge/status_bar.xml index d8a373e..4d82d84 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar.xml @@ -19,20 +19,14 @@ --> <!-- android:background="@drawable/status_bar_closed_default_background" --> -<FrameLayout +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:background="@drawable/status_bar_background" - android:orientation="vertical" android:focusable="true" android:descendantFocusability="afterDescendants" > - <RelativeLayout android:id="@+id/notifications" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="horizontal"> - <!-- <LinearLayout android:id="@+id/statusIcons" android:layout_width="wrap_content" @@ -48,10 +42,12 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_alignParentLeft="true" - android:layout_marginLeft="10dp" android:paddingLeft="6dip" android:gravity="center_vertical" android:orientation="horizontal" + android:clickable="true" + android:onClick="notificationIconsClicked" + android:background="@drawable/status_bar_icon_tray" > <view class="com.android.systemui.statusbar.tablet.NotificationIconArea$MoreView" @@ -59,66 +55,87 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:src="@drawable/stat_notify_more" + android:layout_marginLeft="10dip" /> <view class="com.android.systemui.statusbar.tablet.NotificationIconArea$IconLayout" android:id="@+id/icons" android:layout_width="wrap_content" android:layout_height="match_parent" + android:layout_marginLeft="8dip" /> <view class="com.android.systemui.statusbar.tablet.NotificationIconArea$DraggerView" android:id="@+id/handle" - android:layout_width="wrap_content" + android:layout_width="24dip" android:layout_height="match_parent" - android:src="@drawable/notification_dragger" + android:layout_marginLeft="8dip" /> - + </com.android.systemui.statusbar.tablet.NotificationIconArea> - + <RelativeLayout android:id="@+id/systemInfo" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerInParent="true" + android:layout_width="200dip" + android:layout_height="match_parent" + android:layout_centerHorizontal="true" + android:clickable="true" + android:onClick="systemInfoClicked" > - <com.android.systemui.statusbar.Clock + android:id="@+id/clock" android:textAppearance="@*android:style/TextAppearance.StatusBar.Icon" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_centerHorizontal="true" + android:layout_centerInParent="true" android:singleLine="true" android:textSize="16sp" android:textStyle="bold" + android:padding="6dip" + /> + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_toLeftOf="@id/clock" + android:layout_centerVertical="true" + android:src="@drawable/dots_empty" + /> + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_toRightOf="@id/clock" + android:layout_centerVertical="true" + android:src="@drawable/dots_full" /> </RelativeLayout> <com.android.systemui.statusbar.KeyButtonView android:id="@+id/back" android:layout_width="wrap_content" - android:layout_height="@*android:dimen/status_bar_height" + android:layout_height="match_parent" android:layout_toLeftOf="@+id/menu" - android:layout_marginRight="10dp" + android:paddingLeft="4dip" + android:paddingRight="4dip" android:src="@drawable/status_bar_back" systemui:keyCode="4" /> <com.android.systemui.statusbar.KeyButtonView android:id="@+id/menu" android:layout_width="wrap_content" - android:layout_height="@*android:dimen/status_bar_height" + android:layout_height="match_parent" android:layout_toLeftOf="@+id/home" android:src="@drawable/status_bar_menu" - android:layout_marginRight="10dp" + android:paddingLeft="4dip" + android:paddingRight="4dip" systemui:keyCode="82" /> <com.android.systemui.statusbar.KeyButtonView android:id="@+id/home" android:layout_width="wrap_content" - android:layout_height="@*android:dimen/status_bar_height" + android:layout_height="match_parent" android:layout_alignParentRight="true" - android:layout_marginRight="10dp" + android:paddingLeft="4dip" + android:paddingRight="4dip" android:src="@drawable/status_bar_home" systemui:keyCode="3" /> - </RelativeLayout> <!-- <LinearLayout android:id="@+id/ticker" @@ -173,5 +190,5 @@ android:background="@drawable/status_bar_background" /> --> -</FrameLayout> +</RelativeLayout> diff --git a/packages/SystemUI/res/layout-xlarge/sysbar_panel_notifications.xml b/packages/SystemUI/res/layout-xlarge/sysbar_panel_notifications.xml new file mode 100644 index 0000000..4a34f03 --- /dev/null +++ b/packages/SystemUI/res/layout-xlarge/sysbar_panel_notifications.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* apps/common/assets/default/default/skins/StatusBar.xml +** +** Copyright 2006, 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. +*/ +--> + +<!-- android:background="@drawable/status_bar_closed_default_background" --> +<FrameLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:paddingLeft="8dip" + android:paddingRight="8dip" + > + + <LinearLayout + android:id="@+id/content" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center_horizontal|bottom" + android:animationCache="false" + android:orientation="vertical" + android:background="@drawable/status_bar_background" + android:clickable="true" + android:focusable="true" + android:descendantFocusability="afterDescendants" + > + <TextView + android:id="@+id/notificationPanelDummy" + android:layout_width="wrap_content" + android:layout_height="75dip" + android:layout_centerInParent="true" + android:gravity="center" + android:textColor="#FFCCCCCC" + android:textSize="18sp" + android:padding="4dip" + /> + </LinearLayout> +</FrameLayout> diff --git a/packages/SystemUI/res/layout-xlarge/sysbar_panel_system.xml b/packages/SystemUI/res/layout-xlarge/sysbar_panel_system.xml new file mode 100644 index 0000000..2222d08 --- /dev/null +++ b/packages/SystemUI/res/layout-xlarge/sysbar_panel_system.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* apps/common/assets/default/default/skins/StatusBar.xml +** +** Copyright 2006, 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. +*/ +--> + +<!-- android:background="@drawable/status_bar_closed_default_background" --> +<FrameLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_height="300dip" + android:layout_width="400dip" + android:paddingLeft="8dip" + android:paddingRight="8dip" + android:background="#FF000000" + > + + <RelativeLayout + android:id="@+id/content" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:animationCache="false" + android:background="@drawable/status_bar_background" + android:clickable="true" + android:focusable="true" + android:descendantFocusability="afterDescendants" + > + + <TextView + android:id="@+id/systemPanelDummy" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerInParent="true" + android:textColor="#FFCCCCCC" + android:textSize="18sp" + /> + + </RelativeLayout> +</FrameLayout> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationIconArea.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationIconArea.java index 370ee57..3c7b130 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationIconArea.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationIconArea.java @@ -55,7 +55,7 @@ public class NotificationIconArea extends LinearLayout { } } - static class DraggerView extends ImageView { + static class DraggerView extends View { public DraggerView(Context context, AttributeSet attrs) { super(context, attrs); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java index 24d3c39..3500729 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java @@ -20,10 +20,18 @@ import android.app.Service; import android.content.Context; import android.content.Intent; import android.content.res.Resources; +import android.graphics.PixelFormat; +import android.os.Handler; +import android.os.Message; import android.os.IBinder; import android.view.Gravity; import android.view.View; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.view.WindowManagerImpl; import android.widget.LinearLayout; +import android.widget.TextView; +import android.util.Slog; import com.android.internal.statusbar.StatusBarIcon; import com.android.internal.statusbar.StatusBarIconList; @@ -33,16 +41,76 @@ import com.android.systemui.statusbar.*; import com.android.systemui.R; public class TabletStatusBarService extends StatusBarService { + public static final boolean DEBUG = false; + public static final String TAG = "TabletStatusBar"; View mStatusBarView; NotificationIconArea mNotificationIconArea; int mIconSize; + + H mHandler = new H(); + + private View mNotificationPanel; + private View mSystemPanel; + protected void addPanelWindows() { + if (mNotificationPanel == null) { + mNotificationPanel = View.inflate(this, R.layout.sysbar_panel_notifications, null); + mSystemPanel = View.inflate(this, R.layout.sysbar_panel_system, null); + } + + mNotificationPanel.setVisibility(View.GONE); + mSystemPanel.setVisibility(View.GONE); + + final Resources res = getResources(); + final int barHeight= res.getDimensionPixelSize( + com.android.internal.R.dimen.status_bar_height); + + WindowManager.LayoutParams lp = new WindowManager.LayoutParams( + 300, // ViewGroup.LayoutParams.WRAP_CONTENT, + ViewGroup.LayoutParams.WRAP_CONTENT, + WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL, + WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN + | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS + | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL + | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE + | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM, + PixelFormat.TRANSLUCENT); + lp.gravity = Gravity.BOTTOM | Gravity.LEFT; + lp.setTitle("NotificationPanel"); + lp.windowAnimations = com.android.internal.R.style.Animation_SlidingCard; + + WindowManagerImpl.getDefault().addView(mNotificationPanel, lp); + + lp = new WindowManager.LayoutParams( + 400, // ViewGroup.LayoutParams.WRAP_CONTENT, + 200, // ViewGroup.LayoutParams.WRAP_CONTENT, + WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL, + WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN + | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS + | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL + | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE + | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM, + PixelFormat.TRANSLUCENT); + lp.gravity = Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL; + lp.setTitle("SystemPanel"); + lp.windowAnimations = com.android.internal.R.style.Animation_SlidingCard; + + WindowManagerImpl.getDefault().addView(mSystemPanel, lp); + + // Lorem ipsum, Dolores + TextView tv = ((TextView) mNotificationPanel.findViewById(R.id.notificationPanelDummy)); + if (tv != null) tv.setText("(You probably have new email)"); + tv = ((TextView) mSystemPanel.findViewById(R.id.systemPanelDummy)); + if (tv != null) tv.setText("System status: great"); + } @Override public void onCreate() { - super.onCreate(); + super.onCreate(); // will add the main bar view + + addPanelWindows(); } protected View makeStatusBarView() { @@ -63,6 +131,33 @@ public class TabletStatusBarService extends StatusBarService { return Gravity.BOTTOM | Gravity.FILL_HORIZONTAL; } + private class H extends Handler { + public static final int MSG_OPEN_NOTIFICATION_PANEL = 1000; + public static final int MSG_CLOSE_NOTIFICATION_PANEL = 1001; + public static final int MSG_OPEN_SYSTEM_PANEL = 1010; + public static final int MSG_CLOSE_SYSTEM_PANEL = 1011; + public void handleMessage(Message m) { + switch (m.what) { + case MSG_OPEN_NOTIFICATION_PANEL: + if (DEBUG) Slog.d(TAG, "opening notifications panel"); + mNotificationPanel.setVisibility(View.VISIBLE); + break; + case MSG_CLOSE_NOTIFICATION_PANEL: + if (DEBUG) Slog.d(TAG, "closing notifications panel"); + mNotificationPanel.setVisibility(View.GONE); + break; + case MSG_OPEN_SYSTEM_PANEL: + if (DEBUG) Slog.d(TAG, "opening system panel"); + mSystemPanel.setVisibility(View.VISIBLE); + break; + case MSG_CLOSE_SYSTEM_PANEL: + if (DEBUG) Slog.d(TAG, "closing system panel"); + mSystemPanel.setVisibility(View.GONE); + break; + } + } + } + public void addIcon(String slot, int index, int viewIndex, StatusBarIcon icon) { // TODO } @@ -93,10 +188,32 @@ public class TabletStatusBarService extends StatusBarService { } public void animateExpand() { - // TODO + mHandler.removeMessages(H.MSG_OPEN_NOTIFICATION_PANEL); + mHandler.sendEmptyMessage(H.MSG_OPEN_NOTIFICATION_PANEL); } public void animateCollapse() { - // TODO + mHandler.removeMessages(H.MSG_CLOSE_NOTIFICATION_PANEL); + mHandler.sendEmptyMessage(H.MSG_CLOSE_NOTIFICATION_PANEL); + mHandler.removeMessages(H.MSG_CLOSE_SYSTEM_PANEL); + mHandler.sendEmptyMessage(H.MSG_CLOSE_SYSTEM_PANEL); + } + + public void notificationIconsClicked(View v) { + if (DEBUG) Slog.d(TAG, "clicked notification icons"); + int msg = (mNotificationPanel.getVisibility() == View.GONE) + ? H.MSG_OPEN_NOTIFICATION_PANEL + : H.MSG_CLOSE_NOTIFICATION_PANEL; + mHandler.removeMessages(msg); + mHandler.sendEmptyMessage(msg); + } + + public void systemInfoClicked(View v) { + if (DEBUG) Slog.d(TAG, "clicked system info"); + int msg = (mSystemPanel.getVisibility() == View.GONE) + ? H.MSG_OPEN_SYSTEM_PANEL + : H.MSG_CLOSE_SYSTEM_PANEL; + mHandler.removeMessages(msg); + mHandler.sendEmptyMessage(msg); } } |
