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

Commit a961aa60 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Contacts: fixed custom label handling in GenericEditorView.

Internal Bug: http://b/2173080
parent 1fb6275a
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -113,6 +113,7 @@ public class GenericEditorView extends RelativeLayout implements Editor, View.On
        mDelete.setVisibility(deletable ? View.VISIBLE : View.INVISIBLE);
    }

    @Override
    public void setEnabled(boolean enabled) {
        mLabel.setEnabled(enabled);
        final int count = mFields.getChildCount();
@@ -304,16 +305,17 @@ public class GenericEditorView extends RelativeLayout implements Editor, View.On
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();

                if (mType.customColumn != null) {
                final EditType selected = validTypes.get(which);
                if (selected.customColumn != null) {
                    // Show custom label dialog if requested by type.
                    //
                    // Only when the custum value input in the next step is correct one.
                    // this method also set the type value to what the user requested here.
                    mPendingType = validTypes.get(which);
                    mPendingType = selected;
                    createCustomDialog().show();
                } else {
                    // User picked type, and we're sure it's ok to actually write the entry.
                    mType = validTypes.get(which);
                    mType = selected;
                    mEntry.put(mKind.typeColumn, mType.rawValue);
                    rebuildLabel();
                }