Merge "Replace FrameLayout by LinearLayout, remove a RelativeLayout."
diff --git a/res/layout/call_log_action_call.xml b/res/layout/call_log_action_call.xml
deleted file mode 100644
index a510d63..0000000
--- a/res/layout/call_log_action_call.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?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.
--->
-
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
-
- <LinearLayout
- android:id="@+id/divider"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_centerInParent="true"
- android:orientation="horizontal"
- >
- <ImageView
- android:id="@+id/unheard_icon"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/call_log_inner_margin"
- android:layout_gravity="center_vertical"
- android:scaleType="center"
- android:src="@drawable/ic_unheard_voicemail_holo_dark"
- android:visibility="gone"
- android:contentDescription="@string/description_call_log_unheard_voicemail"
- />
- <View
- android:layout_width="1px"
- android:layout_height="@dimen/call_log_call_action_size"
- android:layout_gravity="center_vertical"
- android:layout_marginLeft="@dimen/call_log_inner_margin"
- android:background="@drawable/ic_divider_dashed_holo_dark"
- />
- <ImageView
- android:id="@+id/call_icon"
- android:layout_width="@dimen/call_log_call_action_width"
- android:layout_height="@dimen/call_log_call_action_height"
- android:layout_gravity="center_vertical"
- android:scaleType="center"
- android:src="@drawable/ic_ab_dialer_holo_dark"
- android:background="@drawable/list_selector"
- android:contentDescription="@string/description_call_log_call_button"
- />
- <ImageView
- android:id="@+id/play_icon"
- android:layout_width="@dimen/call_log_call_action_width"
- android:layout_height="@dimen/call_log_call_action_height"
- android:layout_gravity="center_vertical"
- android:scaleType="center"
- android:src="@drawable/ic_play_holo_dark"
- android:background="@drawable/list_selector"
- android:contentDescription="@string/description_call_log_play_button"
- />
- </LinearLayout>
-
-</merge>
diff --git a/res/layout/call_log_contact_photo.xml b/res/layout/call_log_contact_photo.xml
deleted file mode 100644
index fd7d853..0000000
--- a/res/layout/call_log_contact_photo.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <FrameLayout
- android:id="@+id/contact_photo"
- android:layout_width="@dimen/call_log_list_contact_photo_size"
- android:layout_height="@dimen/call_log_list_contact_photo_size"
- android:layout_alignParentLeft="true"
- android:layout_centerInParent="true"
- android:layout_marginLeft="@dimen/call_log_inner_margin"
- >
- <QuickContactBadge
- android:id="@+id/quick_contact_photo"
- android:layout_width="@dimen/call_log_list_contact_photo_size"
- android:layout_height="@dimen/call_log_list_contact_photo_size"
- />
- <ImageView
- android:id="@+id/plain_contact_photo"
- android:layout_width="@dimen/call_log_list_contact_photo_size"
- android:layout_height="@dimen/call_log_list_contact_photo_size"
- />
- </FrameLayout>
-</merge>
diff --git a/res/layout/call_log_list_item.xml b/res/layout/call_log_list_item.xml
index 3b5601f..83b67b9 100644
--- a/res/layout/call_log_list_item.xml
+++ b/res/layout/call_log_list_item.xml
@@ -14,7 +14,7 @@
limitations under the License.
-->
-<FrameLayout
+<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -37,9 +37,81 @@
android:layout_height="wrap_content"
android:gravity="center_vertical"
>
- <include layout="@layout/call_log_contact_photo"/>
- <include layout="@layout/call_log_action_call"/>
- <include layout="@layout/call_log_list_item_layout"/>
+ <!-- Only one of the next two is visible at one time. The other one is set to INVISIBLE -->
+ <QuickContactBadge
+ android:id="@+id/quick_contact_photo"
+ android:layout_width="@dimen/call_log_list_contact_photo_size"
+ android:layout_height="@dimen/call_log_list_contact_photo_size"
+ android:layout_alignParentLeft="true"
+ android:layout_centerVertical="true"
+ android:layout_marginLeft="@dimen/call_log_inner_margin"
+ />
+ <ImageView
+ android:id="@+id/plain_contact_photo"
+ android:layout_width="@dimen/call_log_list_contact_photo_size"
+ android:layout_height="@dimen/call_log_list_contact_photo_size"
+ android:layout_alignParentLeft="true"
+ android:layout_centerVertical="true"
+ android:layout_marginLeft="@dimen/call_log_inner_margin"
+ />
+ <LinearLayout
+ android:id="@+id/divider"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_centerInParent="true"
+ android:orientation="horizontal"
+ >
+ <ImageView
+ android:id="@+id/unheard_icon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="@dimen/call_log_inner_margin"
+ android:layout_gravity="center_vertical"
+ android:scaleType="center"
+ android:src="@drawable/ic_unheard_voicemail_holo_dark"
+ android:visibility="gone"
+ android:contentDescription="@string/description_call_log_unheard_voicemail"
+ />
+ <View
+ android:layout_width="1px"
+ android:layout_height="@dimen/call_log_call_action_size"
+ android:layout_gravity="center_vertical"
+ android:layout_marginLeft="@dimen/call_log_inner_margin"
+ android:background="@drawable/ic_divider_dashed_holo_dark"
+ />
+ <ImageView
+ android:id="@+id/call_icon"
+ android:layout_width="@dimen/call_log_call_action_width"
+ android:layout_height="@dimen/call_log_call_action_height"
+ android:layout_gravity="center_vertical"
+ android:scaleType="center"
+ android:src="@drawable/ic_ab_dialer_holo_dark"
+ android:background="@drawable/list_selector"
+ android:contentDescription="@string/description_call_log_call_button"
+ />
+ <ImageView
+ android:id="@+id/play_icon"
+ android:layout_width="@dimen/call_log_call_action_width"
+ android:layout_height="@dimen/call_log_call_action_height"
+ android:layout_gravity="center_vertical"
+ android:scaleType="center"
+ android:src="@drawable/ic_play_holo_dark"
+ android:background="@drawable/list_selector"
+ android:contentDescription="@string/description_call_log_play_button"
+ />
+ </LinearLayout>
+ <RelativeLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_toRightOf="@id/quick_contact_photo"
+ android:layout_toLeftOf="@id/divider"
+ android:layout_centerInParent="true"
+ android:layout_alignWithParentIfMissing="true"
+ android:layout_marginLeft="@dimen/call_log_inner_margin"
+ >
+ <include layout="@layout/call_log_phone_call_details"/>
+ </RelativeLayout>
</RelativeLayout>
<TextView
@@ -51,4 +123,4 @@
android:textStyle="bold"
android:textColor="?attr/call_log_header_color"
/>
-</FrameLayout>
+</LinearLayout>
diff --git a/res/layout/call_log_list_item_layout.xml b/res/layout/call_log_list_item_layout.xml
deleted file mode 100644
index e754bf7..0000000
--- a/res/layout/call_log_list_item_layout.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 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.
--->
-
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <RelativeLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_toRightOf="@id/contact_photo"
- android:layout_toLeftOf="@id/divider"
- android:layout_centerInParent="true"
- android:layout_alignWithParentIfMissing="true"
- android:layout_marginLeft="@dimen/call_log_inner_margin"
- >
- <include layout="@layout/call_log_phone_call_details"/>
- </RelativeLayout>
-</merge>
diff --git a/src/com/android/contacts/calllog/CallLogFragment.java b/src/com/android/contacts/calllog/CallLogFragment.java
index 0999b44..63b41af 100644
--- a/src/com/android/contacts/calllog/CallLogFragment.java
+++ b/src/com/android/contacts/calllog/CallLogFragment.java
@@ -357,7 +357,7 @@
}
mDone = false;
- mCallerIdThread = new Thread(this);
+ mCallerIdThread = new Thread(this, "CallLogContactLookup");
mCallerIdThread.setPriority(Thread.MIN_PRIORITY);
mCallerIdThread.start();
}
@@ -799,13 +799,13 @@
// This does not correspond to a contact, do not use the QuickContactBadge.
mContactPhotoManager.loadPhoto(views.plainPhotoView, thumbnailUri);
views.plainPhotoView.setVisibility(View.VISIBLE);
- views.quickContactView.setVisibility(View.GONE);
+ views.quickContactView.setVisibility(View.INVISIBLE);
} else {
views.quickContactView.assignContactUri(
Contacts.getLookupUri(contactId, lookupKey));
mContactPhotoManager.loadPhoto(views.quickContactView, thumbnailUri);
views.quickContactView.setVisibility(View.VISIBLE);
- views.plainPhotoView.setVisibility(View.GONE);
+ views.plainPhotoView.setVisibility(View.INVISIBLE);
}
}
diff --git a/tests/src/com/android/contacts/activities/CallLogActivityTests.java b/tests/src/com/android/contacts/activities/CallLogActivityTests.java
index c186106..827bd37 100644
--- a/tests/src/com/android/contacts/activities/CallLogActivityTests.java
+++ b/tests/src/com/android/contacts/activities/CallLogActivityTests.java
@@ -282,7 +282,7 @@
CallLogListItemViews views = (CallLogListItemViews) view.getTag();
assertEquals(View.VISIBLE, views.quickContactView.getVisibility());
- assertEquals(View.GONE, views.plainPhotoView.getVisibility());
+ assertEquals(View.INVISIBLE, views.plainPhotoView.getVisibility());
}
@MediumTest
@@ -293,7 +293,7 @@
mAdapter.bindStandAloneView(view, getActivity(), mCursor);
CallLogListItemViews views = (CallLogListItemViews) view.getTag();
- assertEquals(View.GONE, views.quickContactView.getVisibility());
+ assertEquals(View.INVISIBLE, views.quickContactView.getVisibility());
assertEquals(View.VISIBLE, views.plainPhotoView.getVisibility());
}