am e95658c9: New backgrounds for notifications.

* commit 'e95658c98e4154a2daf0ed70d15d24f8bf3153f0':
  New backgrounds for notifications.
This commit is contained in:
Daniel Sandler
2012-05-10 09:26:40 -07:00
committed by Android Git Automerger
26 changed files with 91 additions and 17 deletions

View File

@@ -796,6 +796,12 @@ public class Notification implements Parcelable
if (this.icon != 0) {
contentView.setImageViewResource(R.id.icon, this.icon);
}
if (priority < PRIORITY_LOW) {
contentView.setInt(R.id.icon,
"setBackgroundResource", R.drawable.notification_template_icon_low_bg);
contentView.setInt(R.id.status_bar_latest_event_content,
"setBackgroundResource", R.drawable.notification_bg_low);
}
if (contentTitle != null) {
contentView.setTextViewText(R.id.title, contentTitle);
}
@@ -1364,6 +1370,12 @@ public class Notification implements Parcelable
contentView.setImageViewBitmap(R.id.icon, mLargeIcon);
smallIconImageViewId = R.id.right_icon;
}
if (mPriority < PRIORITY_LOW) {
contentView.setInt(R.id.icon,
"setBackgroundResource", R.drawable.notification_template_icon_low_bg);
contentView.setInt(R.id.status_bar_latest_event_content,
"setBackgroundResource", R.drawable.notification_bg_low);
}
if (mSmallIcon != 0) {
contentView.setImageViewResource(smallIconImageViewId, mSmallIcon);
contentView.setViewVisibility(smallIconImageViewId, View.VISIBLE);

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

View File

@@ -17,6 +17,6 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android"
android:exitFadeDuration="@android:integer/config_mediumAnimTime">
<item android:state_pressed="true" android:drawable="@drawable/notification_item_background_color_pressed" />
<item android:state_pressed="false" android:drawable="@drawable/notification_item_background_color" />
<item android:state_pressed="true" android:drawable="@drawable/notification_bg_normal_pressed" />
<item android:state_pressed="false" android:drawable="@drawable/notification_bg_normal" />
</selector>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2012 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.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android"
android:exitFadeDuration="@android:integer/config_mediumAnimTime">
<item android:state_pressed="true" android:drawable="@drawable/notification_bg_low_pressed" />
<item android:state_pressed="false" android:drawable="@drawable/notification_bg_low_normal" />
</selector>

View File

@@ -17,7 +17,10 @@
<Button xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/action0"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@android:style/Widget.Holo.Button.Small"
android:layout_height="48dp"
android:gravity="left|center_vertical"
/>
android:drawablePadding="8dp"
android:paddingLeft="8dp"
android:textColor="#ccc"
android:textSize="14dp"
/>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2012 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.
-->
<Button xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/action0"
android:layout_width="match_parent"
android:layout_height="48dp"
android:gravity="left|center_vertical"
android:drawablePadding="8dp"
android:paddingLeft="8dp"
android:textColor="#666"
android:textSize="14dp"
/>

View File

@@ -26,7 +26,7 @@
<ImageView android:id="@+id/icon"
android:layout_width="@dimen/notification_large_icon_width"
android:layout_height="@dimen/notification_large_icon_height"
android:background="@android:drawable/notify_panel_notification_icon_bg_tile"
android:background="@android:drawable/notification_template_icon_bg"
android:scaleType="center"
/>
<LinearLayout

View File

@@ -26,7 +26,7 @@
<ImageView android:id="@+id/icon"
android:layout_width="@dimen/notification_large_icon_width"
android:layout_height="@dimen/notification_large_icon_height"
android:background="@android:drawable/notify_panel_notification_icon_bg_tile"
android:background="@android:drawable/notification_template_icon_bg"
android:scaleType="center"
/>
<LinearLayout

View File

@@ -25,7 +25,7 @@
<ImageView android:id="@+id/icon"
android:layout_width="@dimen/notification_large_icon_width"
android:layout_height="@dimen/notification_large_icon_height"
android:background="@android:drawable/notify_panel_notification_icon_bg_tile"
android:background="@android:drawable/notification_template_icon_bg"
android:scaleType="center"
/>
<LinearLayout

View File

@@ -15,14 +15,18 @@
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:internal="http://schemas.android.com/apk/prv/res/android"
android:id="@+id/status_bar_latest_event_content"
android:background="@android:drawable/notification_bg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
internal:layout_minHeight="65dp"
internal:layout_maxHeight="unbounded"
>
<ImageView android:id="@+id/icon"
android:layout_width="@dimen/notification_large_icon_width"
android:layout_height="@dimen/notification_large_icon_height"
android:background="@android:drawable/notify_panel_notification_icon_bg_tile"
android:background="@android:drawable/notification_template_icon_bg"
android:scaleType="center"
/>
<LinearLayout

View File

@@ -181,5 +181,8 @@
<!-- A really bright Holo shade of blue -->
<color name="holo_blue_bright">#ff00ddff</color>
<drawable name="notification_template_icon_bg">#3333B5E5</drawable>
<drawable name="notification_template_icon_low_bg">#0cffffff</drawable>
</resources>

View File

@@ -208,6 +208,7 @@
<java-symbol type="id" name="inbox_text2" />
<java-symbol type="id" name="inbox_text3" />
<java-symbol type="id" name="inbox_text4" />
<java-symbol type="id" name="status_bar_latest_event_content" />
<java-symbol type="attr" name="actionModeShareDrawable" />
<java-symbol type="attr" name="alertDialogCenterButtons" />
@@ -1004,6 +1005,9 @@
<java-symbol type="drawable" name="ic_lockscreen_unlock" />
<java-symbol type="drawable" name="ic_lockscreen_search" />
<java-symbol type="drawable" name="notification_bg" />
<java-symbol type="drawable" name="notification_bg_low" />
<java-symbol type="drawable" name="notification_template_icon_bg" />
<java-symbol type="drawable" name="notification_template_icon_low_bg" />
<java-symbol type="layout" name="action_bar_home" />
<java-symbol type="layout" name="action_bar_title_item" />
@@ -1091,6 +1095,7 @@
<java-symbol type="layout" name="zoom_controls" />
<java-symbol type="layout" name="zoom_magnify" />
<java-symbol type="layout" name="notification_action" />
<java-symbol type="layout" name="notification_action_tombstone" />
<java-symbol type="layout" name="notification_intruder_content" />
<java-symbol type="layout" name="notification_template_base" />
<java-symbol type="layout" name="notification_template_big_base" />

View File

@@ -1,7 +1,6 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@*android:drawable/notification_bg"
>
<View
@@ -34,7 +33,6 @@
>
<com.android.internal.widget.SizeAdaptiveLayout android:id="@+id/adaptive"
android:background="@*android:drawable/notification_bg"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

View File

@@ -49,14 +49,14 @@
reducing false presses on navbar buttons; approx 2mm -->
<dimen name="navigation_bar_deadzone_size">12dp</dimen>
<!-- thickness (height) of each notification row, including any separators or padding -->
<dimen name="notification_height">68dp</dimen>
<!-- thickness (height) of each 1U notification row plus glow, padding, etc -->
<dimen name="notification_height">72dp</dimen>
<!-- Height of notification icons in the status bar -->
<dimen name="status_bar_icon_size">@*android:dimen/status_bar_icon_size</dimen>
<!-- Height of a small notification in the status bar -->
<dimen name="notification_min_height">@android:dimen/notification_large_icon_height</dimen>
<!-- Height of a small notification in the status bar plus glow, padding, etc -->
<dimen name="notification_min_height">72dp</dimen>
<!-- Height of a small notification in the status bar -->
<!-- TODO: change this back to 256dp once we deal with actions. -->
@@ -71,8 +71,8 @@
<!-- gap on either side of status bar notification icons -->
<dimen name="status_bar_icon_padding">0dp</dimen>
<!-- thickness (height) of dividers between each notification row -->
<dimen name="notification_divider_height">2dp</dimen>
<!-- half the distance between notifications in the panel -->
<dimen name="notification_divider_height">4dp</dimen>
<!-- Notification drawer tuning parameters (phone UI) -->
<!-- Initial velocity of the shade when expanding on its own -->

View File

@@ -20,6 +20,7 @@ import java.util.ArrayList;
import android.app.ActivityManagerNative;
import android.app.KeyguardManager;
import android.app.Notification;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;