Don't hightlight call button in lists.
Bug: 2138709
diff --git a/res/drawable/call_background.xml b/res/drawable/call_background.xml
new file mode 100644
index 0000000..fbc9b3c
--- /dev/null
+++ b/res/drawable/call_background.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:state_window_focused="false"
+ android:drawable="@android:color/transparent" />
+ <item android:state_focused="false" android:state_pressed="true"
+ android:drawable="@*android:drawable/list_selector_background_transition" />
+ <item android:state_focused="false" android:state_pressed="false"
+ android:drawable="@android:drawable/screen_background_dark"/>
+
+</selector>
diff --git a/res/layout-finger/contacts_list_item.xml b/res/layout-finger/contacts_list_item.xml
index 4bba0bd..0e7852e 100644
--- a/res/layout-finger/contacts_list_item.xml
+++ b/res/layout-finger/contacts_list_item.xml
@@ -61,7 +61,7 @@
android:background="@*android:drawable/divider_vertical_dark_opaque"
/>
- <ImageView android:id="@+id/call_button"
+ <com.android.contacts.ui.widget.DontPressWithParentImageView android:id="@+id/call_button"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:paddingLeft="14dip"
@@ -69,7 +69,7 @@
android:layout_centerVertical="true"
android:gravity="center"
android:src="@android:drawable/sym_action_call"
- android:background="@android:drawable/list_selector_background"
+ android:background="@drawable/call_background"
/>
</LinearLayout>
diff --git a/res/layout-finger/contacts_list_item_photo.xml b/res/layout-finger/contacts_list_item_photo.xml
index 75c8cec..527463f 100644
--- a/res/layout-finger/contacts_list_item_photo.xml
+++ b/res/layout-finger/contacts_list_item_photo.xml
@@ -61,7 +61,7 @@
android:background="@*android:drawable/divider_vertical_dark_opaque"
/>
- <ImageView android:id="@+id/call_button"
+ <com.android.contacts.ui.widget.DontPressWithParentImageView android:id="@+id/call_button"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:paddingLeft="14dip"
@@ -69,7 +69,7 @@
android:layout_centerVertical="true"
android:gravity="center"
android:src="@android:drawable/sym_action_call"
- android:background="@android:drawable/list_selector_background"
+ android:background="@drawable/call_background"
/>
</LinearLayout>
diff --git a/res/layout-finger/recent_calls_list_item.xml b/res/layout-finger/recent_calls_list_item.xml
index 0f53d87..288892d 100644
--- a/res/layout-finger/recent_calls_list_item.xml
+++ b/res/layout-finger/recent_calls_list_item.xml
@@ -20,7 +20,7 @@
android:paddingLeft="7dip"
>
- <ImageView android:id="@+id/call_icon"
+ <com.android.contacts.ui.widget.DontPressWithParentImageView android:id="@+id/call_icon"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:paddingLeft="14dip"
@@ -29,7 +29,7 @@
android:gravity="center_vertical"
android:src="@android:drawable/sym_action_call"
- android:background="@android:drawable/list_selector_background"
+ android:background="@drawable/call_background"
/>
<View android:id="@+id/divider"
diff --git a/src/com/android/contacts/ui/widget/DontPressWithParentImageView.java b/src/com/android/contacts/ui/widget/DontPressWithParentImageView.java
new file mode 100644
index 0000000..bdb0e0a
--- /dev/null
+++ b/src/com/android/contacts/ui/widget/DontPressWithParentImageView.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 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.
+ */
+
+package com.android.contacts.ui.widget;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.View;
+import android.widget.ImageView;
+
+/**
+ * Special class to to allow the parent to be pressed without being pressed itself.
+ * This way the line of a tab can be pressed, but the image itself is not.
+ */
+public class DontPressWithParentImageView extends ImageView {
+
+ public DontPressWithParentImageView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @Override
+ public void setPressed(boolean pressed) {
+ // If the parent is pressed, do not set to pressed.
+ if (pressed && ((View) getParent()).isPressed()) {
+ return;
+ }
+ super.setPressed(pressed);
+ }
+}