Merge "Use highres pictures in call-log (if available)"
diff --git a/res/drawable-hdpi/btn_dial_action_middle_disable.9.png b/res/drawable-hdpi/btn_dial_action_middle_disable.9.png
deleted file mode 100644
index 5159c74..0000000
--- a/res/drawable-hdpi/btn_dial_action_middle_disable.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/btn_dial_action_middle_disable_focused.9.png b/res/drawable-hdpi/btn_dial_action_middle_disable_focused.9.png
deleted file mode 100644
index 46935c8..0000000
--- a/res/drawable-hdpi/btn_dial_action_middle_disable_focused.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/btn_dial_action_middle_normal.9.png b/res/drawable-hdpi/btn_dial_action_middle_normal.9.png
deleted file mode 100644
index e86afd1..0000000
--- a/res/drawable-hdpi/btn_dial_action_middle_normal.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/btn_dial_action_middle_pressed.9.png b/res/drawable-hdpi/btn_dial_action_middle_pressed.9.png
deleted file mode 100644
index 6d428c9..0000000
--- a/res/drawable-hdpi/btn_dial_action_middle_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/btn_dial_action_middle_selected.9.png b/res/drawable-hdpi/btn_dial_action_middle_selected.9.png
deleted file mode 100644
index 678d9e0..0000000
--- a/res/drawable-hdpi/btn_dial_action_middle_selected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/btn_dial_action_right_disable.9.png b/res/drawable-hdpi/btn_dial_action_right_disable.9.png
deleted file mode 100644
index 4844ee2..0000000
--- a/res/drawable-hdpi/btn_dial_action_right_disable.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/btn_dial_action_right_disable_focused.9.png b/res/drawable-hdpi/btn_dial_action_right_disable_focused.9.png
deleted file mode 100644
index f25cbc6..0000000
--- a/res/drawable-hdpi/btn_dial_action_right_disable_focused.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/btn_dial_action_right_normal.9.png b/res/drawable-hdpi/btn_dial_action_right_normal.9.png
deleted file mode 100644
index 54896a3..0000000
--- a/res/drawable-hdpi/btn_dial_action_right_normal.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/btn_dial_action_right_pressed.9.png b/res/drawable-hdpi/btn_dial_action_right_pressed.9.png
deleted file mode 100644
index 27eddd3..0000000
--- a/res/drawable-hdpi/btn_dial_action_right_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/btn_dial_action_right_selected.9.png b/res/drawable-hdpi/btn_dial_action_right_selected.9.png
deleted file mode 100644
index 131f1c4..0000000
--- a/res/drawable-hdpi/btn_dial_action_right_selected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/dial_num_1_no_vm_blk.png b/res/drawable-hdpi/dial_num_1_no_vm_blk.png
deleted file mode 100644
index 8415b05..0000000
--- a/res/drawable-hdpi/dial_num_1_no_vm_blk.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/dial_num_1_no_vm_wht.png b/res/drawable-hdpi/dial_num_1_no_vm_wht.png
deleted file mode 100644
index beaca97..0000000
--- a/res/drawable-hdpi/dial_num_1_no_vm_wht.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_call_log_header_incoming_call.png b/res/drawable-hdpi/ic_call_log_header_incoming_call.png
deleted file mode 100755
index 95c0255..0000000
--- a/res/drawable-hdpi/ic_call_log_header_incoming_call.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_call_log_header_missed_call.png b/res/drawable-hdpi/ic_call_log_header_missed_call.png
deleted file mode 100755
index 0a43e69..0000000
--- a/res/drawable-hdpi/ic_call_log_header_missed_call.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_call_log_header_outgoing_call.png b/res/drawable-hdpi/ic_call_log_header_outgoing_call.png
deleted file mode 100755
index d061ba3..0000000
--- a/res/drawable-hdpi/ic_call_log_header_outgoing_call.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_call_log_list_action_call.png b/res/drawable-hdpi/ic_call_log_list_action_call.png
deleted file mode 100644
index f47ada7..0000000
--- a/res/drawable-hdpi/ic_call_log_list_action_call.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/btn_dial_action_middle_disable.9.png b/res/drawable-mdpi/btn_dial_action_middle_disable.9.png
deleted file mode 100644
index e13b958..0000000
--- a/res/drawable-mdpi/btn_dial_action_middle_disable.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/btn_dial_action_middle_disable_focused.9.png b/res/drawable-mdpi/btn_dial_action_middle_disable_focused.9.png
deleted file mode 100644
index 7c7574f..0000000
--- a/res/drawable-mdpi/btn_dial_action_middle_disable_focused.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/btn_dial_action_middle_normal.9.png b/res/drawable-mdpi/btn_dial_action_middle_normal.9.png
deleted file mode 100644
index 575793c..0000000
--- a/res/drawable-mdpi/btn_dial_action_middle_normal.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/btn_dial_action_middle_pressed.9.png b/res/drawable-mdpi/btn_dial_action_middle_pressed.9.png
deleted file mode 100644
index ead7039..0000000
--- a/res/drawable-mdpi/btn_dial_action_middle_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/btn_dial_action_middle_selected.9.png b/res/drawable-mdpi/btn_dial_action_middle_selected.9.png
deleted file mode 100644
index 957b7b9..0000000
--- a/res/drawable-mdpi/btn_dial_action_middle_selected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/btn_dial_action_right_disable.9.png b/res/drawable-mdpi/btn_dial_action_right_disable.9.png
deleted file mode 100644
index de5c271..0000000
--- a/res/drawable-mdpi/btn_dial_action_right_disable.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/btn_dial_action_right_disable_focused.9.png b/res/drawable-mdpi/btn_dial_action_right_disable_focused.9.png
deleted file mode 100644
index 27bfc02..0000000
--- a/res/drawable-mdpi/btn_dial_action_right_disable_focused.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/btn_dial_action_right_normal.9.png b/res/drawable-mdpi/btn_dial_action_right_normal.9.png
deleted file mode 100644
index 515e4f4..0000000
--- a/res/drawable-mdpi/btn_dial_action_right_normal.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/btn_dial_action_right_pressed.9.png b/res/drawable-mdpi/btn_dial_action_right_pressed.9.png
deleted file mode 100644
index 054ebef..0000000
--- a/res/drawable-mdpi/btn_dial_action_right_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/btn_dial_action_right_selected.9.png b/res/drawable-mdpi/btn_dial_action_right_selected.9.png
deleted file mode 100644
index 9c0a76b..0000000
--- a/res/drawable-mdpi/btn_dial_action_right_selected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/dial_num_1_no_vm_blk.png b/res/drawable-mdpi/dial_num_1_no_vm_blk.png
deleted file mode 100644
index 75a8ed8..0000000
--- a/res/drawable-mdpi/dial_num_1_no_vm_blk.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/dial_num_1_no_vm_wht.png b/res/drawable-mdpi/dial_num_1_no_vm_wht.png
deleted file mode 100644
index 8871de5..0000000
--- a/res/drawable-mdpi/dial_num_1_no_vm_wht.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_call_log_header_incoming_call.png b/res/drawable-mdpi/ic_call_log_header_incoming_call.png
deleted file mode 100644
index 8b75287..0000000
--- a/res/drawable-mdpi/ic_call_log_header_incoming_call.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_call_log_header_missed_call.png b/res/drawable-mdpi/ic_call_log_header_missed_call.png
deleted file mode 100644
index 94dd69f..0000000
--- a/res/drawable-mdpi/ic_call_log_header_missed_call.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_call_log_header_outgoing_call.png b/res/drawable-mdpi/ic_call_log_header_outgoing_call.png
deleted file mode 100644
index bdedc67..0000000
--- a/res/drawable-mdpi/ic_call_log_header_outgoing_call.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_call_log_list_action_call.png b/res/drawable-mdpi/ic_call_log_list_action_call.png
deleted file mode 100644
index f47ada7..0000000
--- a/res/drawable-mdpi/ic_call_log_list_action_call.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/btn_dial_action_middle_disable.9.png b/res/drawable-xhdpi/btn_dial_action_middle_disable.9.png
deleted file mode 100644
index 6da4265..0000000
--- a/res/drawable-xhdpi/btn_dial_action_middle_disable.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/btn_dial_action_middle_disable_focused.9.png b/res/drawable-xhdpi/btn_dial_action_middle_disable_focused.9.png
deleted file mode 100644
index cddf893..0000000
--- a/res/drawable-xhdpi/btn_dial_action_middle_disable_focused.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/btn_dial_action_middle_normal.9.png b/res/drawable-xhdpi/btn_dial_action_middle_normal.9.png
deleted file mode 100644
index dc39b98..0000000
--- a/res/drawable-xhdpi/btn_dial_action_middle_normal.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/btn_dial_action_middle_pressed.9.png b/res/drawable-xhdpi/btn_dial_action_middle_pressed.9.png
deleted file mode 100644
index f092867..0000000
--- a/res/drawable-xhdpi/btn_dial_action_middle_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/btn_dial_action_middle_selected.9.png b/res/drawable-xhdpi/btn_dial_action_middle_selected.9.png
deleted file mode 100644
index 9577eda..0000000
--- a/res/drawable-xhdpi/btn_dial_action_middle_selected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/btn_dial_action_right_disable.9.png b/res/drawable-xhdpi/btn_dial_action_right_disable.9.png
deleted file mode 100644
index fdcd395..0000000
--- a/res/drawable-xhdpi/btn_dial_action_right_disable.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/btn_dial_action_right_disable_focused.9.png b/res/drawable-xhdpi/btn_dial_action_right_disable_focused.9.png
deleted file mode 100644
index 9f4eeb0..0000000
--- a/res/drawable-xhdpi/btn_dial_action_right_disable_focused.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/btn_dial_action_right_normal.9.png b/res/drawable-xhdpi/btn_dial_action_right_normal.9.png
deleted file mode 100644
index c6f7e09..0000000
--- a/res/drawable-xhdpi/btn_dial_action_right_normal.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/btn_dial_action_right_pressed.9.png b/res/drawable-xhdpi/btn_dial_action_right_pressed.9.png
deleted file mode 100644
index bf99581..0000000
--- a/res/drawable-xhdpi/btn_dial_action_right_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/btn_dial_action_right_selected.9.png b/res/drawable-xhdpi/btn_dial_action_right_selected.9.png
deleted file mode 100644
index 5c06f99..0000000
--- a/res/drawable-xhdpi/btn_dial_action_right_selected.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/dial_num_1_no_vm_blk.png b/res/drawable-xhdpi/dial_num_1_no_vm_blk.png
deleted file mode 100644
index 452eed0..0000000
--- a/res/drawable-xhdpi/dial_num_1_no_vm_blk.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/dial_num_1_no_vm_wht.png b/res/drawable-xhdpi/dial_num_1_no_vm_wht.png
deleted file mode 100644
index 37d90be..0000000
--- a/res/drawable-xhdpi/dial_num_1_no_vm_wht.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_call_log_header_incoming_call.png b/res/drawable-xhdpi/ic_call_log_header_incoming_call.png
deleted file mode 100644
index cae35d1..0000000
--- a/res/drawable-xhdpi/ic_call_log_header_incoming_call.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_call_log_header_missed_call.png b/res/drawable-xhdpi/ic_call_log_header_missed_call.png
deleted file mode 100644
index cb7395c..0000000
--- a/res/drawable-xhdpi/ic_call_log_header_missed_call.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_call_log_header_outgoing_call.png b/res/drawable-xhdpi/ic_call_log_header_outgoing_call.png
deleted file mode 100644
index a17bdf3..0000000
--- a/res/drawable-xhdpi/ic_call_log_header_outgoing_call.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable/btn_dial_textfield_active.xml b/res/drawable/btn_dial_textfield_active.xml
deleted file mode 100644
index f3af301..0000000
--- a/res/drawable/btn_dial_textfield_active.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?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_pressed="true"
- android:drawable="@drawable/btn_dial_textfield_pressed" />
- <item android:state_focused="true"
- android:drawable="@drawable/btn_dial_textfield_selected" />
- <item
- android:drawable="@drawable/btn_dial_textfield_activated" />
-</selector>
-
diff --git a/res/layout/call_log_action_group.xml b/res/layout/call_log_action_group.xml
deleted file mode 100644
index fa6bb79..0000000
--- a/res/layout/call_log_action_group.xml
+++ /dev/null
@@ -1,40 +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">
-
- <ImageView
- android:id="@+id/groupIndicator"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:paddingLeft="12dip"
- android:paddingRight="13dip"
- android:layout_alignParentRight="true"
- android:gravity="center_vertical"
- android:src="@*android:drawable/expander_ic_minimized"
- />
-
- <View android:id="@+id/divider"
- android:layout_width="1px"
- android:layout_height="match_parent"
- android:layout_marginTop="5dip"
- android:layout_marginBottom="5dip"
- android:layout_toLeftOf="@id/groupIndicator"
- android:layout_marginLeft="11dip"
- android:background="@drawable/divider_vertical_dark"
- />
-
-</merge>
diff --git a/res/layout/edit_date_picker.xml b/res/layout/edit_date_picker.xml
index ca5e281..c18d607 100644
--- a/res/layout/edit_date_picker.xml
+++ b/res/layout/edit_date_picker.xml
@@ -23,5 +23,6 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="@dimen/editor_field_left_padding"
+ android:layout_marginRight="@dimen/editor_field_right_padding"
android:textAppearance="?android:attr/textAppearanceMedium"
style="@android:style/Widget.Holo.Light.Spinner" />
\ No newline at end of file
diff --git a/res/layout/edit_field_list.xml b/res/layout/edit_field_list.xml
index ba715c7..f9e6565 100644
--- a/res/layout/edit_field_list.xml
+++ b/res/layout/edit_field_list.xml
@@ -23,4 +23,5 @@
android:layout_weight="1"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/editor_field_left_padding"
+ android:paddingRight="@dimen/editor_field_right_padding"
android:orientation="vertical" />
\ No newline at end of file
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 207a255..3bc1bc6 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -50,6 +50,9 @@
<!-- Left padding of a field in the Editor -->
<dimen name="editor_field_left_padding">5dip</dimen>
+ <!-- Right padding of a field in the Editor -->
+ <dimen name="editor_field_right_padding">5dip</dimen>
+
<!-- Top padding of a field in the Editor -->
<dimen name="editor_field_top_padding">10dip</dimen>
diff --git a/src/com/android/contacts/activities/PeopleActivity.java b/src/com/android/contacts/activities/PeopleActivity.java
index 77b978d..9dfa972 100644
--- a/src/com/android/contacts/activities/PeopleActivity.java
+++ b/src/com/android/contacts/activities/PeopleActivity.java
@@ -90,6 +90,7 @@
import android.widget.Toast;
import java.util.ArrayList;
+import java.util.concurrent.atomic.AtomicInteger;
/**
* Displays a list to browse contacts. For xlarge screens, this also displays a detail-pane on
@@ -101,6 +102,7 @@
ContactListFilterController.ContactListFilterListener, ProviderStatusListener {
private static final String TAG = "PeopleActivity";
+ private static final Boolean DEBUG = false; // DO NOT SUBMIT WITH TRUE
private static final int SUBACTIVITY_NEW_CONTACT = 2;
private static final int SUBACTIVITY_EDIT_CONTACT = 3;
@@ -182,13 +184,24 @@
*/
private boolean mFragmentInitialized;
+ /** Sequential ID assigned to each instance; used for logging */
+ private final int mInstanceId;
+ private static final AtomicInteger sNextInstanceId = new AtomicInteger();
+
public PeopleActivity() {
+ mInstanceId = sNextInstanceId.getAndIncrement();
mIntentResolver = new ContactsIntentResolver(this);
mContactListFilterController = new ContactListFilterController(this);
mContactListFilterController.addListener(this);
mProviderStatusLoader = new ProviderStatusLoader(this);
}
+ @Override
+ public String toString() {
+ // Shown on logcat
+ return String.format("%s@%d", getClass().getSimpleName(), mInstanceId);
+ }
+
public boolean areContactsAvailable() {
return mProviderStatus == ProviderStatus.STATUS_NORMAL;
}
@@ -225,7 +238,7 @@
protected void onCreate(Bundle savedState) {
super.onCreate(savedState);
- if (!processIntent()) {
+ if (!processIntent(false)) {
finish();
return;
}
@@ -237,7 +250,7 @@
@Override
protected void onNewIntent(Intent intent) {
setIntent(intent);
- if (!processIntent()) {
+ if (!processIntent(true)) {
finish();
return;
}
@@ -252,13 +265,18 @@
* Resolve the intent and initialize {@link #mRequest}, and launch another activity if redirect
* is needed.
*
+ * @param forNewIntent set true if it's called from {@link #onNewIntent(Intent)}.
* @return {@code true} if {@link PeopleActivity} should continue running. {@code false}
* if it shouldn't, in which case the caller should finish() itself and shouldn't do
* farther initialization.
*/
- private boolean processIntent() {
+ private boolean processIntent(boolean forNewIntent) {
// Extract relevant information from the intent
mRequest = mIntentResolver.resolveIntent(getIntent());
+ if (DEBUG) {
+ Log.d(TAG, this + " processIntent: forNewIntent=" + forNewIntent
+ + " intent=" + getIntent() + " request=" + mRequest);
+ }
if (!mRequest.isValid()) {
setResult(RESULT_CANCELED);
return false;
diff --git a/src/com/android/contacts/calllog/CallLogFragment.java b/src/com/android/contacts/calllog/CallLogFragment.java
index bf70e67..d3d74a7 100644
--- a/src/com/android/contacts/calllog/CallLogFragment.java
+++ b/src/com/android/contacts/calllog/CallLogFragment.java
@@ -272,8 +272,7 @@
resources.getDrawable(R.drawable.ic_call_outgoing_holo_dark),
resources.getDrawable(R.drawable.ic_call_missed_holo_dark),
resources.getDrawable(R.drawable.ic_call_voicemail_holo_dark));
- Drawable callDrawable = resources.getDrawable(
- R.drawable.ic_call_log_list_action_call);
+ Drawable callDrawable = resources.getDrawable(R.drawable.ic_dial_action_call);
Drawable playDrawable = resources.getDrawable(
R.drawable.ic_call_log_list_action_play);
diff --git a/src/com/android/contacts/editor/EventFieldEditorView.java b/src/com/android/contacts/editor/EventFieldEditorView.java
index bf93d26..41d564a 100644
--- a/src/com/android/contacts/editor/EventFieldEditorView.java
+++ b/src/com/android/contacts/editor/EventFieldEditorView.java
@@ -106,6 +106,9 @@
String data = DateUtils.formatDate(getContext(), getEntry().getAsString(column));
if (TextUtils.isEmpty(data)) {
data = " ";
+ setDeleteButtonVisible(false);
+ } else {
+ setDeleteButtonVisible(true);
}
mDateView.setText(data);
}
diff --git a/src/com/android/contacts/editor/KindSectionView.java b/src/com/android/contacts/editor/KindSectionView.java
index b472279..8ca7a05 100644
--- a/src/com/android/contacts/editor/KindSectionView.java
+++ b/src/com/android/contacts/editor/KindSectionView.java
@@ -194,9 +194,9 @@
if (view instanceof Editor) {
Editor editor = (Editor) view;
+ editor.setDeletable(true);
editor.setValues(mKind, entry, mState, mReadOnly, mViewIdGenerator);
editor.setEditorListener(this);
- editor.setDeletable(true);
}
mEditors.addView(view);
return view;
diff --git a/src/com/android/contacts/editor/LabeledEditorView.java b/src/com/android/contacts/editor/LabeledEditorView.java
index af5ae65..ddecf5a 100644
--- a/src/com/android/contacts/editor/LabeledEditorView.java
+++ b/src/com/android/contacts/editor/LabeledEditorView.java
@@ -73,6 +73,7 @@
private EntityDelta mState;
private boolean mReadOnly;
private boolean mWasEmpty = true;
+ private boolean mIsDeletable = true;
private EditType mType;
@@ -185,8 +186,8 @@
/**
* Creates or removes the remove button. Doesn't do anything if already correctly configured
*/
- private void setupDeleteButton(boolean shouldExist) {
- if (shouldExist) {
+ private void setupDeleteButton() {
+ if (mIsDeletable) {
mDeleteContainer.setVisibility(View.VISIBLE);
mDelete.setEnabled(!mReadOnly && isEnabled());
} else {
@@ -194,6 +195,12 @@
}
}
+ public void setDeleteButtonVisible(boolean visible) {
+ if (mIsDeletable) {
+ mDeleteContainer.setVisibility(visible ? View.VISIBLE : View.GONE);
+ }
+ }
+
protected void onOptionalFieldVisibilityChange() {
if (mListener != null) {
mListener.onRequest(EditorListener.EDITOR_FORM_CHANGED);
@@ -207,7 +214,8 @@
@Override
public void setDeletable(boolean deletable) {
- setupDeleteButton(deletable);
+ mIsDeletable = deletable;
+ setupDeleteButton();
}
@Override
@@ -267,8 +275,10 @@
if (mWasEmpty != isEmpty) {
if (isEmpty) {
mListener.onRequest(EditorListener.FIELD_TURNED_EMPTY);
+ if (mIsDeletable) mDeleteContainer.setVisibility(View.GONE);
} else {
mListener.onRequest(EditorListener.FIELD_TURNED_NON_EMPTY);
+ if (mIsDeletable) mDeleteContainer.setVisibility(View.VISIBLE);
}
mWasEmpty = isEmpty;
}
diff --git a/src/com/android/contacts/editor/TextFieldsEditorView.java b/src/com/android/contacts/editor/TextFieldsEditorView.java
index a689a0c..ad1c7b6 100644
--- a/src/com/android/contacts/editor/TextFieldsEditorView.java
+++ b/src/com/android/contacts/editor/TextFieldsEditorView.java
@@ -195,6 +195,9 @@
final String value = entry.getAsString(column);
fieldView.setText(value);
+ // Show the delete button if we have a non-null value
+ setDeleteButtonVisible(value != null);
+
// Prepare listener for writing changes
fieldView.addTextChangedListener(new TextWatcher() {
@Override
diff --git a/src/com/android/contacts/list/ContactsRequest.java b/src/com/android/contacts/list/ContactsRequest.java
index 469cd1d..b7e21b4 100644
--- a/src/com/android/contacts/list/ContactsRequest.java
+++ b/src/com/android/contacts/list/ContactsRequest.java
@@ -89,6 +89,22 @@
private boolean mDirectorySearchEnabled = true;
private Uri mContactUri;
+ @Override
+ public String toString() {
+ return "{ContactsRequest:mValid=" + mValid
+ + " mActionCode=" + mActionCode
+ + " mRedirectIntent=" + mRedirectIntent
+ + " mTitle=" + mTitle
+ + " mSearchMode=" + mSearchMode
+ + " mQueryString=" + mQueryString
+ + " mIncludeProfile=" + mIncludeProfile
+ + " mGroupName=" + mGroupName
+ + " mLegacyCompatibilityMode=" + mLegacyCompatibilityMode
+ + " mDirectorySearchEnabled=" + mDirectorySearchEnabled
+ + " mContactUri=" + mContactUri
+ + "}";
+ }
+
/**
* Copies all fields.
*/
diff --git a/tests/src/com/android/contacts/activities/CallLogActivityTests.java b/tests/src/com/android/contacts/activities/CallLogActivityTests.java
index adca61d..8900c5e 100644
--- a/tests/src/com/android/contacts/activities/CallLogActivityTests.java
+++ b/tests/src/com/android/contacts/activities/CallLogActivityTests.java
@@ -178,7 +178,6 @@
View view = mAdapter.newStandAloneView(getActivity(), mParentView);
mAdapter.bindStandAloneView(view, getActivity(), mCursor);
assertNotNull(view.findViewById(R.id.call_icon));
- assertNull(view.findViewById(R.id.groupIndicator));
}
@MediumTest
@@ -188,7 +187,6 @@
View view = mAdapter.newChildView(getActivity(), mParentView);
mAdapter.bindChildView(view, getActivity(), mCursor);
assertNotNull(view.findViewById(R.id.call_icon));
- assertNull(view.findViewById(R.id.groupIndicator));
}
@MediumTest