diff options
author | Chiao Cheng <chiaocheng@google.com> | 2012-12-06 15:57:03 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-12-06 15:57:03 -0800 |
commit | c79b28166660c5df4515fd580691397c09972dbc (patch) | |
tree | eefca9aa7c044ed1d2636f37f03b8f04cb7bd369 | |
parent | 32c087b2561131381cbac1511ed896a462dc62e1 (diff) | |
parent | 393285b99f0746dab62899849262526a35d007dc (diff) | |
download | android_packages_apps_ContactsCommon-c79b28166660c5df4515fd580691397c09972dbc.tar.gz android_packages_apps_ContactsCommon-c79b28166660c5df4515fd580691397c09972dbc.tar.bz2 android_packages_apps_ContactsCommon-c79b28166660c5df4515fd580691397c09972dbc.zip |
Merge "Refactor editor layout file dependencies out of common."
20 files changed, 33 insertions, 620 deletions
diff --git a/res/layout-sw580dp/text_fields_editor_view.xml b/res/layout-sw580dp/text_fields_editor_view.xml deleted file mode 100644 index 89970c6c..00000000 --- a/res/layout-sw580dp/text_fields_editor_view.xml +++ /dev/null @@ -1,53 +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. ---> - -<com.android.contacts.editor.TextFieldsEditorView - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical"> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_weight="1" - android:orientation="horizontal" - android:gravity="center_vertical" - android:focusable="true" - android:clickable="true"> - - <include - android:id="@+id/editors" - layout="@layout/edit_field_list" /> - - <include - android:id="@+id/expansion_view_container" - layout="@layout/edit_expansion_view" - android:visibility="gone" /> - - <include - android:id="@+id/spinner" - layout="@layout/edit_spinner" - android:visibility="gone" /> - - <include - android:id="@+id/delete_button_container" - layout="@layout/edit_delete_button" - android:visibility="gone" /> - - </LinearLayout> - -</com.android.contacts.editor.TextFieldsEditorView> diff --git a/res/layout/edit_date_picker.xml b/res/layout/edit_date_picker.xml deleted file mode 100644 index b53fa0ff..00000000 --- a/res/layout/edit_date_picker.xml +++ /dev/null @@ -1,31 +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. - --> - -<!-- Button to select a date in the contact editor. --> - -<Button - xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/date_view" - style="?android:attr/spinnerStyle" - android:layout_width="0dip" - 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="12dip" /> diff --git a/res/layout/edit_delete_button.xml b/res/layout/edit_delete_button.xml deleted file mode 100644 index 962d4376..00000000 --- a/res/layout/edit_delete_button.xml +++ /dev/null @@ -1,39 +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. - --> - -<!-- "Delete field" button in the contact editor. --> - -<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_marginRight="2dip" - android:layout_gravity="bottom"> - <ImageView - android:id="@+id/delete_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center" - android:duplicateParentState="true" - android:background="?android:attr/selectableItemBackground" - android:src="@drawable/ic_menu_remove_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_minus_button" /> -</FrameLayout> diff --git a/res/layout/edit_expansion_view.xml b/res/layout/edit_expansion_view.xml deleted file mode 100644 index 3ba59d45..00000000 --- a/res/layout/edit_expansion_view.xml +++ /dev/null @@ -1,36 +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. - --> - -<!-- "More" or "less" expansion button in the contact editor. --> - -<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_gravity="top"> - <ImageView - android:id="@+id/expansion_view" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center" - android:duplicateParentState="true" - android:background="?android:attr/selectableItemBackground" - 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" /> -</FrameLayout> diff --git a/res/layout/edit_field_list.xml b/res/layout/edit_field_list.xml deleted file mode 100644 index fddb28b7..00000000 --- a/res/layout/edit_field_list.xml +++ /dev/null @@ -1,27 +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. - --> - -<!-- Layout to contain a list of fields in the contact editor. --> - -<LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/editors" - android:layout_width="0dip" - android:layout_weight="1" - android:layout_height="wrap_content" - android:paddingLeft="@dimen/editor_field_left_padding" - android:orientation="vertical" /> diff --git a/res/layout/edit_field_list_with_anchor_view.xml b/res/layout/edit_field_list_with_anchor_view.xml deleted file mode 100644 index 0683a0aa..00000000 --- a/res/layout/edit_field_list_with_anchor_view.xml +++ /dev/null @@ -1,36 +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. - --> - -<!-- Layout that behaves similarly to edit_field_list.xml, - but also has an anchor view for ListPopupWindow --> -<LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="0dip" - android:layout_height="wrap_content" - android:layout_weight="1" - android:paddingLeft="@dimen/editor_field_left_padding" - android:orientation="vertical"> - <LinearLayout - android:id="@+id/editors" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical" /> - <View - android:id="@+id/anchor_view" - android:layout_width="match_parent" - android:layout_height="0px" /> -</LinearLayout> diff --git a/res/layout/edit_spinner.xml b/res/layout/edit_spinner.xml deleted file mode 100644 index f21baa8e..00000000 --- a/res/layout/edit_spinner.xml +++ /dev/null @@ -1,28 +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. - --> - -<!-- Spinner for a field in the contact editor. --> - -<!-- Note: explicitly override the default left and right padding on spinner --> -<Spinner - xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/spinner" - android:layout_gravity="bottom" - android:layout_width="@dimen/editor_type_label_width" - android:layout_height="@dimen/editor_min_line_item_height" - android:paddingLeft="0dip" - android:paddingRight="10dip"/> diff --git a/res/layout/event_field_editor_view.xml b/res/layout/event_field_editor_view.xml deleted file mode 100644 index e51c5bba..00000000 --- a/res/layout/event_field_editor_view.xml +++ /dev/null @@ -1,55 +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. - --> - -<!-- Editor for a single event entry in the contact editor --> - -<com.android.contacts.editor.EventFieldEditorView - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="@dimen/editor_min_line_item_height" - android:orientation="vertical"> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_weight="1" - android:orientation="horizontal" - android:gravity="center_vertical" - android:focusable="true" - android:clickable="true"> - - <include - android:id="@+id/date_view" - layout="@layout/edit_date_picker" /> - - <Spinner - android:id="@+id/spinner" - android:layout_width="@dimen/editor_type_label_width" - android:layout_height="match_parent" - android:layout_gravity="bottom" - android:paddingLeft="0dip" - android:paddingRight="10dip" - android:visibility="gone"/> - - <include - android:id="@+id/delete_button_container" - layout="@layout/edit_delete_button" - android:visibility="gone" /> - - </LinearLayout> - -</com.android.contacts.editor.EventFieldEditorView> diff --git a/res/layout/name_edit_expansion_view.xml b/res/layout/name_edit_expansion_view.xml deleted file mode 100644 index 4a7f3646..00000000 --- a/res/layout/name_edit_expansion_view.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2012 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. - --> - -<!-- "More" or "less" expansion button in the contact editor. --> - -<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_gravity="top" - android:contentDescription="@string/expand_collapse_name_fields_description" - android:importantForAccessibility="yes"> - <ImageView - android:id="@+id/expansion_view" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center" - android:duplicateParentState="true" - android:background="?android:attr/selectableItemBackground" - 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" /> -</FrameLayout> diff --git a/res/layout/phonetic_name_editor_view.xml b/res/layout/phonetic_name_editor_view.xml deleted file mode 100644 index 4a4b64ca..00000000 --- a/res/layout/phonetic_name_editor_view.xml +++ /dev/null @@ -1,54 +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. - --> - -<com.android.contacts.editor.PhoneticNameEditorView - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:minHeight="@dimen/editor_min_line_item_height" - android:orientation="vertical"> - - <include - android:id="@+id/spinner" - layout="@layout/edit_spinner" - android:visibility="gone" /> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:gravity="center_vertical" - android:focusable="true" - android:clickable="true"> - - <include - android:id="@+id/editors" - layout="@layout/edit_field_list" /> - - <include - android:id="@+id/expansion_view_container" - layout="@layout/name_edit_expansion_view" - android:visibility="gone" /> - - <include - android:id="@+id/delete_button_container" - layout="@layout/edit_delete_button" - android:visibility="gone" /> - - </LinearLayout> - -</com.android.contacts.editor.PhoneticNameEditorView> diff --git a/res/layout/structured_name_editor_view.xml b/res/layout/structured_name_editor_view.xml deleted file mode 100644 index 8b4a8ade..00000000 --- a/res/layout/structured_name_editor_view.xml +++ /dev/null @@ -1,52 +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. - --> - -<com.android.contacts.editor.StructuredNameEditorView - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:minHeight="@dimen/editor_min_line_item_height" - android:orientation="vertical"> - - <include - android:id="@+id/spinner" - layout="@layout/edit_spinner" - android:visibility="gone" /> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:focusable="true" - android:clickable="true"> - - <include - layout="@layout/edit_field_list_with_anchor_view" /> - - <include - android:id="@+id/expansion_view_container" - layout="@layout/name_edit_expansion_view" - android:visibility="gone" /> - - <include - android:id="@+id/delete_button_container" - layout="@layout/edit_delete_button" - android:visibility="gone" /> - - </LinearLayout> - -</com.android.contacts.editor.StructuredNameEditorView> diff --git a/res/layout/text_fields_editor_view.xml b/res/layout/text_fields_editor_view.xml deleted file mode 100644 index de492155..00000000 --- a/res/layout/text_fields_editor_view.xml +++ /dev/null @@ -1,53 +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. - --> - -<com.android.contacts.editor.TextFieldsEditorView - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical"> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_weight="1" - android:orientation="horizontal" - android:gravity="center_vertical" - android:focusable="true" - android:clickable="true"> - - <include - layout="@layout/edit_field_list_with_anchor_view" /> - - <include - android:id="@+id/expansion_view_container" - layout="@layout/edit_expansion_view" - android:visibility="gone" /> - - <include - android:id="@+id/spinner" - layout="@layout/edit_spinner" - android:visibility="gone" /> - - <include - android:id="@+id/delete_button_container" - layout="@layout/edit_delete_button" - android:visibility="gone" /> - - </LinearLayout> - -</com.android.contacts.editor.TextFieldsEditorView> diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml deleted file mode 100644 index 50cb55cb..00000000 --- a/res/values-land/dimens.xml +++ /dev/null @@ -1,19 +0,0 @@ -<!-- - ~ Copyright (C) 2012 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 - --> - -<resources> - <dimen name="editor_type_label_width">120dip</dimen> -</resources> diff --git a/res/values-sw580dp/dimens.xml b/res/values-sw580dp/dimens.xml index 0a149e75..1818d5b4 100644 --- a/res/values-sw580dp/dimens.xml +++ b/res/values-sw580dp/dimens.xml @@ -17,11 +17,6 @@ <resources> <dimen name="detail_item_side_margin">0dip</dimen> - <dimen name="editor_round_button_padding_left">16dip</dimen> - <dimen name="editor_round_button_padding_right">16dip</dimen> - - <dimen name="editor_type_label_width">122dip</dimen> - <dimen name="contact_browser_list_header_left_margin">@dimen/list_visible_scrollbar_padding</dimen> <dimen name="contact_browser_list_header_right_margin">24dip</dimen> <dimen name="contact_browser_list_top_margin">16dip</dimen> diff --git a/res/values-sw680dp/dimens.xml b/res/values-sw680dp/dimens.xml deleted file mode 100644 index b99d0c2e..00000000 --- a/res/values-sw680dp/dimens.xml +++ /dev/null @@ -1,22 +0,0 @@ -<!-- - ~ Copyright (C) 2012 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 - --> - -<resources> - <dimen name="editor_round_button_padding_left">8dip</dimen> - <dimen name="editor_round_button_padding_right">8dip</dimen> - - <dimen name="editor_type_label_width">180dip</dimen> -</resources> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 2c49c2ed..18bc0d42 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -41,24 +41,6 @@ <!-- Top padding of the ListView in the contact tile list --> <dimen name="contact_tile_list_padding_top">0dip</dimen> - <!-- Minimum height of a row in the Editor --> - <dimen name="editor_min_line_item_height">48dip</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_top">8dip</dimen> - <dimen name="editor_round_button_padding_bottom">8dip</dimen> - - <!-- Right padding of a field in the Editor --> - <dimen name="editor_field_right_padding">4dip</dimen> - - <!-- Left padding of a field in the Editor --> - <dimen name="editor_field_left_padding">4dip</dimen> - - <!-- Width of the Type-Label in the Editor --> - <dimen name="editor_type_label_width">100dip</dimen> - <!-- For contact filter setting screens --> <dimen name="contact_filter_left_margin">16dip</dimen> <dimen name="contact_filter_right_margin">16dip</dimen> diff --git a/src/com/android/contacts/common/model/account/BaseAccountType.java b/src/com/android/contacts/common/model/account/BaseAccountType.java index 772657a6..7a4339a6 100644 --- a/src/com/android/contacts/common/model/account/BaseAccountType.java +++ b/src/com/android/contacts/common/model/account/BaseAccountType.java @@ -148,7 +148,7 @@ public abstract class BaseAccountType extends AccountType { protected DataKind addDataKindStructuredName(Context context) throws DefinitionException { DataKind kind = addKind(new DataKind(StructuredName.CONTENT_ITEM_TYPE, - R.string.nameLabelsGroup, -1, true, R.layout.structured_name_editor_view)); + R.string.nameLabelsGroup, -1, true)); kind.actionHeader = new SimpleInflater(R.string.nameLabelsGroup); kind.actionBody = new SimpleInflater(Nickname.NAME); kind.typeOverallMax = 1; @@ -178,7 +178,7 @@ public abstract class BaseAccountType extends AccountType { protected DataKind addDataKindDisplayName(Context context) throws DefinitionException { DataKind kind = addKind(new DataKind(DataKind.PSEUDO_MIME_TYPE_DISPLAY_NAME, - R.string.nameLabelsGroup, -1, true, R.layout.text_fields_editor_view)); + R.string.nameLabelsGroup, -1, true)); kind.actionHeader = new SimpleInflater(R.string.nameLabelsGroup); kind.actionBody = new SimpleInflater(Nickname.NAME); kind.typeOverallMax = 1; @@ -219,7 +219,7 @@ public abstract class BaseAccountType extends AccountType { protected DataKind addDataKindPhoneticName(Context context) throws DefinitionException { DataKind kind = addKind(new DataKind(DataKind.PSEUDO_MIME_TYPE_PHONETIC_NAME, - R.string.name_phonetic, -1, true, R.layout.phonetic_name_editor_view)); + R.string.name_phonetic, -1, true)); kind.actionHeader = new SimpleInflater(R.string.nameLabelsGroup); kind.actionBody = new SimpleInflater(Nickname.NAME); kind.typeOverallMax = 1; @@ -239,7 +239,7 @@ public abstract class BaseAccountType extends AccountType { protected DataKind addDataKindNickname(Context context) throws DefinitionException { DataKind kind = addKind(new DataKind(Nickname.CONTENT_ITEM_TYPE, - R.string.nicknameLabelsGroup, 115, true, R.layout.text_fields_editor_view)); + R.string.nicknameLabelsGroup, 115, true)); kind.typeOverallMax = 1; kind.actionHeader = new SimpleInflater(R.string.nicknameLabelsGroup); kind.actionBody = new SimpleInflater(Nickname.NAME); @@ -255,7 +255,7 @@ public abstract class BaseAccountType extends AccountType { protected DataKind addDataKindPhone(Context context) throws DefinitionException { DataKind kind = addKind(new DataKind(Phone.CONTENT_ITEM_TYPE, R.string.phoneLabelsGroup, - 10, true, R.layout.text_fields_editor_view)); + 10, true)); kind.iconAltRes = R.drawable.ic_text_holo_light; kind.iconAltDescriptionRes = R.string.sms; kind.actionHeader = new PhoneActionInflater(); @@ -294,7 +294,7 @@ public abstract class BaseAccountType extends AccountType { protected DataKind addDataKindEmail(Context context) throws DefinitionException { DataKind kind = addKind(new DataKind(Email.CONTENT_ITEM_TYPE, R.string.emailLabelsGroup, - 15, true, R.layout.text_fields_editor_view)); + 15, true)); kind.actionHeader = new EmailActionInflater(); kind.actionBody = new SimpleInflater(Email.DATA); kind.typeColumn = Email.TYPE; @@ -314,7 +314,7 @@ public abstract class BaseAccountType extends AccountType { protected DataKind addDataKindStructuredPostal(Context context) throws DefinitionException { DataKind kind = addKind(new DataKind(StructuredPostal.CONTENT_ITEM_TYPE, - R.string.postalLabelsGroup, 25, true, R.layout.text_fields_editor_view)); + R.string.postalLabelsGroup, 25, true)); kind.actionHeader = new PostalActionInflater(); kind.actionBody = new SimpleInflater(StructuredPostal.FORMATTED_ADDRESS); kind.typeColumn = StructuredPostal.TYPE; @@ -336,8 +336,8 @@ public abstract class BaseAccountType extends AccountType { } protected DataKind addDataKindIm(Context context) throws DefinitionException { - DataKind kind = addKind(new DataKind(Im.CONTENT_ITEM_TYPE, R.string.imLabelsGroup, 20, true, - R.layout.text_fields_editor_view)); + DataKind kind = addKind(new DataKind(Im.CONTENT_ITEM_TYPE, R.string.imLabelsGroup, 20, + true)); kind.actionHeader = new ImActionInflater(); kind.actionBody = new SimpleInflater(Im.DATA); @@ -368,8 +368,7 @@ public abstract class BaseAccountType extends AccountType { protected DataKind addDataKindOrganization(Context context) throws DefinitionException { DataKind kind = addKind(new DataKind(Organization.CONTENT_ITEM_TYPE, - R.string.organizationLabelsGroup, 5, true, - R.layout.text_fields_editor_view)); + R.string.organizationLabelsGroup, 5, true)); kind.actionHeader = new SimpleInflater(Organization.COMPANY); kind.actionBody = new SimpleInflater(Organization.TITLE); kind.typeOverallMax = 1; @@ -384,7 +383,7 @@ public abstract class BaseAccountType extends AccountType { } protected DataKind addDataKindPhoto(Context context) throws DefinitionException { - DataKind kind = addKind(new DataKind(Photo.CONTENT_ITEM_TYPE, -1, -1, true, -1)); + DataKind kind = addKind(new DataKind(Photo.CONTENT_ITEM_TYPE, -1, -1, true)); kind.typeOverallMax = 1; kind.fieldList = Lists.newArrayList(); kind.fieldList.add(new EditField(Photo.PHOTO, -1, -1)); @@ -392,8 +391,8 @@ public abstract class BaseAccountType extends AccountType { } protected DataKind addDataKindNote(Context context) throws DefinitionException { - DataKind kind = addKind(new DataKind(Note.CONTENT_ITEM_TYPE, - R.string.label_notes, 110, true, R.layout.text_fields_editor_view)); + DataKind kind = addKind(new DataKind(Note.CONTENT_ITEM_TYPE, R.string.label_notes, 110, + true)); kind.typeOverallMax = 1; kind.actionHeader = new SimpleInflater(R.string.label_notes); kind.actionBody = new SimpleInflater(Note.NOTE); @@ -407,7 +406,7 @@ public abstract class BaseAccountType extends AccountType { protected DataKind addDataKindWebsite(Context context) throws DefinitionException { DataKind kind = addKind(new DataKind(Website.CONTENT_ITEM_TYPE, - R.string.websiteLabelsGroup, 120, true, R.layout.text_fields_editor_view)); + R.string.websiteLabelsGroup, 120, true)); kind.actionHeader = new SimpleInflater(R.string.websiteLabelsGroup); kind.actionBody = new SimpleInflater(Website.URL); kind.defaultValues = new ContentValues(); @@ -421,7 +420,7 @@ public abstract class BaseAccountType extends AccountType { protected DataKind addDataKindSipAddress(Context context) throws DefinitionException { DataKind kind = addKind(new DataKind(SipAddress.CONTENT_ITEM_TYPE, - R.string.label_sip_address, 130, true, R.layout.text_fields_editor_view)); + R.string.label_sip_address, 130, true)); kind.typeOverallMax = 1; kind.actionHeader = new SimpleInflater(R.string.label_sip_address); @@ -435,7 +434,7 @@ public abstract class BaseAccountType extends AccountType { protected DataKind addDataKindGroupMembership(Context context) throws DefinitionException { DataKind kind = addKind(new DataKind(GroupMembership.CONTENT_ITEM_TYPE, - R.string.groupsLabel, 999, true, -1)); + R.string.groupsLabel, 999, true)); kind.typeOverallMax = 1; kind.fieldList = Lists.newArrayList(); @@ -740,16 +739,14 @@ public abstract class BaseAccountType extends AccountType { */ protected final DataKind newDataKind(Context context, XmlPullParser parser, AttributeSet attrs, boolean isPseudo, String mimeType, String typeColumn, - int titleRes, int weight, int editorLayoutResourceId, - StringInflater actionHeader, StringInflater actionBody) + int titleRes, int weight, StringInflater actionHeader, StringInflater actionBody) throws DefinitionException, XmlPullParserException, IOException { if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "Adding DataKind: " + mimeType); } - final DataKind kind = new DataKind(mimeType, titleRes, weight, true, - editorLayoutResourceId); + final DataKind kind = new DataKind(mimeType, titleRes, weight, true); kind.typeColumn = typeColumn; kind.actionHeader = actionHeader; kind.actionBody = actionBody; @@ -902,7 +899,6 @@ public abstract class BaseAccountType extends AccountType { // Structured name final DataKind ks = newDataKind(context, parser, attrs, false, StructuredName.CONTENT_ITEM_TYPE, null, R.string.nameLabelsGroup, Weight.NONE, - R.layout.structured_name_editor_view, new SimpleInflater(R.string.nameLabelsGroup), new SimpleInflater(Nickname.NAME)); @@ -936,7 +932,7 @@ public abstract class BaseAccountType extends AccountType { // Display name final DataKind kd = newDataKind(context, parser, attrs, true, DataKind.PSEUDO_MIME_TYPE_DISPLAY_NAME, null, - R.string.nameLabelsGroup, Weight.NONE, R.layout.text_fields_editor_view, + R.string.nameLabelsGroup, Weight.NONE, new SimpleInflater(R.string.nameLabelsGroup), new SimpleInflater(Nickname.NAME)); kd.typeOverallMax = 1; @@ -972,7 +968,7 @@ public abstract class BaseAccountType extends AccountType { // Phonetic name final DataKind kp = newDataKind(context, parser, attrs, true, DataKind.PSEUDO_MIME_TYPE_PHONETIC_NAME, null, - R.string.name_phonetic, Weight.NONE, R.layout.phonetic_name_editor_view, + R.string.name_phonetic, Weight.NONE, new SimpleInflater(R.string.nameLabelsGroup), new SimpleInflater(Nickname.NAME)); kp.typeOverallMax = 1; @@ -1003,7 +999,6 @@ public abstract class BaseAccountType extends AccountType { IOException { final DataKind kind = newDataKind(context, parser, attrs, false, Nickname.CONTENT_ITEM_TYPE, null, R.string.nicknameLabelsGroup, Weight.NICKNAME, - R.layout.text_fields_editor_view, new SimpleInflater(R.string.nicknameLabelsGroup), new SimpleInflater(Nickname.NAME)); @@ -1030,7 +1025,6 @@ public abstract class BaseAccountType extends AccountType { IOException { final DataKind kind = newDataKind(context, parser, attrs, false, Phone.CONTENT_ITEM_TYPE, Phone.TYPE, R.string.phoneLabelsGroup, Weight.PHONE, - R.layout.text_fields_editor_view, new PhoneActionInflater(), new SimpleInflater(Phone.NUMBER)); kind.iconAltRes = R.drawable.ic_text_holo_light; @@ -1090,7 +1084,6 @@ public abstract class BaseAccountType extends AccountType { IOException { final DataKind kind = newDataKind(context, parser, attrs, false, Email.CONTENT_ITEM_TYPE, Email.TYPE, R.string.emailLabelsGroup, Weight.EMAIL, - R.layout.text_fields_editor_view, new EmailActionInflater(), new SimpleInflater(Email.DATA)); kind.fieldList.add(new EditField(Email.DATA, R.string.emailLabelsGroup, FLAGS_EMAIL)); @@ -1125,7 +1118,7 @@ public abstract class BaseAccountType extends AccountType { final DataKind kind = newDataKind(context, parser, attrs, false, StructuredPostal.CONTENT_ITEM_TYPE, StructuredPostal.TYPE, R.string.postalLabelsGroup, Weight.STRUCTURED_POSTAL, - R.layout.text_fields_editor_view, new PostalActionInflater(), + new PostalActionInflater(), new SimpleInflater(StructuredPostal.FORMATTED_ADDRESS)); if (getAttr(attrs, "needsStructured", false)) { @@ -1195,7 +1188,6 @@ public abstract class BaseAccountType extends AccountType { final DataKind kind = newDataKind(context, parser, attrs, false, Im.CONTENT_ITEM_TYPE, Im.PROTOCOL, R.string.imLabelsGroup, Weight.IM, - R.layout.text_fields_editor_view, new ImActionInflater(), new SimpleInflater(Im.DATA) // header / action ); kind.fieldList.add(new EditField(Im.DATA, R.string.imLabelsGroup, FLAGS_EMAIL)); @@ -1236,7 +1228,7 @@ public abstract class BaseAccountType extends AccountType { IOException { final DataKind kind = newDataKind(context, parser, attrs, false, Organization.CONTENT_ITEM_TYPE, null, R.string.organizationLabelsGroup, - Weight.ORGANIZATION, R.layout.text_fields_editor_view , + Weight.ORGANIZATION, new SimpleInflater(Organization.COMPANY), new SimpleInflater(Organization.TITLE)); @@ -1262,7 +1254,7 @@ public abstract class BaseAccountType extends AccountType { AttributeSet attrs) throws DefinitionException, XmlPullParserException, IOException { final DataKind kind = newDataKind(context, parser, attrs, false, - Photo.CONTENT_ITEM_TYPE, null /* no type */, -1, Weight.NONE, -1, + Photo.CONTENT_ITEM_TYPE, null /* no type */, Weight.NONE, -1, null, null // no header, no body ); @@ -1286,7 +1278,6 @@ public abstract class BaseAccountType extends AccountType { IOException { final DataKind kind = newDataKind(context, parser, attrs, false, Note.CONTENT_ITEM_TYPE, null, R.string.label_notes, Weight.NOTE, - R.layout.text_fields_editor_view, new SimpleInflater(R.string.label_notes), new SimpleInflater(Note.NOTE)); kind.fieldList.add(new EditField(Note.NOTE, R.string.label_notes, FLAGS_NOTE)); @@ -1310,7 +1301,6 @@ public abstract class BaseAccountType extends AccountType { IOException { final DataKind kind = newDataKind(context, parser, attrs, false, Website.CONTENT_ITEM_TYPE, null, R.string.websiteLabelsGroup, Weight.WEBSITE, - R.layout.text_fields_editor_view, new SimpleInflater(R.string.websiteLabelsGroup), new SimpleInflater(Website.URL)); @@ -1336,7 +1326,7 @@ public abstract class BaseAccountType extends AccountType { IOException { final DataKind kind = newDataKind(context, parser, attrs, false, SipAddress.CONTENT_ITEM_TYPE, null, R.string.label_sip_address, - Weight.SIP_ADDRESS, R.layout.text_fields_editor_view, + Weight.SIP_ADDRESS, new SimpleInflater(R.string.label_sip_address), new SimpleInflater(SipAddress.SIP_ADDRESS)); @@ -1361,7 +1351,7 @@ public abstract class BaseAccountType extends AccountType { IOException { final DataKind kind = newDataKind(context, parser, attrs, false, GroupMembership.CONTENT_ITEM_TYPE, null, - R.string.groupsLabel, Weight.GROUP_MEMBERSHIP, -1, null, null); + R.string.groupsLabel, Weight.GROUP_MEMBERSHIP, null, null); kind.fieldList.add(new EditField(GroupMembership.GROUP_ROW_ID, -1, -1)); kind.maxLinesForDisplay = MAX_LINES_FOR_GROUP; @@ -1389,7 +1379,6 @@ public abstract class BaseAccountType extends AccountType { IOException { final DataKind kind = newDataKind(context, parser, attrs, false, Event.CONTENT_ITEM_TYPE, Event.TYPE, R.string.eventLabelsGroup, Weight.EVENT, - R.layout.event_field_editor_view, new EventActionInflater(), new SimpleInflater(Event.START_DATE)); kind.fieldList.add(new EditField(Event.DATA, R.string.eventLabelsGroup, FLAGS_EVENT)); @@ -1441,7 +1430,6 @@ public abstract class BaseAccountType extends AccountType { final DataKind kind = newDataKind(context, parser, attrs, false, Relation.CONTENT_ITEM_TYPE, Relation.TYPE, R.string.relationLabelsGroup, Weight.RELATIONSHIP, - R.layout.text_fields_editor_view, new RelationActionInflater(), new SimpleInflater(Relation.NAME)); kind.fieldList.add(new EditField(Relation.DATA, R.string.relationLabelsGroup, diff --git a/src/com/android/contacts/common/model/account/ExchangeAccountType.java b/src/com/android/contacts/common/model/account/ExchangeAccountType.java index 300e4d41..16e59cc7 100644 --- a/src/com/android/contacts/common/model/account/ExchangeAccountType.java +++ b/src/com/android/contacts/common/model/account/ExchangeAccountType.java @@ -78,7 +78,7 @@ public class ExchangeAccountType extends BaseAccountType { @Override protected DataKind addDataKindStructuredName(Context context) throws DefinitionException { DataKind kind = addKind(new DataKind(StructuredName.CONTENT_ITEM_TYPE, - R.string.nameLabelsGroup, -1, true, R.layout.structured_name_editor_view)); + R.string.nameLabelsGroup, -1, true)); kind.actionHeader = new SimpleInflater(R.string.nameLabelsGroup); kind.actionBody = new SimpleInflater(Nickname.NAME); @@ -107,7 +107,7 @@ public class ExchangeAccountType extends BaseAccountType { @Override protected DataKind addDataKindDisplayName(Context context) throws DefinitionException { DataKind kind = addKind(new DataKind(DataKind.PSEUDO_MIME_TYPE_DISPLAY_NAME, - R.string.nameLabelsGroup, -1, true, R.layout.text_fields_editor_view)); + R.string.nameLabelsGroup, -1, true)); boolean displayOrderPrimary = context.getResources().getBoolean(R.bool.config_editor_field_order_primary); @@ -140,7 +140,7 @@ public class ExchangeAccountType extends BaseAccountType { @Override protected DataKind addDataKindPhoneticName(Context context) throws DefinitionException { DataKind kind = addKind(new DataKind(DataKind.PSEUDO_MIME_TYPE_PHONETIC_NAME, - R.string.name_phonetic, -1, true, R.layout.phonetic_name_editor_view)); + R.string.name_phonetic, -1, true)); kind.actionHeader = new SimpleInflater(R.string.nameLabelsGroup); kind.actionBody = new SimpleInflater(Nickname.NAME); @@ -304,9 +304,8 @@ public class ExchangeAccountType extends BaseAccountType { } protected DataKind addDataKindEvent(Context context) throws DefinitionException { - DataKind kind = addKind( - new DataKind(Event.CONTENT_ITEM_TYPE, R.string.eventLabelsGroup, 150, true, - R.layout.event_field_editor_view)); + DataKind kind = addKind(new DataKind(Event.CONTENT_ITEM_TYPE, R.string.eventLabelsGroup, + 150, true)); kind.actionHeader = new EventActionInflater(); kind.actionBody = new SimpleInflater(Event.START_DATE); diff --git a/src/com/android/contacts/common/model/account/GoogleAccountType.java b/src/com/android/contacts/common/model/account/GoogleAccountType.java index a5a2c57f..33a8f630 100644 --- a/src/com/android/contacts/common/model/account/GoogleAccountType.java +++ b/src/com/android/contacts/common/model/account/GoogleAccountType.java @@ -116,7 +116,7 @@ public class GoogleAccountType extends BaseAccountType { private DataKind addDataKindRelation(Context context) throws DefinitionException { DataKind kind = addKind(new DataKind(Relation.CONTENT_ITEM_TYPE, - R.string.relationLabelsGroup, 160, true, R.layout.text_fields_editor_view)); + R.string.relationLabelsGroup, 160, true)); kind.actionHeader = new RelationActionInflater(); kind.actionBody = new SimpleInflater(Relation.NAME); @@ -151,7 +151,7 @@ public class GoogleAccountType extends BaseAccountType { private DataKind addDataKindEvent(Context context) throws DefinitionException { DataKind kind = addKind(new DataKind(Event.CONTENT_ITEM_TYPE, - R.string.eventLabelsGroup, 150, true, R.layout.event_field_editor_view)); + R.string.eventLabelsGroup, 150, true)); kind.actionHeader = new EventActionInflater(); kind.actionBody = new SimpleInflater(Event.START_DATE); diff --git a/src/com/android/contacts/common/model/dataitem/DataKind.java b/src/com/android/contacts/common/model/dataitem/DataKind.java index 3905d563..e4b6aeab 100644 --- a/src/com/android/contacts/common/model/dataitem/DataKind.java +++ b/src/com/android/contacts/common/model/dataitem/DataKind.java @@ -20,7 +20,6 @@ import android.content.ContentValues; import android.content.Context; import android.provider.ContactsContract.Data; -import com.android.contacts.common.R; import com.android.contacts.common.model.account.AccountType.EditField; import com.android.contacts.common.model.account.AccountType.EditType; import com.android.contacts.common.model.account.AccountType.StringInflater; @@ -65,9 +64,6 @@ public final class DataKind { public ContentValues defaultValues; - /** Layout resource id for an editor view to edit this {@link DataKind}. */ - public final int editorLayoutResourceId; - /** * If this is a date field, this specifies the format of the date when saving. The * date includes year, month and day. If this is not a date field or the date field is not @@ -89,18 +85,15 @@ public final class DataKind { public int maxLinesForDisplay; public DataKind() { - editorLayoutResourceId = R.layout.text_fields_editor_view; maxLinesForDisplay = 1; } - public DataKind(String mimeType, int titleRes, int weight, boolean editable, - int editorLayoutResourceId) { + public DataKind(String mimeType, int titleRes, int weight, boolean editable) { this.mimeType = mimeType; this.titleRes = titleRes; this.weight = weight; this.editable = editable; this.typeOverallMax = -1; - this.editorLayoutResourceId = editorLayoutResourceId; maxLinesForDisplay = 1; } @@ -127,7 +120,6 @@ public final class DataKind { sb.append(" typeList=").append(toString(typeList)); sb.append(" fieldList=").append(toString(fieldList)); sb.append(" defaultValues=").append(defaultValues); - sb.append(" editorLayoutResourceId=").append(editorLayoutResourceId); sb.append(" dateFormatWithoutYear=").append(toString(dateFormatWithoutYear)); sb.append(" dateFormatWithYear=").append(toString(dateFormatWithYear)); |