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

Commit 342a1e77 authored by yoichi kakimoto's avatar yoichi kakimoto Committed by android-build-merger
Browse files

Merge "Fixed to Added the function to add the Phonetic name into Phonetic...

Merge "Fixed to Added the function to add the Phonetic name into Phonetic field automaticaly." am: 420c3649
am: ec84224d

Change-Id: Ib80f014d5f54b7e9face9fef8bfb4c466d4f008f
parents e18600ad ec84224d
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ListPopupWindow;
import android.widget.Toast;
@@ -100,6 +101,7 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Set;

/**
@@ -1280,6 +1282,13 @@ public class ContactEditorFragment extends Fragment implements
        if (uri != null) {
            editorView.setFullSizePhoto(uri);
        }
        final StructuredNameEditorView nameEditor = editorView.getNameEditorView();
        final TextFieldsEditorView phoneticNameEditor = editorView.getPhoneticEditorView();
        final boolean useJapaneseOrder = 
                       Locale.JAPANESE.getLanguage().equals(Locale.getDefault().getLanguage());
        if (useJapaneseOrder && nameEditor != null && phoneticNameEditor != null) {
            nameEditor.setPhoneticView(phoneticNameEditor);
        }

        // The editor is ready now so make it visible
        editorView.setEnabled(mEnabled);
+10 −0
Original line number Diff line number Diff line
@@ -80,6 +80,16 @@ public interface Editor {
     */
    public void onFieldChanged(String column, String value);

    /**
     * Update the phonetic field with the specified character string.
     */
    public void updatePhonetic(String column, String value);

    /**
     * Returns the phonetic field string of the specified column.
     */
    public String getPhonetic(String column);

    /**
     * Marks the underlying ValuesDelta as deleted, but does not update the view.
     */
+13 −0
Original line number Diff line number Diff line
@@ -254,6 +254,19 @@ public class KindSectionView extends LinearLayout {
        return (StructuredNameEditorView) mEditors.getChildAt(0);
    }

    public TextFieldsEditorView getPhoneticEditorView() {
        if (!StructuredName.CONTENT_ITEM_TYPE.equals(mKindSectionData.getMimeType())) {
            return null;
        }
        for (int i = 0; i < mEditors.getChildCount(); i++) {
            final View view = mEditors.getChildAt(i);
            if (!(view instanceof StructuredNameEditorView)) {
                return (TextFieldsEditorView) view;
            }
        }
        return null;
    }

    /**
     * Binds views for the given {@link KindSectionData}.
     *
+11 −0
Original line number Diff line number Diff line
@@ -331,6 +331,17 @@ public abstract class LabeledEditorView extends LinearLayout implements Editor,
        notifyEditorListener();
    }

    /** {@inheritDoc} */
    @Override
    public void updatePhonetic(String column, String value) {
    }

    /** {@inheritDoc} */
    @Override
    public String getPhonetic(String column){
        return "";
    }

    protected void saveValue(String column, String value) {
        mEntry.put(column, value);
    }
+7 −0
Original line number Diff line number Diff line
@@ -387,6 +387,13 @@ public class RawContactEditorView extends LinearLayout implements View.OnClickLi
                ? null : nameKindSectionView.getNameEditorView();
    }

    public TextFieldsEditorView getPhoneticEditorView() {
        final KindSectionView kindSectionView = mKindSectionViewMap
                .get(StructuredName.CONTENT_ITEM_TYPE);
        return kindSectionView == null
                ? null : kindSectionView.getPhoneticEditorView();
    }

    public RawContactDelta getCurrentRawContactDelta() {
        return mCurrentRawContactDelta;
    }
Loading