Skip to content

Commit

Permalink
Forward port Status Bar interface
Browse files Browse the repository at this point in the history
Patch Set 1: Signal / Clock / Battery / Notification Count
Patch Set 2: Updated commit message

Change-Id: Iecd4bb06b95b14888916331f5d36327f3206aeef
  • Loading branch information
burnsra committed Nov 27, 2012
1 parent ee52a8d commit 1abc2dd
Show file tree
Hide file tree
Showing 124 changed files with 1,008 additions and 22 deletions.
6 changes: 4 additions & 2 deletions core/java/android/provider/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -2676,7 +2676,9 @@ public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean
* Display style of the status bar battery information
* 0: Display the stock battery information
* 1: Display cm battery percentage implementation / dont show stock icon
* 2: Hide the battery information
* 2: Display cm circle battery implementation without percentage
* 3: Display cm circle battery implementation with percentage
* 4: Hide the battery information
* default: 0
* @hide
*/
Expand Down Expand Up @@ -2750,7 +2752,7 @@ public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean

/**
* Boolean value whether to link ringtone and notification volumes
*
*
* @hide
*/
public static final String VOLUME_LINK_NOTIFICATION = "volume_link_notification";
Expand Down
Binary file modified packages/SystemUI/res/drawable-hdpi/ic_notification_overlay.9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/SystemUI/res/drawable-xhdpi/ic_notification_overlay.9.png
29 changes: 29 additions & 0 deletions packages/SystemUI/res/drawable/stat_sys_battery_charge_min.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2011, 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.
*/
-->

<level-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:maxLevel="4" android:drawable="@drawable/stat_sys_battery_charge_min_anim0" />
<item android:maxLevel="15" android:drawable="@drawable/stat_sys_battery_charge_min_anim15" />
<item android:maxLevel="35" android:drawable="@drawable/stat_sys_battery_charge_min_anim28" />
<item android:maxLevel="49" android:drawable="@drawable/stat_sys_battery_charge_min_anim43" />
<item android:maxLevel="60" android:drawable="@drawable/stat_sys_battery_charge_min_anim57" />
<item android:maxLevel="75" android:drawable="@drawable/stat_sys_battery_charge_min_anim71" />
<item android:maxLevel="90" android:drawable="@drawable/stat_sys_battery_charge_min_anim85" />
<item android:maxLevel="100" android:drawable="@drawable/stat_sys_battery_charge_min_anim100" />
</level-list>
30 changes: 30 additions & 0 deletions packages/SystemUI/res/drawable/stat_sys_battery_min.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/* //device/apps/common/res/drawable/stat_sys_battery.xml
**
** Copyright 2007, 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.
*/
-->

<level-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:maxLevel="4" android:drawable="@drawable/stat_sys_battery_min_0" />
<item android:maxLevel="15" android:drawable="@drawable/stat_sys_battery_min_15" />
<item android:maxLevel="35" android:drawable="@drawable/stat_sys_battery_min_28" />
<item android:maxLevel="49" android:drawable="@drawable/stat_sys_battery_min_43" />
<item android:maxLevel="60" android:drawable="@drawable/stat_sys_battery_min_57" />
<item android:maxLevel="75" android:drawable="@drawable/stat_sys_battery_min_71" />
<item android:maxLevel="90" android:drawable="@drawable/stat_sys_battery_min_85" />
<item android:maxLevel="100" android:drawable="@drawable/stat_sys_battery_min_100" />
</level-list>
53 changes: 53 additions & 0 deletions packages/SystemUI/res/layout/signal_cluster_text_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/* apps/common/assets/default/default/skins/StatusBar.xml
**
** Copyright 2011, 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.
*/
-->

<com.android.systemui.statusbar.SignalClusterTextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="horizontal"
>
<LinearLayout
android:id="@+id/mobile_signal_text_combo"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
android:gravity="center"
android:layout_marginRight="-3dip"
>
<TextView
android:id="@+id/mobile_signal_text"
android:textAppearance="@style/TextAppearance.StatusBar.Signal"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:singleLine="true"
android:layout_marginRight="-3dip"
android:gravity="center_vertical|left"
/>
<ImageView
android:id="@+id/mobile_signal_text_icon"
android:src="@drawable/stat_sys_signal_min"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="1dip"
android:paddingRight="2dip"
/>
</LinearLayout>
</com.android.systemui.statusbar.SignalClusterTextView>
30 changes: 27 additions & 3 deletions packages/SystemUI/res/layout/status_bar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
android:layout_height="match_parent"
android:orientation="horizontal">

<LinearLayout android:id="@+id/statusIcons"
<LinearLayout android:id="@+id/statusIcons"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
Expand All @@ -96,14 +96,38 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<include layout="@layout/signal_cluster_text_view"
android:id="@+id/signal_cluster_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/battery_text"
android:textAppearance="@style/TextAppearance.StatusBar.Battery"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:singleLine="true"
android:paddingLeft="4dip"
android:layout_marginRight="-3dip"
android:gravity="center_vertical|left"
/>
<ImageView
android:id="@+id/battery"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:paddingLeft="4dip"
/>
<com.android.systemui.statusbar.policy.CircleBattery
android:id="@+id/circle_battery"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.StatusBar.Battery"
android:singleLine="true"
android:gravity="bottom"
android:paddingLeft="4dip"
/>
</LinearLayout>

<com.android.systemui.statusbar.policy.Clock
android:id="@+id/clock"
android:textAppearance="@style/TextAppearance.StatusBar.Clock"
Expand All @@ -115,7 +139,7 @@
/>
</LinearLayout>
</LinearLayout>

<LinearLayout android:id="@+id/ticker"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down
8 changes: 8 additions & 0 deletions packages/SystemUI/res/layout/system_bar_notification_area.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@
android:paddingLeft="4dip"
android:visibility="gone"
/>
<com.android.systemui.statusbar.policy.CircleBattery
android:id="@+id/dock_circle_battery"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:singleLine="true"
android:paddingLeft="4dip"
android:gravity="center_vertical|left"
/>
<ImageView
android:id="@+id/battery"
android:layout_height="wrap_content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,15 @@
android:text="@string/status_bar_settings_settings_button"
/>

<com.android.systemui.statusbar.policy.CircleBattery
android:id="@+id/panel_circle_battery"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:paddingLeft="6dp"
android:layout_gravity="center_vertical"
/>

<!-- this will stretch to eat up available space -->
<View
android:layout_width="0dp"
Expand Down
2 changes: 1 addition & 1 deletion packages/SystemUI/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
-->
<resources>
<drawable name="notification_number_text_color">#ffffffff</drawable>
<drawable name="notification_number_text_color">#ff000000</drawable>
<drawable name="ticker_background_color">#ff1d1d1d</drawable>
<drawable name="status_bar_background">#ff000000</drawable>
<color name="notification_panel_solid_background">#ff000000</color>
Expand Down
5 changes: 5 additions & 0 deletions packages/SystemUI/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -517,4 +517,9 @@
<!-- Body of help text shown when the notification panel is pulled down for the very first time. [CHAR LIMIT=NONE] -->
<string name="status_bar_help_text">Access them anytime by swiping down.\nSwipe down again for system controls.</string>
<string name="powerwidget_screen_timeout_toast">Screen timeout set to: %1$d %2$s</string>

<!-- Text to display next to the minimal graphical battery meter. [CHAR LIMIT=3] -->
<string name="status_bar_settings_battery_meter_min_format" translatable="false">
<xliff:g id="number">%d</xliff:g>
</string>
</resources>
16 changes: 15 additions & 1 deletion packages/SystemUI/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@
<item name="android:textColor">#FFFFFFFF</item>
</style>

<style name="TextAppearance.StatusBar.Battery" parent="@*android:style/TextAppearance.StatusBar.Icon">
<!-- Note: must be dp to fit in status bar -->
<item name="android:textSize">12dp</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">@android:color/holo_blue_light</item>
</style>

<style name="TextAppearance.StatusBar.Clock" parent="@*android:style/TextAppearance.StatusBar.Icon">
<!-- Note: must be dp to fit in status bar -->
<item name="android:textSize">16dp</item>
Expand Down Expand Up @@ -83,7 +90,14 @@

<style name="TextAppearance.StatusBar.Expanded.Network" parent="@style/TextAppearance.StatusBar.Expanded.Date">
<item name="android:textColor">#999999</item>
</style>
</style>

<style name="TextAppearance.StatusBar.Signal" parent="@*android:style/TextAppearance.StatusBar.Icon">
<!-- Note: must be dp to fit in status bar -->
<item name="android:textSize">12dp</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">@android:color/holo_blue_light</item>
</style>

<style name="TextAppearance.StatusBar.Expanded.Network.EmergencyOnly">
</style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ public abstract class BaseStatusBar extends SystemUI implements

private boolean mDeviceProvisioned = false;

private boolean mShowNotificationCounts;

public IStatusBarService getStatusBarService() {
return mBarService;
}
Expand Down Expand Up @@ -206,6 +208,9 @@ public void start() {
mBarService = IStatusBarService.Stub.asInterface(
ServiceManager.getService(Context.STATUS_BAR_SERVICE));

mShowNotificationCounts = Settings.System.getInt(mContext.getContentResolver(),
Settings.System.STATUS_BAR_NOTIF_COUNT, 0) == 1;

mStatusBarContainer = new FrameLayout(mContext);

// Connect in to the status bar manager service
Expand Down
Loading

0 comments on commit 1abc2dd

Please sign in to comment.