Put the correct background behind largeIcons.

Also add touch feedback to notification items (finally!).

Bug: 5213090 (largeIcon background)
Bug: 3329721 (press states)
Change-Id: I89a4211106698ebff867b5c8bad50cb8b9b33a0b
This commit is contained in:
Daniel Sandler
2011-09-22 17:02:33 -04:00
parent df8e00ff33
commit db8bd198e5
3 changed files with 25 additions and 11 deletions

View File

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

View File

@@ -23,6 +23,7 @@
android:layout_alignParentLeft="true"
android:scaleType="center"
android:clickable="true"
android:background="@*android:drawable/notify_panel_notification_icon_bg_tile"
/>
<com.android.systemui.statusbar.LatestItemView android:id="@+id/content"
@@ -33,14 +34,14 @@
android:layout_alignParentRight="true"
android:focusable="true"
android:clickable="true"
android:background="@drawable/notification_item_background_color"
android:background="@drawable/notification_row_bg"
/>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/notification_divider_height"
android:layout_alignParentBottom="true"
android:background="@drawable/status_bar_notification_row_background_color"
android:background="@drawable/notification_item_background_color"
/>
</RelativeLayout>

View File

@@ -896,14 +896,6 @@ public class PhoneStatusBar extends StatusBar {
}
}
void workAroundBadLayerDrawableOpacity(View v) {
LayerDrawable d = (LayerDrawable)v.getBackground();
if (d == null) return;
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;
@@ -915,7 +907,6 @@ public class PhoneStatusBar extends StatusBar {
LayoutInflater inflater = (LayoutInflater)mContext.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
View row = inflater.inflate(R.layout.status_bar_notification_row, parent, false);
workAroundBadLayerDrawableOpacity(row);
View vetoButton = row.findViewById(R.id.veto);
if (entry.notification.isClearable()) {
final String _pkg = sbn.pkg;