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

Commit 1649d422 authored by Wenyi Wang's avatar Wenyi Wang Committed by Android (Google) Code Review
Browse files

Merge "Hide phonetic name view when phonetic name data kind is not present"...

Merge "Hide phonetic name view when phonetic name data kind is not present" into ub-contactsdialer-g-dev
parents 98d41d71 95130ade
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -380,8 +380,10 @@ public abstract class LabeledEditorView extends LinearLayout implements Editor,
    }

    protected void rebuildValues() {
        if (mKind != null) {
            setValues(mKind, mEntry, mState, mReadOnly, mViewIdGenerator);
        }
    }

    /**
     * Prepare this editor using the given {@link DataKind} for defining structure and
+7 −4
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.android.contacts.common.model.account.AccountDisplayInfo;
@@ -247,9 +246,13 @@ public class RawContactEditorView extends BaseRawContactEditorView {
                mName.setValues(
                        type.getKindForMimetype(DataKind.PSEUDO_MIME_TYPE_DISPLAY_NAME),
                        primary, state, false, vig);
                mPhoneticName.setValues(
                        type.getKindForMimetype(DataKind.PSEUDO_MIME_TYPE_PHONETIC_NAME),
                        primary, state, false, vig);
                final DataKind phoneticNameKind =
                        type.getKindForMimetype(DataKind.PSEUDO_MIME_TYPE_PHONETIC_NAME);
                if (phoneticNameKind != null) {
                    mPhoneticName.setValues(phoneticNameKind, primary, state, false, vig);
                } else {
                    mPhoneticName.setVisibility(View.GONE);
                }
                // It is useful to use Nickname outside of a KindSectionView so that we can treat it
                // as a part of StructuredName's fake KindSectionView, even though it uses a
                // different CP2 mime-type. We do a bit of extra work below to make this possible.