Merge "Contact editor assets and redlines"
diff --git a/res/drawable-hdpi/account_spinner_icon.png b/res/drawable-hdpi/account_spinner_icon.png
new file mode 100644
index 0000000..3e82e51
--- /dev/null
+++ b/res/drawable-hdpi/account_spinner_icon.png
Binary files differ
diff --git a/res/drawable-mdpi/account_spinner_icon.png b/res/drawable-mdpi/account_spinner_icon.png
new file mode 100644
index 0000000..d9aaf02
--- /dev/null
+++ b/res/drawable-mdpi/account_spinner_icon.png
Binary files differ
diff --git a/res/drawable-xhdpi/account_spinner_icon.png b/res/drawable-xhdpi/account_spinner_icon.png
new file mode 100644
index 0000000..8b888cb
--- /dev/null
+++ b/res/drawable-xhdpi/account_spinner_icon.png
Binary files differ
diff --git a/res/layout-sw580dp/text_fields_editor_view.xml b/res/layout-sw580dp/text_fields_editor_view.xml
index ecc9dd2..89970c6 100644
--- a/res/layout-sw580dp/text_fields_editor_view.xml
+++ b/res/layout-sw580dp/text_fields_editor_view.xml
@@ -18,7 +18,6 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="-4dip"
android:orientation="vertical">
<LinearLayout
diff --git a/res/layout/edit_date_picker.xml b/res/layout/edit_date_picker.xml
index 5122bbe..1d0d0b6 100644
--- a/res/layout/edit_date_picker.xml
+++ b/res/layout/edit_date_picker.xml
@@ -21,9 +21,10 @@
android:id="@+id/date_view"
style="?android:attr/spinnerStyle"
android:layout_width="0dip"
- android:layout_height="wrap_content"
+ android:layout_height="@dimen/editor_min_line_item_height"
android:layout_weight="1"
+ android:gravity="center_vertical"
android:layout_marginLeft="@dimen/editor_field_left_padding"
android:layout_marginRight="@dimen/editor_field_right_padding"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:paddingLeft="16dip" />
\ No newline at end of file
+ android:paddingLeft="12dip" />
\ No newline at end of file
diff --git a/res/layout/edit_delete_button.xml b/res/layout/edit_delete_button.xml
index ed3f4d6..32b0580 100644
--- a/res/layout/edit_delete_button.xml
+++ b/res/layout/edit_delete_button.xml
@@ -20,6 +20,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="@dimen/editor_min_line_item_height"
+ android:layout_marginRight="2dip"
android:layout_gravity="top">
<ImageView
android:id="@+id/delete_button"
diff --git a/res/layout/edit_expansion_view.xml b/res/layout/edit_expansion_view.xml
index 267593d..06d809c 100644
--- a/res/layout/edit_expansion_view.xml
+++ b/res/layout/edit_expansion_view.xml
@@ -19,12 +19,13 @@
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
- android:layout_height="match_parent">
+ android:layout_height="@dimen/editor_min_line_item_height"
+ android:layout_gravity="top">
<ImageView
android:id="@+id/expansion_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="top"
+ android:layout_gravity="center"
android:duplicateParentState="true"
android:background="?android:attr/selectableItemBackground"
android:paddingLeft="@dimen/editor_round_button_padding_left"
diff --git a/res/layout/edit_spinner.xml b/res/layout/edit_spinner.xml
index 0f3ed23..b986913 100644
--- a/res/layout/edit_spinner.xml
+++ b/res/layout/edit_spinner.xml
@@ -23,5 +23,5 @@
android:layout_gravity="top"
android:layout_width="@dimen/editor_type_label_width"
android:layout_height="@dimen/editor_min_line_item_height"
- android:paddingLeft="8dip"
- android:paddingRight="20dip"/>
\ No newline at end of file
+ android:paddingLeft="0dip"
+ android:paddingRight="10dip"/>
\ No newline at end of file
diff --git a/res/layout/editor_account_header.xml b/res/layout/editor_account_header.xml
index dd4bc30..b6b19db 100644
--- a/res/layout/editor_account_header.xml
+++ b/res/layout/editor_account_header.xml
@@ -25,7 +25,7 @@
android:paddingTop="8dip"
android:paddingBottom="8dip"
android:paddingLeft="@dimen/account_container_left_padding"
- android:paddingRight="16dip">
+ android:paddingRight="32dip">
<LinearLayout
android:id="@+id/account"
diff --git a/res/layout/editor_account_header_with_dropdown.xml b/res/layout/editor_account_header_with_dropdown.xml
new file mode 100644
index 0000000..74abee9
--- /dev/null
+++ b/res/layout/editor_account_header_with_dropdown.xml
@@ -0,0 +1,71 @@
+<?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.
+-->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/account_container"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:minHeight="48dip"
+ android:background="#EEEEEE"
+ android:orientation="horizontal"
+ android:paddingLeft="@dimen/account_container_left_padding"
+ android:paddingRight="32dip">
+
+ <LinearLayout
+ android:id="@+id/account"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:orientation="vertical"
+ style="?android:attr/spinnerStyle">
+
+ <TextView
+ android:id="@+id/account_type"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:singleLine="true" />
+
+ <TextView
+ android:id="@+id/account_name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingRight="8dip"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="?android:attr/textColorTertiary"
+ android:singleLine="true" />
+
+ </LinearLayout>
+
+ <!-- Spacer between the account type / name dropdown and the account icon -->
+ <View
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="1"/>
+
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
+
+ <ImageView
+ android:id="@+id/account_icon"
+ android:layout_width="32dip"
+ android:layout_height="32dip"
+ android:layout_gravity="center_vertical" />
+
+ </FrameLayout>
+
+</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/event_field_editor_view.xml b/res/layout/event_field_editor_view.xml
index 6903772..560b9e1 100644
--- a/res/layout/event_field_editor_view.xml
+++ b/res/layout/event_field_editor_view.xml
@@ -19,7 +19,7 @@
<com.android.contacts.editor.EventFieldEditorView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_height="@dimen/editor_min_line_item_height"
android:orientation="vertical">
<LinearLayout
@@ -38,10 +38,10 @@
<Spinner
android:id="@+id/spinner"
android:layout_width="@dimen/editor_type_label_width"
- android:layout_height="wrap_content"
- android:paddingLeft="5dip"
- android:paddingRight="20dip"
+ android:layout_height="match_parent"
android:layout_gravity="bottom"
+ android:paddingLeft="0dip"
+ android:paddingRight="10dip"
android:visibility="gone"/>
<include
diff --git a/res/layout/external_raw_contact_editor_view.xml b/res/layout/external_raw_contact_editor_view.xml
index 24e8322..a1e0754 100644
--- a/res/layout/external_raw_contact_editor_view.xml
+++ b/res/layout/external_raw_contact_editor_view.xml
@@ -43,17 +43,24 @@
android:textColor="?android:attr/textColorSecondary"
android:textStyle="bold"/>
- <FrameLayout
+ <LinearLayout
android:id="@+id/stub_photo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginRight="8dip">
+ android:layout_marginRight="8dip"
+ android:orientation="horizontal">
<include
android:id="@+id/edit_photo"
layout="@layout/item_photo_editor" />
- </FrameLayout>
+ <ImageView
+ android:src="@drawable/account_spinner_icon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom" />
+
+ </LinearLayout>
</LinearLayout>
diff --git a/res/layout/item_group_membership.xml b/res/layout/item_group_membership.xml
index b6d11f2..57eda71 100644
--- a/res/layout/item_group_membership.xml
+++ b/res/layout/item_group_membership.xml
@@ -27,13 +27,13 @@
style="?android:attr/spinnerStyle"
android:id="@+id/group_list"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_height="@dimen/editor_min_line_item_height"
android:layout_marginLeft="@dimen/editor_field_left_padding"
android:layout_marginRight="@dimen/editor_field_left_padding"
android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="left|center_vertical"
android:ellipsize="end"
android:focusable="true"
- android:paddingLeft="16dip" />
+ android:paddingLeft="12dip" />
</com.android.contacts.editor.GroupMembershipView>
diff --git a/res/layout/item_photo_editor.xml b/res/layout/item_photo_editor.xml
index a41b007..7cfb35d 100644
--- a/res/layout/item_photo_editor.xml
+++ b/res/layout/item_photo_editor.xml
@@ -17,8 +17,8 @@
<view
class="com.android.contacts.editor.PhotoEditorView"
xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="42dip"
- android:layout_height="42dip"
+ android:layout_width="48dip"
+ android:layout_height="48dip"
>
<ImageView
android:id="@+id/photo"
diff --git a/res/layout/raw_contact_editor_view.xml b/res/layout/raw_contact_editor_view.xml
index 66feb27..5180557 100644
--- a/res/layout/raw_contact_editor_view.xml
+++ b/res/layout/raw_contact_editor_view.xml
@@ -22,7 +22,7 @@
android:paddingTop="@dimen/editor_padding_top">
<include
- layout="@layout/editor_account_header" />
+ layout="@layout/editor_account_header_with_dropdown" />
<LinearLayout
android:id="@+id/body"
@@ -52,17 +52,24 @@
</LinearLayout>
- <FrameLayout
+ <LinearLayout
android:id="@+id/stub_photo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginRight="16dip">
+ android:layout_marginRight="8dip"
+ android:orientation="horizontal">
<include
android:id="@+id/edit_photo"
layout="@layout/item_photo_editor" />
- </FrameLayout>
+ <ImageView
+ android:src="@drawable/account_spinner_icon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom" />
+
+ </LinearLayout>
</LinearLayout>
diff --git a/res/layout/text_fields_editor_view.xml b/res/layout/text_fields_editor_view.xml
index e187a9e..f446c24 100644
--- a/res/layout/text_fields_editor_view.xml
+++ b/res/layout/text_fields_editor_view.xml
@@ -18,7 +18,6 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="-2dip"
android:orientation="vertical">
<LinearLayout
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 32de03c..13bb791 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -33,10 +33,10 @@
<dimen name="editor_padding_top">0dip</dimen>
<!-- Padding of the rounded plus/minus/expand/collapse buttons in the editor -->
- <dimen name="editor_round_button_padding_left">2dip</dimen>
- <dimen name="editor_round_button_padding_right">2dip</dimen>
- <dimen name="editor_round_button_padding_top">4dip</dimen>
- <dimen name="editor_round_button_padding_bottom">4dip</dimen>
+ <dimen name="editor_round_button_padding_left">8dip</dimen>
+ <dimen name="editor_round_button_padding_right">8dip</dimen>
+ <dimen name="editor_round_button_padding_top">8dip</dimen>
+ <dimen name="editor_round_button_padding_bottom">8dip</dimen>
<!-- Left padding of the kind title in the contact editor -->
<dimen name="editor_kind_title_left_padding">8dip</dimen>
diff --git a/src/com/android/contacts/editor/ContactEditorFragment.java b/src/com/android/contacts/editor/ContactEditorFragment.java
index 21ac3bb..9abcef1 100644
--- a/src/com/android/contacts/editor/ContactEditorFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorFragment.java
@@ -670,6 +670,8 @@
} else {
disableAccountSwitcher(editor);
}
+ } else {
+ disableAccountSwitcher(editor);
}
editor.setEnabled(mEnabled);
diff --git a/src/com/android/contacts/editor/LabeledEditorView.java b/src/com/android/contacts/editor/LabeledEditorView.java
index 1bea060..ff0af6f 100644
--- a/src/com/android/contacts/editor/LabeledEditorView.java
+++ b/src/com/android/contacts/editor/LabeledEditorView.java
@@ -35,6 +35,7 @@
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
+import android.text.TextUtils.TruncateAt;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.LayoutInflater;
@@ -515,6 +516,7 @@
textView.setGravity(Gravity.RIGHT | Gravity.CENTER_VERTICAL);
textView.setTextAppearance(mContext, android.R.style.TextAppearance_Small);
textView.setTextColor(mTextColor);
+ textView.setEllipsize(TruncateAt.MIDDLE);
} else {
textView = (TextView) convertView;
}