Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 655ad1a2 authored by Tingting Wang's avatar Tingting Wang
Browse files

Show all merged accounts in Contact editor.

Show all merged rawContacts' accounts in Contact editor, not
just primary account.
Expand all accounts to a list.
Clicking each account (rawContact) will go to the full editor
to editor the rawContact.

BUG 24547289

Change-Id: I671a946f87b25d9393daccb600287e35826fa6eb
parent 9093a095
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@

            <include layout="@layout/compact_account_info" />
            <include layout="@layout/editor_account_selector" />
            <include layout="@layout/editor_all_rawcontacts_accounts_selector" />

            <include layout="@layout/compact_contact_editor_fields"/>

+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@

        <include layout="@layout/compact_account_info" />
        <include layout="@layout/editor_account_selector" />
        <include layout="@layout/editor_all_rawcontacts_accounts_selector" />

        <!-- Dummy view so the first input field is not initially focused. b/21644158 -->
        <View
+79 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2015 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.
-->

<!-- Header at the top of a raw contact editor. This allows users to change the account that
    the raw contact is saved in. -->
<LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/all_rawcontacts_accounts_container"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:orientation="horizontal"
        android:paddingTop="8dip"
        android:paddingBottom="8dip"
        android:gravity="center_vertical"
        android:visibility="gone" >

    <ImageView
            android:id="@+id/primary_account_icon"
            android:src="@drawable/ic_account_circle_black_24dp"
            android:layout_width="@dimen/detail_network_icon_size"
            android:layout_height="@dimen/detail_network_icon_size"
            android:layout_margin="16dip"
            android:layout_gravity="center_vertical"/>

    <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_gravity="center_vertical"
            android:layout_weight="1">

        <TextView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:text="@string/compact_editor_linked_contacts_title"
                android:textSize="16sp"
                android:singleLine="true"
                android:textColor="@color/primary_text_color"
                android:layout_gravity="center_vertical"
                android:gravity="center_vertical"
                android:ellipsize="end" />

        <TextView
                android:id="@+id/rawcontacts_accounts_summary"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:textSize="16sp"
                android:singleLine="true"
                android:textColor="@color/primary_text_color"
                android:layout_gravity="center_vertical"
                android:gravity="center_vertical"
                android:ellipsize="end" />
    </LinearLayout>

    <ImageView
            android:src="@drawable/ic_menu_expander_minimized_holo_light"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical|end"
            android:layout_alignParentEnd="true"
            android:paddingStart="@dimen/editor_round_button_padding_left"
            android:paddingEnd="@dimen/editor_round_button_padding_right"
            android:paddingTop="@dimen/editor_round_button_padding_top"
            android:paddingBottom="@dimen/editor_round_button_padding_bottom"/>

</LinearLayout>
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
@@ -791,4 +791,7 @@

    <!-- Account type with number in quick contact suggestion card [CHAR LIMIT=30]-->
    <string name="quickcontact_suggestion_account_type"><xliff:g id="account_type">%s</xliff:g><xliff:g id="account_type_number">%s</xliff:g></string>

    <!-- Merged contacts title showing in contact editor UI. [CHAR LIMIT=30]-->
    <string name="compact_editor_linked_contacts_title">Merged contacts</string>
</resources>
+15 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ package com.android.contacts.editor;
import com.android.contacts.ContactSaveService;
import com.android.contacts.R;
import com.android.contacts.activities.CompactContactEditorActivity;
import com.android.contacts.activities.ContactEditorActivity;
import com.android.contacts.activities.ContactEditorBaseActivity;
import com.android.contacts.common.model.AccountTypeManager;
import com.android.contacts.common.model.RawContactDelta;
import com.android.contacts.common.model.RawContactDeltaList;
@@ -257,6 +259,19 @@ public class CompactContactEditorFragment extends ContactEditorBaseFragment impl
        getEditorActivity().changePhoto(getPhotoMode());
    }

    @Override
    public void onRawContactSelected(Uri uri, long rawContactId) {
        final Activity activity = getActivity();
        if (activity != null && !activity.isFinishing()) {
            final Intent intent = new Intent(activity, ContactEditorActivity.class);
            intent.setAction(ContactEditorBaseActivity.ACTION_EDIT);
            intent.setData(uri);
            intent.putExtra(ContactEditorFragment.INTENT_EXTRA_RAW_CONTACT_ID_TO_DISPLAY_ALONE,
                    rawContactId);
            activity.startActivity(intent);
        }
    }

    private int getPhotoMode() {
        if (getContent().isWritablePhotoSet()) {
            return isMultiAccountContact()
Loading