checkpoint tablet status bar
Change-Id: Ia9089cce370ead4e685dffbca722fa8404a8f443
This commit is contained in:
27
core/res/res/values-xlarge/config.xml
Normal file
27
core/res/res/values-xlarge/config.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright 2009, 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<!-- These resources are around just to allow their values to be customized
|
||||
for different hardware and product builds. -->
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<!-- Component to be used as the status bar service. Must implement the IStatusBar
|
||||
interface. This name is in the ComponentName flattened format (package/class) -->
|
||||
<string name="config_statusBarComponent">com.android.systemui/com.android.systemui.statusbar.tablet.TabletStatusBarService</string>
|
||||
</resources>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<!-- Component to be used as the status bar service. Must implement the IStatusBar
|
||||
interface. This name is in the ComponentName flattened format (package/class) -->
|
||||
<string name="config_statusBarComponent">com.android.systemui/com.android.systemui.statusbar.StatusBarService</string>
|
||||
<string name="config_statusBarComponent">com.android.systemui/com.android.systemui.statusbar.PhoneStatusBarService</string>
|
||||
|
||||
<!-- Do not translate. Defines the slots for the right-hand side icons. That is to say, the
|
||||
icons in the status bar that are not notifications. -->
|
||||
|
||||
@@ -12,7 +12,12 @@
|
||||
android:icon="@drawable/ic_launcher_settings">
|
||||
|
||||
<service
|
||||
android:name=".statusbar.StatusBarService"
|
||||
android:name=".statusbar.PhoneStatusBarService"
|
||||
android:exported="false"
|
||||
/>
|
||||
|
||||
<service
|
||||
android:name=".statusbar.tablet.TabletStatusBarService"
|
||||
android:exported="false"
|
||||
/>
|
||||
|
||||
|
||||
BIN
packages/SystemUI/res/drawable/notification_dragger.png
Normal file
BIN
packages/SystemUI/res/drawable/notification_dragger.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
155
packages/SystemUI/res/layout-xlarge/status_bar.xml
Normal file
155
packages/SystemUI/res/layout-xlarge/status_bar.xml
Normal file
@@ -0,0 +1,155 @@
|
||||
<?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"
|
||||
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/icons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!--
|
||||
<LinearLayout android:id="@+id/statusIcons"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentRight="true"
|
||||
android:paddingRight="6dip"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"/>
|
||||
-->
|
||||
|
||||
<com.android.systemui.statusbar.tablet.NotificationIconArea
|
||||
android:id="@+id/notificationIcons"
|
||||
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"
|
||||
/>
|
||||
|
||||
<RelativeLayout android:id="@+id/icons"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
>
|
||||
|
||||
<com.android.systemui.statusbar.Clock
|
||||
android:textAppearance="@*android:style/TextAppearance.StatusBar.Icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:singleLine="true"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
</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_toLeftOf="@+id/menu"
|
||||
android:layout_marginRight="10dp"
|
||||
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_toLeftOf="@+id/home"
|
||||
android:src="@drawable/status_bar_menu"
|
||||
android:layout_marginRight="10dp"
|
||||
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_alignParentRight="true"
|
||||
android:layout_marginRight="10dp"
|
||||
android:src="@drawable/status_bar_home"
|
||||
systemui:keyCode="3"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
<!--
|
||||
|
||||
<LinearLayout android:id="@+id/ticker"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="6dip"
|
||||
android:animationCache="false"
|
||||
android:orientation="horizontal" >
|
||||
<ImageSwitcher android:id="@+id/tickerIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginRight="8dip"
|
||||
>
|
||||
<com.android.systemui.statusbar.AnimatedImageView
|
||||
android:layout_width="25dip"
|
||||
android:layout_height="25dip"
|
||||
/>
|
||||
<com.android.systemui.statusbar.AnimatedImageView
|
||||
android:layout_width="25dip"
|
||||
android:layout_height="25dip"
|
||||
/>
|
||||
</ImageSwitcher>
|
||||
<com.android.systemui.statusbar.TickerView android:id="@+id/tickerText"
|
||||
android:layout_width="0dip"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="2dip"
|
||||
android:paddingRight="10dip">
|
||||
<TextView
|
||||
android:textAppearance="@*android:style/TextAppearance.StatusBar.Ticker"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
/>
|
||||
<TextView
|
||||
android:textAppearance="@*android:style/TextAppearance.StatusBar.Ticker"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
/>
|
||||
</com.android.systemui.statusbar.TickerView>
|
||||
</LinearLayout>
|
||||
|
||||
<com.android.systemui.statusbar.DateView android:id="@+id/date"
|
||||
android:textAppearance="@*android:style/TextAppearance.StatusBar.Icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:singleLine="true"
|
||||
android:gravity="center_vertical|left"
|
||||
android:paddingLeft="6px"
|
||||
android:paddingRight="6px"
|
||||
android:background="@drawable/status_bar_background"
|
||||
/>
|
||||
-->
|
||||
</FrameLayout>
|
||||
|
||||
@@ -60,33 +60,6 @@
|
||||
android:textStyle="bold"
|
||||
android:gravity="center_vertical|left"
|
||||
/>
|
||||
|
||||
<LinearLayout android:id="@+id/buttons"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="6dip"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<com.android.systemui.statusbar.KeyButtonView android:id="@+id/back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@*android:dimen/status_bar_height"
|
||||
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:src="@drawable/status_bar_menu"
|
||||
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:src="@drawable/status_bar_home"
|
||||
systemui:keyCode="3"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:id="@+id/ticker"
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<Unused
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/buttons">
|
||||
</Unused>
|
||||
@@ -23,7 +23,7 @@ import android.widget.LinearLayout;
|
||||
|
||||
|
||||
public class CloseDragHandle extends LinearLayout {
|
||||
StatusBarService mService;
|
||||
PhoneStatusBarService mService;
|
||||
|
||||
public CloseDragHandle(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
@@ -32,7 +32,7 @@ import com.android.internal.statusbar.StatusBarNotification;
|
||||
* coalescing these calls so they don't stack up. For the calls
|
||||
* are coalesced, note that they are all idempotent.
|
||||
*/
|
||||
class CommandQueue extends IStatusBar.Stub {
|
||||
public class CommandQueue extends IStatusBar.Stub {
|
||||
private static final String TAG = "StatusBar.CommandQueue";
|
||||
|
||||
private static final int MSG_MASK = 0xffff0000;
|
||||
|
||||
@@ -27,7 +27,7 @@ import android.util.Slog;
|
||||
|
||||
|
||||
public class ExpandedView extends LinearLayout {
|
||||
StatusBarService mService;
|
||||
PhoneStatusBarService mService;
|
||||
int mPrevHeight = -1;
|
||||
|
||||
public ExpandedView(Context context, AttributeSet attrs) {
|
||||
@@ -53,7 +53,7 @@ public class ExpandedView extends LinearLayout {
|
||||
//Slog.d(StatusBarService.TAG, "height changed old=" + mPrevHeight
|
||||
// + " new=" + height);
|
||||
mPrevHeight = height;
|
||||
mService.updateExpandedViewPos(StatusBarService.EXPANDED_LEAVE_ALONE);
|
||||
mService.updateExpandedViewPos(PhoneStatusBarService.EXPANDED_LEAVE_ALONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -35,13 +35,12 @@ public class StatusBarView extends FrameLayout {
|
||||
|
||||
static final int DIM_ANIM_TIME = 400;
|
||||
|
||||
StatusBarService mService;
|
||||
PhoneStatusBarService mService;
|
||||
boolean mTracking;
|
||||
int mStartX, mStartY;
|
||||
ViewGroup mNotificationIcons;
|
||||
ViewGroup mStatusIcons;
|
||||
View mDate;
|
||||
View mButtonArea;
|
||||
FixedSizeDrawable mBackground;
|
||||
|
||||
boolean mNightMode = false;
|
||||
@@ -65,8 +64,6 @@ public class StatusBarView extends FrameLayout {
|
||||
mBackground = new FixedSizeDrawable(mDate.getBackground());
|
||||
mBackground.setFixedBounds(0, 0, 0, 0);
|
||||
mDate.setBackgroundDrawable(mBackground);
|
||||
|
||||
mButtonArea = findViewById(R.id.buttons);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -101,7 +98,7 @@ public class StatusBarView extends FrameLayout {
|
||||
@Override
|
||||
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
|
||||
super.onSizeChanged(w, h, oldw, oldh);
|
||||
mService.updateExpandedViewPos(StatusBarService.EXPANDED_LEAVE_ALONE);
|
||||
mService.updateExpandedViewPos(PhoneStatusBarService.EXPANDED_LEAVE_ALONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -132,10 +129,6 @@ public class StatusBarView extends FrameLayout {
|
||||
|
||||
mDate.layout(mDate.getLeft(), mDate.getTop(), newDateRight, mDate.getBottom());
|
||||
mBackground.setFixedBounds(-mDate.getLeft(), -mDate.getTop(), (r-l), (b-t));
|
||||
|
||||
if (mButtonArea != null) {
|
||||
mButtonArea.getHitRect(mButtonBounds);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,7 +26,7 @@ import android.widget.LinearLayout;
|
||||
|
||||
public class TrackingView extends LinearLayout {
|
||||
final Display mDisplay;
|
||||
StatusBarService mService;
|
||||
PhoneStatusBarService mService;
|
||||
boolean mTracking;
|
||||
int mStartX, mStartY;
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright (C) 2010 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.
|
||||
*/
|
||||
|
||||
package com.android.systemui.statusbar.tablet;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Handler;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Slog;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.android.systemui.R;
|
||||
|
||||
|
||||
public class NotificationIconArea extends LinearLayout {
|
||||
private static final String TAG = "NotificationIconArea";
|
||||
|
||||
MoreView mMoreView;
|
||||
IconLayout mIconLayout;
|
||||
DraggerView mDraggerView;
|
||||
|
||||
public NotificationIconArea(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
mMoreView = new MoreView(context);
|
||||
addView(mMoreView, new LinearLayout.LayoutParams(
|
||||
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
|
||||
|
||||
mIconLayout = new IconLayout(context);
|
||||
addView(mIconLayout, new LinearLayout.LayoutParams(
|
||||
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
|
||||
|
||||
mDraggerView = new DraggerView(context);
|
||||
addView(mDraggerView, new LinearLayout.LayoutParams(
|
||||
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
|
||||
}
|
||||
|
||||
class MoreView extends ImageView {
|
||||
public MoreView(Context context) {
|
||||
super(context);
|
||||
setImageResource(R.drawable.stat_notify_more);
|
||||
}
|
||||
}
|
||||
|
||||
class IconLayout extends LinearLayout {
|
||||
public IconLayout(Context context) {
|
||||
super(context);
|
||||
}
|
||||
}
|
||||
|
||||
class DraggerView extends ImageView {
|
||||
public DraggerView(Context context) {
|
||||
super(context);
|
||||
setImageResource(R.drawable.notification_dragger);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* Copyright (C) 2010 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.
|
||||
*/
|
||||
|
||||
package com.android.systemui.statusbar.tablet;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.os.IBinder;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.android.internal.statusbar.StatusBarIcon;
|
||||
import com.android.internal.statusbar.StatusBarIconList;
|
||||
import com.android.internal.statusbar.StatusBarNotification;
|
||||
|
||||
import com.android.systemui.statusbar.*;
|
||||
import com.android.systemui.R;
|
||||
|
||||
public class TabletStatusBarService extends StatusBarService {
|
||||
|
||||
View mStatusBarView;
|
||||
NotificationIconArea mNotificationIconArea;
|
||||
|
||||
int mIconSize;
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
}
|
||||
|
||||
protected View makeStatusBarView() {
|
||||
Resources res = getResources();
|
||||
|
||||
mIconSize = res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_icon_size);
|
||||
|
||||
final View sb = View.inflate(this, R.layout.status_bar, null);
|
||||
mStatusBarView = sb;
|
||||
|
||||
// the more notifications icon
|
||||
mNotificationIconArea = (NotificationIconArea)sb.findViewById(R.id.notificationIcons);
|
||||
|
||||
return sb;
|
||||
}
|
||||
|
||||
protected int getStatusBarGravity() {
|
||||
return Gravity.BOTTOM | Gravity.FILL_HORIZONTAL;
|
||||
}
|
||||
|
||||
public void addIcon(String slot, int index, int viewIndex, StatusBarIcon icon) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
public void updateIcon(String slot, int index, int viewIndex,
|
||||
StatusBarIcon old, StatusBarIcon icon) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
public void removeIcon(String slot, int index, int viewIndex) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
public void addNotification(IBinder key, StatusBarNotification notification) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
public void updateNotification(IBinder key, StatusBarNotification notification) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
public void removeNotification(IBinder key) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
public void disable(int state) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
public void animateExpand() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
public void animateCollapse() {
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user