Merge "Put the call log into a fragment and host it in a simple container activity"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index d3a9b63..83331da 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -45,11 +45,9 @@
android:hardwareAccelerated="true"
>
- <!-- A virtual 12 key dialer. This definition is only used internally, so that we can use
- the activity inside of a TabActivity -->
+ <!-- A virtual 12 key dialer -->
<activity android:name=".activities.DialpadActivity"
android:launchMode="singleTop"
- android:exported="false"
>
<intent-filter>
<action android:name="com.android.phone.action.TOUCH_DIALER" />
@@ -58,11 +56,9 @@
</intent-filter>
</activity>
- <!-- A list of recent calls. This definition is only used internally, so that we can use
- the activity inside of a TabActivity -->
+ <!-- A list of recent calls -->
<activity android:name=".activities.CallLogActivity"
android:label="@string/recentCallsIconLabel"
- android:exported="false"
>
<intent-filter>
<action android:name="com.android.phone.action.RECENT_CALLS" />
diff --git a/res/layout-xlarge-land/contact_detail_list_item.xml b/res/layout-xlarge-land/contact_detail_list_item.xml
index 326e7b6..9ad0e1b 100644
--- a/res/layout-xlarge-land/contact_detail_list_item.xml
+++ b/res/layout-xlarge-land/contact_detail_list_item.xml
@@ -63,7 +63,7 @@
android:id="@+id/data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceLarge" />
+ android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/footer"
diff --git a/res/layout-xlarge/edit_spinner.xml b/res/layout-xlarge/edit_spinner.xml
new file mode 100644
index 0000000..f1909fe
--- /dev/null
+++ b/res/layout-xlarge/edit_spinner.xml
@@ -0,0 +1,27 @@
+<?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.
+-->
+
+<!-- Spinner for a field in the contact editor. -->
+
+<Spinner
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/spinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="@dimen/editor_field_left_padding"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:paddingLeft="5dip"
+ android:paddingTop="5dip"/>
\ No newline at end of file
diff --git a/res/layout-xlarge/event_field_editor_view.xml b/res/layout-xlarge/event_field_editor_view.xml
index 2deb551..c9eef08 100644
--- a/res/layout-xlarge/event_field_editor_view.xml
+++ b/res/layout-xlarge/event_field_editor_view.xml
@@ -24,10 +24,6 @@
android:orientation="vertical">
<include
- android:id="@+id/divider"
- layout="@layout/edit_divider" />
-
- <include
android:id="@+id/title"
layout="@layout/edit_field_title" />
@@ -36,7 +32,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
- android:gravity="center_vertical"
+ android:gravity="bottom"
android:focusable="true"
android:clickable="true">
@@ -47,6 +43,7 @@
<include
android:id="@+id/spinner"
layout="@layout/edit_spinner"
+ android:paddingTop="15dip"
android:visibility="gone" />
<include
diff --git a/res/layout-xlarge/item_kind_section.xml b/res/layout-xlarge/item_kind_section.xml
index 5ca85a9..f0ae1dc 100644
--- a/res/layout-xlarge/item_kind_section.xml
+++ b/res/layout-xlarge/item_kind_section.xml
@@ -20,6 +20,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:paddingBottom="@dimen/editor_field_bottom_padding"
android:orientation="vertical">
<View
diff --git a/res/layout-xlarge/phonetic_name_editor_view.xml b/res/layout-xlarge/phonetic_name_editor_view.xml
index be36915..c3fa6a3 100644
--- a/res/layout-xlarge/phonetic_name_editor_view.xml
+++ b/res/layout-xlarge/phonetic_name_editor_view.xml
@@ -27,14 +27,6 @@
android:layout_marginBottom="4dip">
<include
- android:id="@+id/divider"
- layout="@layout/edit_divider" />
-
- <include
- android:id="@+id/title"
- layout="@layout/edit_field_title" />
-
- <include
android:id="@+id/spinner"
layout="@layout/edit_spinner"
android:visibility="gone" />
diff --git a/res/layout-xlarge/structured_name_editor_view.xml b/res/layout-xlarge/structured_name_editor_view.xml
index 87f788a..37b5536 100644
--- a/res/layout-xlarge/structured_name_editor_view.xml
+++ b/res/layout-xlarge/structured_name_editor_view.xml
@@ -27,14 +27,6 @@
android:layout_marginBottom="4dip">
<include
- android:id="@+id/divider"
- layout="@layout/edit_divider" />
-
- <include
- android:id="@+id/title"
- layout="@layout/edit_field_title" />
-
- <include
android:id="@+id/spinner"
layout="@layout/edit_spinner"
android:visibility="gone" />
diff --git a/res/layout-xlarge/text_fields_editor_view.xml b/res/layout-xlarge/text_fields_editor_view.xml
index 5e77a97..8be354b 100644
--- a/res/layout-xlarge/text_fields_editor_view.xml
+++ b/res/layout-xlarge/text_fields_editor_view.xml
@@ -22,10 +22,6 @@
android:orientation="vertical">
<include
- android:id="@+id/divider"
- layout="@layout/edit_divider" />
-
- <include
android:id="@+id/title"
layout="@layout/edit_field_title" />
@@ -45,6 +41,7 @@
<include
android:id="@+id/spinner"
layout="@layout/edit_spinner"
+ android:paddingTop="15dip"
android:visibility="gone" />
<include
diff --git a/res/layout/contact_detail_fragment.xml b/res/layout/contact_detail_fragment.xml
index 72a62db..70a9a28 100644
--- a/res/layout/contact_detail_fragment.xml
+++ b/res/layout/contact_detail_fragment.xml
@@ -24,7 +24,7 @@
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1"
- android:background="@drawable/title_bar_shadow"
+ android:background="@color/background_primary"
android:divider="@null"
/>
diff --git a/res/layout/contact_detail_header_view.xml b/res/layout/contact_detail_header_view.xml
index 9f87b26..80dcacc 100644
--- a/res/layout/contact_detail_header_view.xml
+++ b/res/layout/contact_detail_header_view.xml
@@ -52,7 +52,7 @@
android:singleLine="true"
android:ellipsize="end"
android:gravity="bottom"
- android:textSize="30sp"
+ android:textSize="@dimen/detail_header_name_text_size"
android:textColor="@color/detail_header_view_text_color"
android:textStyle="bold"
/>
diff --git a/res/layout/contact_detail_list_item.xml b/res/layout/contact_detail_list_item.xml
index c9067a6..2e4a3e5 100644
--- a/res/layout/contact_detail_list_item.xml
+++ b/res/layout/contact_detail_list_item.xml
@@ -46,7 +46,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingBottom="5dip"
- android:textAppearance="?android:attr/textAppearanceLarge" />
+ android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/footer"
diff --git a/res/layout/contact_editor_fragment.xml b/res/layout/contact_editor_fragment.xml
index 602f7f9..f3989e1 100644
--- a/res/layout/contact_editor_fragment.xml
+++ b/res/layout/contact_editor_fragment.xml
@@ -17,6 +17,7 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:background="@color/background_primary"
>
<ScrollView
diff --git a/res/layout/edit_add_field.xml b/res/layout/edit_add_field.xml
index 68a482c..1c8c740 100644
--- a/res/layout/edit_add_field.xml
+++ b/res/layout/edit_add_field.xml
@@ -18,7 +18,7 @@
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="10dip"
+ android:paddingLeft="13dip"
android:background="?android:attr/selectableItemBackground">
<TextView
android:id="@+id/add_text"
@@ -26,7 +26,7 @@
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorTertiary" />
<ImageView
android:id="@+id/add_button"
@@ -35,7 +35,5 @@
android:src="@drawable/ic_menu_add_field_holo_light"
android:paddingLeft="@dimen/editor_round_button_padding_left"
android:paddingRight="@dimen/editor_round_button_padding_right"
- android:paddingTop="@dimen/editor_round_button_padding_top"
- android:paddingBottom="@dimen/editor_round_button_padding_bottom"
android:contentDescription="@string/description_plus_button" />
</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/edit_date_picker.xml b/res/layout/edit_date_picker.xml
index a957bd9..ca5e281 100644
--- a/res/layout/edit_date_picker.xml
+++ b/res/layout/edit_date_picker.xml
@@ -22,5 +22,6 @@
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
- android:textAppearance="?android:attr/textAppearanceLarge"
- style="@android:style/Widget.Holo.Spinner" />
\ No newline at end of file
+ android:layout_marginLeft="@dimen/editor_field_left_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_delete_button.xml b/res/layout/edit_delete_button.xml
index 790163e..f05b0e4 100644
--- a/res/layout/edit_delete_button.xml
+++ b/res/layout/edit_delete_button.xml
@@ -19,7 +19,7 @@
<FrameLayout
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_height="wrap_content"
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 6368c4b..96fe8de 100644
--- a/res/layout/edit_expansion_view.xml
+++ b/res/layout/edit_expansion_view.xml
@@ -19,7 +19,7 @@
<FrameLayout
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_height="wrap_content"
android:layout_gravity="top">
<ImageView
android:id="@+id/expansion_view"
diff --git a/res/layout/edit_field_list.xml b/res/layout/edit_field_list.xml
index 448a1fd..ba715c7 100644
--- a/res/layout/edit_field_list.xml
+++ b/res/layout/edit_field_list.xml
@@ -22,5 +22,5 @@
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="wrap_content"
- android:paddingBottom="6dip"
+ android:paddingLeft="@dimen/editor_field_left_padding"
android:orientation="vertical" />
\ No newline at end of file
diff --git a/res/layout/edit_field_title.xml b/res/layout/edit_field_title.xml
index d8f6808..4918c4d 100644
--- a/res/layout/edit_field_title.xml
+++ b/res/layout/edit_field_title.xml
@@ -21,9 +21,9 @@
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:padding="@dimen/editor_field_title_padding"
+ android:paddingTop="@dimen/editor_field_top_padding"
+ android:paddingLeft="@dimen/editor_field_left_padding"
android:textAppearance="?android:attr/textAppearanceMedium"
android:singleLine="true"
android:ellipsize="marquee"
- android:fadingEdge="horizontal"
- android:textSize="@dimen/editor_field_title_text_size" />
\ No newline at end of file
+ android:fadingEdge="horizontal" />
\ No newline at end of file
diff --git a/res/layout/edit_spinner.xml b/res/layout/edit_spinner.xml
index 1511c8c..9e22ee7 100644
--- a/res/layout/edit_spinner.xml
+++ b/res/layout/edit_spinner.xml
@@ -19,10 +19,8 @@
<Spinner
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/spinner"
- android:layout_width="@dimen/editor_type_label_width"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="@color/kind_title"
- android:singleLine="true"
- android:ellipsize="marquee"
- android:fadingEdge="horizontal" />
\ No newline at end of file
+ android:layout_marginLeft="@dimen/editor_field_left_padding"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:paddingLeft="5dip"/>
\ 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 45fece9..6625279 100644
--- a/res/layout/event_field_editor_view.xml
+++ b/res/layout/event_field_editor_view.xml
@@ -20,14 +20,9 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:minHeight="?android:attr/listPreferredItemHeight"
android:orientation="vertical">
<include
- android:id="@+id/divider"
- layout="@layout/edit_divider" />
-
- <include
android:id="@+id/title"
layout="@layout/edit_field_title" />
diff --git a/res/layout/item_group_membership.xml b/res/layout/item_group_membership.xml
index 65730d4..cdf4e8a 100644
--- a/res/layout/item_group_membership.xml
+++ b/res/layout/item_group_membership.xml
@@ -21,11 +21,6 @@
android:minHeight="?android:attr/listPreferredItemHeight"
android:orientation="vertical">
- <View
- android:layout_width="match_parent"
- android:layout_height="1px"
- android:background="?android:attr/listDivider" />
-
<LinearLayout
android:id="@+id/kind_header"
android:layout_width="match_parent"
diff --git a/res/layout/item_kind_section.xml b/res/layout/item_kind_section.xml
index e290f09..6c6f960 100644
--- a/res/layout/item_kind_section.xml
+++ b/res/layout/item_kind_section.xml
@@ -20,7 +20,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:minHeight="?android:attr/listPreferredItemHeight"
+ android:paddingBottom="@dimen/editor_field_bottom_padding"
android:orientation="vertical">
<View
@@ -32,14 +32,9 @@
android:id="@+id/kind_editors"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingBottom="6dip"
android:orientation="vertical" />
<include
- android:id="@+id/divider"
- layout="@layout/edit_divider" />
-
- <include
android:id="@+id/add_field_footer"
layout="@layout/edit_add_field" />
diff --git a/res/layout/phonetic_name_editor_view.xml b/res/layout/phonetic_name_editor_view.xml
index 1f17f69..832ca2c 100644
--- a/res/layout/phonetic_name_editor_view.xml
+++ b/res/layout/phonetic_name_editor_view.xml
@@ -18,17 +18,8 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:minHeight="?android:attr/listPreferredItemHeight"
- android:orientation="vertical"
- android:paddingRight="?android:attr/scrollbarSize">
-
- <include
- android:id="@+id/divider"
- layout="@layout/edit_divider" />
-
- <include
- android:id="@+id/title"
- layout="@layout/edit_field_title" />
+ android:paddingBottom="@dimen/editor_field_bottom_padding"
+ android:orientation="vertical">
<include
android:id="@+id/spinner"
diff --git a/res/layout/structured_name_editor_view.xml b/res/layout/structured_name_editor_view.xml
index 039baa8..83efa6f 100644
--- a/res/layout/structured_name_editor_view.xml
+++ b/res/layout/structured_name_editor_view.xml
@@ -18,19 +18,13 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:minHeight="?android:attr/listPreferredItemHeight"
- android:orientation="vertical"
- android:paddingRight="?android:attr/scrollbarSize">
+ android:orientation="vertical">
<include
android:id="@+id/divider"
layout="@layout/edit_divider" />
<include
- android:id="@+id/title"
- layout="@layout/edit_field_title" />
-
- <include
android:id="@+id/spinner"
layout="@layout/edit_spinner"
android:visibility="gone" />
diff --git a/res/layout/text_fields_editor_view.xml b/res/layout/text_fields_editor_view.xml
index 8279ee7..d33e804 100644
--- a/res/layout/text_fields_editor_view.xml
+++ b/res/layout/text_fields_editor_view.xml
@@ -18,14 +18,9 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:minHeight="?android:attr/listPreferredItemHeight"
android:orientation="vertical">
<include
- android:id="@+id/divider"
- layout="@layout/edit_divider" />
-
- <include
android:id="@+id/title"
layout="@layout/edit_field_title" />
diff --git a/res/values-xlarge/dimens.xml b/res/values-xlarge/dimens.xml
index f156672..2d39186 100644
--- a/res/values-xlarge/dimens.xml
+++ b/res/values-xlarge/dimens.xml
@@ -18,6 +18,10 @@
<dimen name="aggregation_suggestion_icon_size">64dip</dimen>
<dimen name="editor_type_label_width">180dip</dimen>
<dimen name="editor_field_spinner_text_size">15sp</dimen>
+ <dimen name="editor_round_button_padding_left">8dip</dimen>
+ <dimen name="editor_round_button_padding_right">8dip</dimen>
+ <dimen name="editor_field_top_padding">12dip</dimen>
+ <dimen name="editor_field_bottom_padding">12dip</dimen>
<dimen name="detail_item_side_margin">19dip</dimen>
<dimen name="quick_contact_width">356dip</dimen>
<dimen name="contact_name_text_size">26sp</dimen>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index a9a6ccb..8aa0d71 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -21,6 +21,10 @@
<color name="quickcontact_disambig_divider">#afafaf</color>
<color name="edit_divider">#ff666666</color>
+
+ <!-- Color of the background of the contact detail and editor pages -->
+ <color name="background_primary">#FFFFFF</color>
+
<color name="background_secondary">#ff202020</color>
<color name="translucent_search_background">#cc000000</color>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 67e6d03..354bec7 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -35,16 +35,25 @@
<dimen name="quick_contact_width">352dip</dimen>
<!-- Padding of the rounded plus/minus/expand/collapse buttons in the editor -->
- <dimen name="editor_round_button_padding_left">8dip</dimen>
- <dimen name="editor_round_button_padding_right">8dip</dimen>
+ <dimen name="editor_round_button_padding_left">4dip</dimen>
+ <dimen name="editor_round_button_padding_right">4dip</dimen>
<dimen name="editor_round_button_padding_top">8dip</dimen>
<dimen name="editor_round_button_padding_bottom">8dip</dimen>
+ <!-- Font size for the structured name in the contact detail page -->
+ <dimen name="editor_structured_name_text_size">25sp</dimen>
+
<!-- Width of the Type-Label in the Editor -->
<dimen name="editor_type_label_width">120dip</dimen>
- <!-- Padding of the title of a field in the Editor -->
- <dimen name="editor_field_title_padding">10dip</dimen>
+ <!-- Left padding of a field in the Editor -->
+ <dimen name="editor_field_left_padding">5dip</dimen>
+
+ <!-- Top padding of a field in the Editor -->
+ <dimen name="editor_field_top_padding">10dip</dimen>
+
+ <!-- Bottom padding of a field in the Editor -->
+ <dimen name="editor_field_bottom_padding">5dip</dimen>
<!-- Minimum height of a row in the Editor -->
<dimen name="editor_min_line_item_height">48dip</dimen>
@@ -70,6 +79,9 @@
<!-- Width of a contact detail item type (i.e. Nickname or Website). -->
<dimen name="detail_item_type_width">164dip</dimen>
+ <!-- Font size for the display name in header of the contact detail page -->
+ <dimen name="detail_header_name_text_size">30sp</dimen>
+
<!-- Padding to be used between a visible scrollbar and the contact list -->
<dimen name="list_visible_scrollbar_padding">40dip</dimen>
@@ -79,9 +91,6 @@
<!-- Font size used for the social status in the widget -->
<dimen name="widget_text_size_snippet">13sp</dimen>
- <!-- Font size used for the contact name in the detail and the editor -->
- <dimen name="contact_name_text_size">18sp</dimen>
-
<!-- Minimum width of the filter selector in the action bar -->
<dimen name="action_bar_filter_min_width">100dip</dimen>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 593879f..2469a3d 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -193,7 +193,7 @@
<style name="ContactDetailItemType">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
- <item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
+ <item name="android:textAppearance">?android:attr/textAppearanceMedium</item>
<item name="android:textColor">@color/detail_item_type_color</item>
<item name="android:singleLine">true</item>
<item name="android:ellipsize">marquee</item>
diff --git a/src/com/android/contacts/editor/LabeledEditorView.java b/src/com/android/contacts/editor/LabeledEditorView.java
index 011804c..af5ae65 100644
--- a/src/com/android/contacts/editor/LabeledEditorView.java
+++ b/src/com/android/contacts/editor/LabeledEditorView.java
@@ -167,6 +167,9 @@
* Creates or removes the type/label button. Doesn't do anything if already correctly configured
*/
private void setupLabelButton(boolean shouldExist) {
+ if (mTitle == null) {
+ return;
+ }
if (shouldExist) {
mLabel.setEnabled(!mReadOnly && isEnabled());
mLabel.setVisibility(View.VISIBLE);
@@ -310,8 +313,12 @@
? ""
: getResources().getString(kind.titleRes);
- // Setup title (may not be shown if there is a Spinner setup later).
- mTitle.setText(titleString.toUpperCase());
+ // If there is a title field, then setup the title (although it may not be shown if there is
+ // a Spinner setup later). There are cases where a title may not be present (i.e. structured
+ // name).
+ if (mTitle != null) {
+ mTitle.setText(titleString.toUpperCase());
+ }
// Display label selector if multiple types available
final boolean hasTypes = EntityModifier.hasEditTypes(kind);
@@ -441,13 +448,10 @@
private class EditTypeAdapter extends ArrayAdapter<EditType> {
private final LayoutInflater mInflater;
private boolean mHasCustomSelection;
- private int mTextSize;
public EditTypeAdapter(Context context) {
super(context, 0);
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- mTextSize = getResources().getDimensionPixelSize(
- R.dimen.editor_field_spinner_text_size);
if (mType != null && mType.customColumn != null) {
@@ -490,7 +494,6 @@
}
textView = (TextView) view;
- textView.setTextSize(mTextSize);
EditType type = getItem(position);
String text;
diff --git a/src/com/android/contacts/editor/RawContactEditorView.java b/src/com/android/contacts/editor/RawContactEditorView.java
index 4813f29..2e8ddd8 100644
--- a/src/com/android/contacts/editor/RawContactEditorView.java
+++ b/src/com/android/contacts/editor/RawContactEditorView.java
@@ -130,7 +130,6 @@
final int photoSize = getResources().getDimensionPixelSize(R.dimen.edit_photo_size);
mName = (StructuredNameEditorView)findViewById(R.id.edit_name);
- mName.setMinimumHeight(photoSize);
mName.setDeletable(false);
mPhoneticName = (PhoneticNameEditorView)findViewById(R.id.edit_phonetic_name);
@@ -191,8 +190,8 @@
setHasPhotoEditor((type.getKindForMimetype(Photo.CONTENT_ITEM_TYPE) != null));
getPhotoEditor().setEnabled(isEnabled());
mName.setEnabled(isEnabled());
- mName.setEditorTextSize(
- mContext.getResources().getDimensionPixelSize(R.dimen.contact_name_text_size));
+ mName.setEditorTextSize(mContext.getResources().getDimensionPixelSize(
+ R.dimen.editor_structured_name_text_size));
mPhoneticName.setEnabled(isEnabled());
diff --git a/src/com/android/contacts/editor/TextFieldsEditorView.java b/src/com/android/contacts/editor/TextFieldsEditorView.java
index 1ca0c4f..e74492c 100644
--- a/src/com/android/contacts/editor/TextFieldsEditorView.java
+++ b/src/com/android/contacts/editor/TextFieldsEditorView.java
@@ -28,6 +28,8 @@
import android.graphics.Rect;
import android.os.Parcel;
import android.os.Parcelable;
+import android.provider.ContactsContract.CommonDataKinds.Phone;
+import android.provider.ContactsContract.CommonDataKinds.StructuredName;
import android.telephony.PhoneNumberFormattingTextWatcher;
import android.text.Editable;
import android.text.InputType;
@@ -40,6 +42,7 @@
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
+import android.widget.Toast;
/**
* Simple editor that handles labels and any {@link EditField} defined for the
@@ -53,7 +56,7 @@
private ImageView mExpansionView;
private boolean mHideOptional = true;
private boolean mHasShortAndLongForms;
- private int mEditorTextSize;
+ private int mEditorTextSize = 0;
public TextFieldsEditorView(Context context) {
super(context);
@@ -75,7 +78,6 @@
setDrawingCacheEnabled(true);
setAlwaysDrawnWithCacheEnabled(true);
- mEditorTextSize = getResources().getDimensionPixelSize(R.dimen.editor_field_text_size);
mFields = (ViewGroup) findViewById(R.id.editors);
mExpansionView = (ImageView) findViewById(R.id.expansion_view);
mExpansionViewContainer = findViewById(R.id.expansion_view_container);
@@ -102,8 +104,12 @@
});
}
+ /**
+ * Set the text size of the value of all fields in this class, which will override the default
+ * text appearance style for the associated {@link DataKind}.
+ */
public void setEditorTextSize(int textSize) {
- this.mEditorTextSize = textSize;
+ mEditorTextSize = textSize;
}
@Override
@@ -171,8 +177,11 @@
final EditText fieldView = new EditText(mContext);
fieldView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT));
+ fieldView.setTextAppearance(getContext(), kind.textAppearanceResourceId);
+ if (mEditorTextSize != 0) {
+ fieldView.setTextSize(mEditorTextSize);
+ }
fieldView.setGravity(Gravity.TOP);
- fieldView.setTextSize(mEditorTextSize);
mFieldEditTexts[index] = fieldView;
fieldView.setId(vig.getId(state, kind, entry, index));
if (field.titleRes > 0) {
diff --git a/src/com/android/contacts/model/BaseAccountType.java b/src/com/android/contacts/model/BaseAccountType.java
index 3196876..ee08522 100644
--- a/src/com/android/contacts/model/BaseAccountType.java
+++ b/src/com/android/contacts/model/BaseAccountType.java
@@ -99,7 +99,8 @@
protected DataKind addDataKindStructuredName(Context context) {
DataKind kind = addKind(new DataKind(StructuredName.CONTENT_ITEM_TYPE,
- R.string.nameLabelsGroup, -1, -1, true, R.layout.structured_name_editor_view, -1));
+ R.string.nameLabelsGroup, -1, -1, true, R.layout.structured_name_editor_view,
+ android.R.style.TextAppearance_Large, -1));
kind.actionHeader = new SimpleInflater(R.string.nameLabelsGroup);
kind.actionBody = new SimpleInflater(Nickname.NAME);
@@ -128,7 +129,8 @@
protected DataKind addDataKindDisplayName(Context context) {
DataKind kind = addKind(new DataKind(DataKind.PSEUDO_MIME_TYPE_DISPLAY_NAME,
- R.string.nameLabelsGroup, -1, -1, true, R.layout.text_fields_editor_view, -1));
+ R.string.nameLabelsGroup, -1, -1, true, R.layout.text_fields_editor_view,
+ android.R.style.TextAppearance_Large, -1));
kind.actionHeader = new SimpleInflater(R.string.nameLabelsGroup);
kind.actionBody = new SimpleInflater(Nickname.NAME);
@@ -168,7 +170,8 @@
protected DataKind addDataKindPhoneticName(Context context) {
DataKind kind = addKind(new DataKind(DataKind.PSEUDO_MIME_TYPE_PHONETIC_NAME,
- R.string.name_phonetic, -1, -1, true, R.layout.phonetic_name_editor_view, -1));
+ R.string.name_phonetic, -1, -1, true, R.layout.phonetic_name_editor_view,
+ android.R.style.TextAppearance_Medium, -1));
kind.actionHeader = new SimpleInflater(R.string.nameLabelsGroup);
kind.actionBody = new SimpleInflater(Nickname.NAME);
@@ -188,7 +191,7 @@
protected DataKind addDataKindNickname(Context context) {
DataKind kind = addKind(new DataKind(Nickname.CONTENT_ITEM_TYPE,
R.string.nicknameLabelsGroup, -1, 115, true,
- R.layout.text_fields_editor_view, -1));
+ R.layout.text_fields_editor_view, android.R.style.TextAppearance_Medium, -1));
kind.isList = false;
kind.actionHeader = new SimpleInflater(R.string.nicknameLabelsGroup);
kind.actionBody = new SimpleInflater(Nickname.NAME);
@@ -205,7 +208,8 @@
protected DataKind addDataKindPhone(Context context) {
DataKind kind = addKind(new DataKind(Phone.CONTENT_ITEM_TYPE, R.string.phoneLabelsGroup,
android.R.drawable.sym_action_call, 10, true,
- R.layout.text_fields_editor_view, R.string.add_phone));
+ R.layout.text_fields_editor_view, android.R.style.TextAppearance_Large,
+ R.string.add_phone));
kind.iconAltRes = R.drawable.sym_action_sms;
kind.actionHeader = new PhoneActionInflater();
kind.actionAltHeader = new PhoneActionAltInflater();
@@ -245,7 +249,8 @@
protected DataKind addDataKindEmail(Context context) {
DataKind kind = addKind(new DataKind(Email.CONTENT_ITEM_TYPE, R.string.emailLabelsGroup,
R.drawable.sym_action_email_holo_light, 15, true,
- R.layout.text_fields_editor_view, R.string.add_email));
+ R.layout.text_fields_editor_view, android.R.style.TextAppearance_Medium,
+ R.string.add_email));
kind.actionHeader = new EmailActionInflater();
kind.actionBody = new SimpleInflater(Email.DATA);
kind.typeColumn = Email.TYPE;
@@ -266,7 +271,8 @@
protected DataKind addDataKindStructuredPostal(Context context) {
DataKind kind = addKind(new DataKind(StructuredPostal.CONTENT_ITEM_TYPE,
R.string.postalLabelsGroup, R.drawable.sym_action_show_map_holo_light, 25,
- true, R.layout.text_fields_editor_view, R.string.add_address));
+ true, R.layout.text_fields_editor_view, android.R.style.TextAppearance_Medium,
+ R.string.add_address));
kind.actionHeader = new PostalActionInflater();
kind.actionBody = new SimpleInflater(StructuredPostal.FORMATTED_ADDRESS);
kind.typeColumn = StructuredPostal.TYPE;
@@ -288,7 +294,8 @@
protected DataKind addDataKindIm(Context context) {
DataKind kind = addKind(new DataKind(Im.CONTENT_ITEM_TYPE, R.string.imLabelsGroup,
R.drawable.sym_action_talk_holo_light, 20, true,
- R.layout.text_fields_editor_view, R.string.add_im));
+ R.layout.text_fields_editor_view, android.R.style.TextAppearance_Medium,
+ R.string.add_im));
kind.actionHeader = new ImActionInflater();
kind.actionBody = new SimpleInflater(Im.DATA);
@@ -320,7 +327,7 @@
protected DataKind addDataKindOrganization(Context context) {
DataKind kind = addKind(new DataKind(Organization.CONTENT_ITEM_TYPE,
R.string.organizationLabelsGroup, -1, 5, true,
- R.layout.text_fields_editor_view, -1));
+ R.layout.text_fields_editor_view, android.R.style.TextAppearance_Medium, -1));
kind.actionHeader = new SimpleInflater(Organization.COMPANY);
kind.actionBody = new SimpleInflater(Organization.TITLE);
kind.isList = false;
@@ -335,7 +342,8 @@
}
protected DataKind addDataKindPhoto(Context context) {
- DataKind kind = addKind(new DataKind(Photo.CONTENT_ITEM_TYPE, -1, -1, -1, true, -1, -1));
+ DataKind kind = addKind(new DataKind(Photo.CONTENT_ITEM_TYPE, -1, -1, -1, true, -1,
+ android.R.style.TextAppearance_Medium, -1));
kind.fieldList = Lists.newArrayList();
kind.fieldList.add(new EditField(Photo.PHOTO, -1, -1));
return kind;
@@ -344,7 +352,8 @@
protected DataKind addDataKindNote(Context context) {
DataKind kind = addKind(new DataKind(Note.CONTENT_ITEM_TYPE,
R.string.label_notes, -1, 110, true,
- R.layout.text_fields_editor_view, R.string.add_note));
+ R.layout.text_fields_editor_view, android.R.style.TextAppearance_Medium,
+ R.string.add_note));
kind.isList = false;
kind.actionHeader = new SimpleInflater(R.string.label_notes);
kind.actionBody = new SimpleInflater(Note.NOTE);
@@ -357,7 +366,8 @@
protected DataKind addDataKindWebsite(Context context) {
DataKind kind = addKind(new DataKind(Website.CONTENT_ITEM_TYPE,
R.string.websiteLabelsGroup, R.drawable.sym_action_goto_website_holo_light, 120,
- true, R.layout.text_fields_editor_view, R.string.add_website));
+ true, R.layout.text_fields_editor_view, android.R.style.TextAppearance_Medium,
+ R.string.add_website));
kind.actionHeader = new SimpleInflater(R.string.websiteLabelsGroup);
kind.actionBody = new SimpleInflater(Website.URL);
kind.defaultValues = new ContentValues();
@@ -380,7 +390,8 @@
// intent-filters in the Phone app's manifest.
DataKind kind = addKind(new DataKind(SipAddress.CONTENT_ITEM_TYPE,
R.string.label_sip_address, android.R.drawable.sym_action_call, 130, true,
- R.layout.text_fields_editor_view, -1));
+ R.layout.text_fields_editor_view, android.R.style.TextAppearance_Medium,
+ -1));
kind.isList = false;
kind.actionHeader = new SimpleInflater(R.string.label_sip_address);
@@ -395,7 +406,8 @@
protected DataKind addDataKindGroupMembership(Context context) {
DataKind kind = getKindForMimetype(GroupMembership.CONTENT_ITEM_TYPE);
kind = addKind(new DataKind(GroupMembership.CONTENT_ITEM_TYPE,
- R.string.groupsLabel, android.R.drawable.sym_contact_card, 999, true, -1, -1));
+ R.string.groupsLabel, android.R.drawable.sym_contact_card, 999, true, -1,
+ android.R.style.TextAppearance_Medium, -1));
kind.isList = false;
kind.fieldList = Lists.newArrayList();
diff --git a/src/com/android/contacts/model/DataKind.java b/src/com/android/contacts/model/DataKind.java
index 73c1e45..52769c3 100644
--- a/src/com/android/contacts/model/DataKind.java
+++ b/src/com/android/contacts/model/DataKind.java
@@ -59,6 +59,9 @@
/** Layout resource id for an editor view to edit this {@link DataKind}. */
public final int editorLayoutResourceId;
+ /** Text appearance resource id for the value of a field in this {@link DataKind}. */
+ public final int textAppearanceResourceId;
+
/**
* String resource id for the "add field" footer. This is equal to -1 if it
* is not applicable to add a new field to this class (i.e. for a structured
@@ -82,11 +85,13 @@
public DataKind() {
editorLayoutResourceId = R.layout.text_fields_editor_view;
+ textAppearanceResourceId = android.R.style.TextAppearance_Medium;
addNewFieldTextResourceId = -1;
}
public DataKind(String mimeType, int titleRes, int iconRes, int weight, boolean editable,
- int editorLayoutResourceId, int addNewFieldTextResourceId) {
+ int editorLayoutResourceId, int textAppearanceResourceId,
+ int addNewFieldTextResourceId) {
this.mimeType = mimeType;
this.titleRes = titleRes;
this.iconRes = iconRes;
@@ -95,6 +100,7 @@
this.isList = true;
this.typeOverallMax = -1;
this.editorLayoutResourceId = editorLayoutResourceId;
+ this.textAppearanceResourceId = textAppearanceResourceId;
this.addNewFieldTextResourceId = addNewFieldTextResourceId;
}
}
\ No newline at end of file
diff --git a/src/com/android/contacts/model/ExchangeAccountType.java b/src/com/android/contacts/model/ExchangeAccountType.java
index 2f6d781..22a2ba2 100644
--- a/src/com/android/contacts/model/ExchangeAccountType.java
+++ b/src/com/android/contacts/model/ExchangeAccountType.java
@@ -65,7 +65,7 @@
protected DataKind addDataKindStructuredName(Context context) {
DataKind kind = addKind(new DataKind(StructuredName.CONTENT_ITEM_TYPE,
R.string.nameLabelsGroup, -1, -1, true,
- R.layout.structured_name_editor_view, -1));
+ R.layout.structured_name_editor_view, android.R.style.TextAppearance_Large, -1));
kind.actionHeader = new SimpleInflater(R.string.nameLabelsGroup);
kind.actionBody = new SimpleInflater(Nickname.NAME);
@@ -95,7 +95,7 @@
protected DataKind addDataKindDisplayName(Context context) {
DataKind kind = addKind(new DataKind(DataKind.PSEUDO_MIME_TYPE_DISPLAY_NAME,
R.string.nameLabelsGroup, -1, -1, true,
- R.layout.text_fields_editor_view, -1));
+ R.layout.text_fields_editor_view, android.R.style.TextAppearance_Large, -1));
boolean displayOrderPrimary =
context.getResources().getBoolean(R.bool.config_editor_field_order_primary);
@@ -129,7 +129,7 @@
protected DataKind addDataKindPhoneticName(Context context) {
DataKind kind = addKind(new DataKind(DataKind.PSEUDO_MIME_TYPE_PHONETIC_NAME,
R.string.name_phonetic, -1, -1, true,
- R.layout.phonetic_name_editor_view, -1));
+ R.layout.phonetic_name_editor_view, android.R.style.TextAppearance_Medium, -1));
kind.actionHeader = new SimpleInflater(R.string.nameLabelsGroup);
kind.actionBody = new SimpleInflater(Nickname.NAME);
@@ -295,7 +295,8 @@
protected DataKind addDataKindEvent(Context context) {
DataKind kind = addKind(
new DataKind(Event.CONTENT_ITEM_TYPE, R.string.eventLabelsGroup, -1, 150, true,
- R.layout.event_field_editor_view, R.string.add_event));
+ R.layout.event_field_editor_view, android.R.style.TextAppearance_Medium,
+ R.string.add_event));
kind.actionHeader = new EventActionInflater();
kind.actionBody = new SimpleInflater(Event.START_DATE);
diff --git a/src/com/android/contacts/model/GoogleAccountType.java b/src/com/android/contacts/model/GoogleAccountType.java
index 3d437cb..bd445b1 100644
--- a/src/com/android/contacts/model/GoogleAccountType.java
+++ b/src/com/android/contacts/model/GoogleAccountType.java
@@ -100,7 +100,8 @@
private DataKind addDataKindRelation(Context context) {
DataKind kind = addKind(new DataKind(Relation.CONTENT_ITEM_TYPE,
R.string.relationLabelsGroup, -1, 160, true,
- R.layout.text_fields_editor_view, R.string.add_relationship));
+ R.layout.text_fields_editor_view, android.R.style.TextAppearance_Medium,
+ R.string.add_relationship));
kind.actionHeader = new RelationActionInflater();
kind.actionBody = new SimpleInflater(Relation.NAME);
@@ -136,7 +137,8 @@
private DataKind addDataKindEvent(Context context) {
DataKind kind = addKind(new DataKind(Event.CONTENT_ITEM_TYPE,
R.string.eventLabelsGroup, -1, 150, true,
- R.layout.event_field_editor_view, R.string.add_event));
+ R.layout.event_field_editor_view, android.R.style.TextAppearance_Medium,
+ R.string.add_event));
kind.actionHeader = new EventActionInflater();
kind.actionBody = new SimpleInflater(Event.START_DATE);
diff --git a/tests/src/com/android/contacts/EntityModifierTests.java b/tests/src/com/android/contacts/EntityModifierTests.java
index 52a6cdf..ea42239 100644
--- a/tests/src/com/android/contacts/EntityModifierTests.java
+++ b/tests/src/com/android/contacts/EntityModifierTests.java
@@ -82,14 +82,14 @@
this.accountType = TEST_ACCOUNT_TYPE;
final DataKind nameKind = new DataKind(StructuredName.CONTENT_ITEM_TYPE,
- R.string.nameLabelsGroup, -1, -1, true, -1, -1);
+ R.string.nameLabelsGroup, -1, -1, true, -1, -1, -1);
nameKind.typeOverallMax = 1;
addKind(nameKind);
// Phone allows maximum 2 home, 1 work, and unlimited other, with
// constraint of 5 numbers maximum.
final DataKind phoneKind = new DataKind(
- Phone.CONTENT_ITEM_TYPE, -1, -1, 10, true, -1, -1);
+ Phone.CONTENT_ITEM_TYPE, -1, -1, 10, true, -1, -1, -1);
phoneKind.typeOverallMax = 5;
phoneKind.typeColumn = Phone.TYPE;
@@ -107,14 +107,15 @@
// Email is unlimited
final DataKind emailKind = new DataKind(
- Email.CONTENT_ITEM_TYPE, -1, -1, 10, true, -1, -1);
+ Email.CONTENT_ITEM_TYPE, -1, -1, 10, true, -1, -1, -1);
emailKind.typeOverallMax = -1;
emailKind.fieldList = Lists.newArrayList();
emailKind.fieldList.add(new EditField(Email.DATA, -1, -1));
addKind(emailKind);
// IM is only one
- final DataKind imKind = new DataKind(Im.CONTENT_ITEM_TYPE, -1, -1, 10, true, -1, -1);
+ final DataKind imKind = new DataKind(Im.CONTENT_ITEM_TYPE, -1, -1, 10,
+ true, -1, -1, -1);
imKind.typeOverallMax = 1;
imKind.fieldList = Lists.newArrayList();
imKind.fieldList.add(new EditField(Im.DATA, -1, -1));
@@ -122,7 +123,7 @@
// Organization is only one
final DataKind orgKind = new DataKind(
- Organization.CONTENT_ITEM_TYPE, -1, -1, 10, true, -1, -1);
+ Organization.CONTENT_ITEM_TYPE, -1, -1, 10, true, -1, -1, -1);
orgKind.typeOverallMax = 1;
orgKind.fieldList = Lists.newArrayList();
orgKind.fieldList.add(new EditField(Organization.COMPANY, -1, -1));