Add placeholder button for showing fully expanded contact editor

Bug 19124091

Change-Id: I8051b8df460fd0bbc30466d736c7606caaa0837c
diff --git a/src/com/android/contacts/editor/CompactRawContactsEditorView.java b/src/com/android/contacts/editor/CompactRawContactsEditorView.java
index d8dea60..363fe8b 100644
--- a/src/com/android/contacts/editor/CompactRawContactsEditorView.java
+++ b/src/com/android/contacts/editor/CompactRawContactsEditorView.java
@@ -48,10 +48,23 @@
  * View to display information from multiple {@link RawContactDelta}s grouped together
  * (e.g. all the phone numbers from a {@link com.android.contacts.common.model.Contact} together.
  */
-public class CompactRawContactsEditorView extends LinearLayout {
+public class CompactRawContactsEditorView extends LinearLayout implements View.OnClickListener {
 
     private static final String TAG = "CompactEditorView";
 
+    /**
+     * Callbacks for hosts of {@link CompactRawContactsEditorView}s.
+     */
+    public interface Listener {
+
+        /**
+         * Invoked when the compact editor should be expanded to show all fields.
+         */
+        public void onExpandEditor();
+    }
+
+    private Listener mListener;
+
     private AccountTypeManager mAccountTypeManager;
     private LayoutInflater mLayoutInflater;
     private ViewIdGenerator mViewIdGenerator;
@@ -62,6 +75,7 @@
     private ViewGroup mPhoneNumbers;
     private ViewGroup mEmails;
     private ViewGroup mOther;
+    private View mMoreFields;
 
     public CompactRawContactsEditorView(Context context) {
         super(context);
@@ -71,6 +85,13 @@
         super(context, attrs);
     }
 
+    /**
+     * Sets the receiver for {@link CompactRawContactsEditorView} callbacks.
+     */
+    public void setListener(Listener listener) {
+        mListener = listener;
+    }
+
     @Override
     protected void onFinishInflate() {
         super.onFinishInflate();
@@ -85,6 +106,16 @@
         mPhoneNumbers = (LinearLayout) findViewById(R.id.phone_numbers);
         mEmails = (LinearLayout) findViewById(R.id.emails);
         mOther = (LinearLayout) findViewById(R.id.other);
+        mMoreFields = findViewById(R.id.more_fields);
+        mMoreFields.setOnClickListener(this);
+    }
+
+
+    @Override
+    public void onClick(View view) {
+        if (view.getId() == R.id.more_fields && mListener != null ) {
+            mListener.onExpandEditor();
+        }
     }
 
     @Override