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

Commit 0486566c authored by junhezhang's avatar junhezhang Committed by Junhe Zhang
Browse files

Move Im and SipAddress to legacy field

Legacy field support delete and copy (no insert)
Legacy field container will be remove once all children are removed.

Screenshots:

1. Legacy section with SipAddress and Im: https://screenshot.googleplex.com/8okHE6rDPpE4nqu.png
2. Copy Im: https://screenshot.googleplex.com/9AMDNPAjinpDfbg.png
3. Remove Im: https://screenshot.googleplex.com/7yfdnzV3xhBqfPa
4. Remove all: https://screenshot.googleplex.com/52xDnmsk7CPeFEW.png

Test: manually opened the editor screen with legacy mimetypes
Bug: 313983836
Change-Id: Icadaa89ef42808d0601f12cf00c7e7e5910b4abc
parent 4fc850bc
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -48,4 +48,29 @@

    </LinearLayout>

    <LinearLayout
        android:id="@+id/legacy_fields_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:orientation="vertical"
        android:visibility="gone">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textAllCaps="true"
            android:layout_marginStart="16dp"
            android:textAppearance="?attr/textAppearanceOverline"
            android:singleLine="true"
            android:layout_marginBottom="24dp"
            android:textSize="11sp"
            android:text="@string/editor_uneditable_section_title" />

        <LinearLayout
            android:id="@+id/legacy_section_views"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" />
    </LinearLayout>

</merge>
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
@@ -44,6 +44,9 @@
    <!-- An ID to be used for contents of a custom dialog so that its state be preserved -->
    <item type="id" name="custom_dialog_content" />

    <!-- An ID to be used for tagging text for copy in legacy fields. -->
    <item name="text_to_copy" type="id"/>

    <!-- Menu group ID for settings and help & feedback  -->
    <item type="id" name="nav_misc" />

+3 −0
Original line number Diff line number Diff line
@@ -425,6 +425,9 @@
    <!-- The button to add an label field to a contact in the Raw Contact Editor [CHAR LIMIT=15] -->
    <string name="group_edit_field_hint_text">Label</string>

    <!-- Editor section title to show below shown editor fields are not editable. Users are only allowed to delete them. [CHAR LIMIT=NONE] -->
    <string name="editor_uneditable_section_title">Can’t update this info</string>

    <!-- Content description for a cancel button. [CHAR LIMIT=NONE] -->
    <string name="cancel_button_content_description">Cancel</string>

+6 −0
Original line number Diff line number Diff line
@@ -114,4 +114,10 @@ public interface Editor {
     */
    public void editNewlyAddedField();

    /**
     * Marks the Editor field as a legacy field. Legacy fields are deprecated MIME types
     * which are not fully supported in the editor.
     * Adding or editing legacy field are not supported.
     */
    void setLegacyField(boolean isLegacyField);
}
+4 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ import com.android.contacts.util.ContactPhotoUtils;
import com.android.contacts.util.MaterialColorMapUtils.MaterialPalette;
import com.android.contacts.widget.QuickContactImageView;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.Maps;

import java.io.FileNotFoundException;
@@ -95,6 +96,9 @@ public class EditorUiUtils {
        mimetypeLayoutMap.put(Event.CONTENT_ITEM_TYPE, R.layout.event_field_editor_view);
    }

    public static final ImmutableList<String> LEGACY_MIME_TYPE =
        ImmutableList.of(Im.CONTENT_ITEM_TYPE, SipAddress.CONTENT_ITEM_TYPE);

    /**
     * Fetches a layout for a given mimetype.
     *
Loading