Status bar formatting tweaks
Change-Id: Icb6c8d87e109d9e133e86b0fdb7bea12fe376d92
diff --git a/core/res/res/layout-xlarge/status_bar_latest_event_content.xml b/core/res/res/layout-xlarge/status_bar_latest_event_content.xml
index c64b90e..d599154 100644
--- a/core/res/res/layout-xlarge/status_bar_latest_event_content.xml
+++ b/core/res/res/layout-xlarge/status_bar_latest_event_content.xml
@@ -1,56 +1,41 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:orientation="vertical"
- android:paddingTop="7dp"
- android:paddingLeft="5dp"
>
+ <ImageView android:id="@+id/icon"
+ android:layout_width="48dp"
+ android:layout_height="64dp"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:scaleType="center"
+ />
+
<LinearLayout
- android:layout_width="match_parent"
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:paddingTop="3dp"
+ android:layout_gravity="center_vertical"
+ android:layout_weight="1"
+ android:orientation="vertical"
+ android:paddingLeft="16dp"
>
- <!--com.android.server.status.AnimatedImageView android:id="@+id/icon" -->
- <ImageView android:id="@+id/icon"
- android:layout_width="25dp"
- android:layout_height="25dp"
- android:scaleType="fitCenter"
- android:src="@drawable/arrow_down_float"/>
<TextView android:id="@+id/title"
android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal"
+ />
+ <TextView android:id="@+id/text"
+ android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
android:layout_weight="1"
android:singleLine="true"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
- android:paddingLeft="4dp"
- />
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- >
- <TextView android:id="@+id/text"
- android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:singleLine="true"
- android:ellipsize="marquee"
- android:fadingEdge="horizontal"
- android:paddingLeft="4dp"
- />
- <android.widget.DateTimeView android:id="@+id/time"
- android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
- android:layout_marginLeft="4dp"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:singleLine="true"
- android:paddingRight="5dp"
/>
</LinearLayout>
</LinearLayout>
+
diff --git a/core/res/res/values-xlarge/styles.xml b/core/res/res/values-xlarge/styles.xml
index 4692656..316861e 100644
--- a/core/res/res/values-xlarge/styles.xml
+++ b/core/res/res/values-xlarge/styles.xml
@@ -30,9 +30,9 @@
</style>
<style name="TextAppearance.StatusBar.EventContent">
<item name="android:textColor">?android:attr/textColorPrimary</item>
+ <item name="android:textSize">16sp</item>
</style>
<style name="TextAppearance.StatusBar.EventContent.Title">
- <item name="android:textSize">18sp</item>
<item name="android:textStyle">bold</item>
</style>
</resources>
diff --git a/packages/SystemUI/res/drawable/status_bar_item_background.xml b/packages/SystemUI/res/drawable/status_bar_item_background.xml
new file mode 100644
index 0000000..9da92a7
--- /dev/null
+++ b/packages/SystemUI/res/drawable/status_bar_item_background.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 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.
+-->
+
+<layer-list
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:opacity="translucent"
+ >
+ <item
+ android:drawable="@drawable/notification_item_background_color"
+ android:left="16dp"
+ />
+</layer-list>
+
diff --git a/packages/SystemUI/res/layout-xlarge/status_bar.xml b/packages/SystemUI/res/layout-xlarge/status_bar.xml
index ddb5bb9..b8b8bdd 100644
--- a/packages/SystemUI/res/layout-xlarge/status_bar.xml
+++ b/packages/SystemUI/res/layout-xlarge/status_bar.xml
@@ -28,18 +28,6 @@
android:animateLayoutChanges="false"
>
- <!-- ticker: transient incoming notification information -->
- <FrameLayout
- android:id="@+id/ticker"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_alignParentRight="true"
- android:layout_toRightOf="@+id/systemInfo"
- android:paddingLeft="6dip"
- android:gravity="center_vertical"
- android:animateLayoutChanges="true"
- />
-
<!-- notification icons & panel access -->
<LinearLayout
android:id="@+id/notificationArea"
@@ -242,5 +230,17 @@
android:visibility="gone"
/>
+ <!-- ticker: transient incoming notification information -->
+ <FrameLayout
+ android:id="@+id/ticker"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_alignParentRight="true"
+ android:layout_toRightOf="@+id/systemInfo"
+ android:paddingLeft="6dip"
+ android:gravity="center_vertical"
+ android:animateLayoutChanges="true"
+ />
+
</RelativeLayout>
</com.android.systemui.statusbar.tablet.TabletStatusBarView>
diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_latest_event.xml b/packages/SystemUI/res/layout-xlarge/status_bar_latest_event.xml
index 049a1cc..b6679a5 100644
--- a/packages/SystemUI/res/layout-xlarge/status_bar_latest_event.xml
+++ b/packages/SystemUI/res/layout-xlarge/status_bar_latest_event.xml
@@ -1,36 +1,35 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="65sp"
- android:orientation="vertical"
- android:background="@android:drawable/status_bar_item_background"
+ android:layout_height="65dp"
+ android:background="@drawable/status_bar_item_background"
>
<ImageButton
android:id="@+id/veto"
- android:layout_width="wrap_content"
+ android:layout_width="48dp"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:src="@drawable/status_bar_veto"
android:scaleType="center"
- android:background="@null"
- android:paddingLeft="16dip"
- android:paddingRight="16dip"
+ android:background="#ff000000"
/>
<com.android.systemui.statusbar.LatestItemView android:id="@+id/content"
- android:layout_alignParentTop="true"
- android:layout_toLeftOf="@id/veto"
- android:layout_width="match_parent"
+ android:layout_width="wrap_content"
android:layout_height="64sp"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true"
+ android:layout_toLeftOf="@id/veto"
+ android:layout_marginLeft="16dp"
android:focusable="true"
android:clickable="true"
- android:paddingRight="6sp"
/>
<View
android:layout_width="match_parent"
- android:layout_height="1sp"
+ android:layout_height="1dp"
+ android:layout_marginLeft="16dp"
android:layout_alignParentBottom="true"
android:background="@android:drawable/divider_horizontal_dark"
/>
diff --git a/packages/SystemUI/res/layout-xlarge/sysbar_panel_notifications.xml b/packages/SystemUI/res/layout-xlarge/sysbar_panel_notifications.xml
index 287b46f..186aa64 100644
--- a/packages/SystemUI/res/layout-xlarge/sysbar_panel_notifications.xml
+++ b/packages/SystemUI/res/layout-xlarge/sysbar_panel_notifications.xml
@@ -22,10 +22,9 @@
<com.android.systemui.statusbar.tablet.NotificationPanel
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
- android:layout_width="wrap_content"
+ android:layout_width="540dp"
android:animateLayoutChanges="true"
android:background="@drawable/bg_scrim_notification"
- android:paddingLeft="140dp"
android:paddingBottom="32dp"
>
@@ -34,10 +33,11 @@
android:layout_height="wrap_content"
android:layout_width="384dp"
android:layout_above="@+id/content_frame"
- android:layout_marginLeft="16dp"
+ android:layout_marginLeft="24dp"
android:paddingBottom="16dp"
android:orientation="vertical"
android:animateLayoutChanges="true"
+ android:layout_alignParentRight="true"
>
<com.android.systemui.statusbar.policy.Clock
@@ -128,8 +128,9 @@
<FrameLayout
android:id="@+id/content_frame"
android:layout_height="wrap_content"
- android:layout_width="400dp"
+ android:layout_width="408dp"
android:layout_alignParentBottom="true"
+ android:layout_alignParentRight="true"
>
<ScrollView
android:id="@+id/notificationScroller"
@@ -144,7 +145,6 @@
android:animateLayoutChanges="true"
android:animationCache="false"
android:orientation="vertical"
- android:background="@drawable/status_bar_background"
android:clickable="true"
android:focusable="true"
android:descendantFocusability="afterDescendants"
diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml
index a0def6b..fd2cf99 100644
--- a/packages/SystemUI/res/values/colors.xml
+++ b/packages/SystemUI/res/values/colors.xml
@@ -18,4 +18,5 @@
-->
<resources>
<drawable name="notification_number_text_color">#ffffffff</drawable>
+ <drawable name="notification_item_background_color">#ff000000</drawable>
</resources>
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 d290bd9..7c97ac7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -31,6 +31,8 @@
import android.content.res.Resources;
import android.graphics.PixelFormat;
import android.graphics.Rect;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.LayerDrawable;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
@@ -968,6 +970,13 @@
}
}
+ void workAroundBadLayerDrawableOpacity(View v) {
+ LayerDrawable d = (LayerDrawable)v.getBackground();
+ v.setBackgroundDrawable(null);
+ d.setOpacity(PixelFormat.TRANSLUCENT);
+ v.setBackgroundDrawable(d);
+ }
+
private boolean inflateViews(NotificationData.Entry entry, ViewGroup parent) {
StatusBarNotification sbn = entry.notification;
RemoteViews remoteViews = sbn.notification.contentView;
@@ -979,6 +988,7 @@
LayoutInflater inflater = (LayoutInflater)mContext.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
View row = inflater.inflate(R.layout.status_bar_latest_event, parent, false);
+ workAroundBadLayerDrawableOpacity(row);
View vetoButton = row.findViewById(R.id.veto);
if (entry.notification.isClearable()) {
final String _pkg = sbn.pkg;